pyoptools.misc.pmisc.misc module

pyoptools.misc.pmisc.misc.cross(a, b)

3D Vector product producto vectorial

pyoptools.misc.pmisc.misc.hitlist2int(x, y, z, xi, yi)

Function that estimates an intensity distribution on a plane from a ray hitlist

pyoptools.misc.pmisc.misc.hitlist2int_list(x, y)

Function that estimates an intensity distribution on a plane from a ray hitlist. Returns the intensity samples as an x,y,I list

pyoptools.misc.pmisc.misc.interpolate_g(xi, yi, zi, xx, yy, knots=10, error=False, mask=None)

Create a grid of zi values interpolating the values from xi,yi,zi

ARGUMENTS

xi,yi,zi 1D Lists or arrays containing the values to use as base for the interpolation
xx,yy 1D vectors or lists containing the output coordinates
samples tuple containing the shape of the output array.
knots number of knots to be used in each direction
error if set to true, half of the points (x, y, z) are used to create the interpolation, and half are used to evaluate the interpolation error
pyoptools.misc.pmisc.misc.matrix_interpolation(M, i, j, type='bilinear')

Returns the interpolated value of a matrix, when the indices i,j are floating point numbers.

ARGUMENTS
M Matrix to interpolate
i,j Indices to interpolate
type Interpolation type. supported types: nearest,bilinear
pyoptools.misc.pmisc.misc.rot_x(tx)

Returns the transformation matrix for a rotation around the X axis

pyoptools.misc.pmisc.misc.rot_y(ty)

Returns the transformation matrix for a rotation around the Y axis

pyoptools.misc.pmisc.misc.rot_z(tz)

Returns the transformation matrix for a rotation around the Z axis

pyoptools.misc.pmisc.misc.spot_info(C)

Function that gives information about the average radius of the rays hitting a CCD.

Parameters:C (CCD) – Instance of the CCD to gather information from.
Returns:(Rm, (Xm, Ym), (Xmm , Ymm), Rmax )
Where
  • float: Rm is the mean Radius of the spot diagram
  • tuple: (Xm, Ym) are the mean X and Y values of the spot diagram
  • tuple: (Xmm, Ymm) are the mean radius in X and in Y
  • float: Rmax is the maximum radius

All the values are measured from the central coordinate (Xm, Ym) of the spot diagram.

Return type:tuple
pyoptools.misc.pmisc.misc.unwrap_py(inph, in_p=(), uv=6.283185307179586)

Return the input matrix unwrapped the value given in uv

The same as unwrapv, but using for-s, written in python

pyoptools.misc.pmisc.misc.unwrapv(inph, in_p=(), uv=6.283185307179586)

Return the input matrix unwrapped the value given in uv

This is a vectorized routine, but is not as fast as it should

pyoptools.misc.pmisc.misc.wavelength2RGB(wl)

Function to approximate and RGB tuple from the wavelength value

Parameter:

wavelength wavelength in um

if the wavelength is outside the visible spectrum returns (0,0,0) Original code found at:

http://www.physics.sfasu.edu/astro/color/spectra.html