types

Submodules

arte.types.aperture module

@author: giuliacarla

class arte.types.aperture.CircularOpticalAperture(aperture_radius, cartes_coords)

Bases: object

This class defines the geometry of a circular optical aperture.

Parameters:
  • aperture_radius (float) – Radius of the optical aperture in [m].

  • cartes_coords (tuple of three floats) – Cartesian coordinates (x, y, z) of the aperture center in [m].

getApertureRadius()
getCartesianCoords()

arte.types.domainxy module

class arte.types.domainxy.DomainXY(xcoord_vector, ycoord_vector)

Bases: object

Holds information about a 2d domain

For users of the old IDL make_xy, this is the same in class form. Several initializers are provided to build a domain from different data.

Domains support astropy units and try to play nicely with them. For example, the shift() method will shift a domain using the correct unit if both the domain and the shift parameter has one. If not, everything is converted to unitless, shifted, and then the unit is applied again. Shapes and indexes in Python are strictly integer data type and cannot use a unit.

Domains can be compared with == and !=, but no ordering is defined between them.

In addition to the access methods, domain data can be Since the domain sampling is regular, the class internally only stores two linear vectors for the X and Y sampling. Everything else is dynamically calculated on the fly from these vectors.

boundingbox(x, y, span=1)

Returns a new domain around the specified point

contains(x, y)

Returns True if the coordinates are inside the domain

cropped(xmin, xmax, ymin, ymax)

Returns a new cropped DomainXY object

property extent

[xmin, xmax, ymin, ymax] = minimum and maximum coordinates

classmethod from_extent(xmin, xmax, ymin, ymax, npoints)

Build a domain from a bounding box

classmethod from_linspace(*args, **kwargs)

Cartesian product of two identical np.linspace(). Same arguments

classmethod from_makexy(*args, **kwargs)

Same arguments as make_xy

classmethod from_shape(shape, pixel_size=1)

Build a domain from a shape and a pixel size

classmethod from_xy_maps(xmap, ymap)

Build a domain from two 2d maps (like the ones from make_xy)

classmethod from_xy_vectors(x_vector, y_vector)

Build a domain as a cartesian product of two coordinate vectors

get_boundingbox_slice(x, y, span=1)

Slice that includes (x,y) with “span” pixels around

get_crop_slice(xmin, xmax, ymin, ymax)

Slice to crop the domain

help(search='', prefix='')

Interactive help

Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.

The prefix argument is prepended to the method name and is used for recursive help of every class member.

property origin

(x,y) = indexes of 0,0 coordinate, interpolated

property origin_in_px

(x,y) = indexes of 0,0 coordinate, interpolated

property radial_map

(r, angle [radians]) 2d map

restrict(x, y)

(x,y) = new coordinates restricted to be inside this domain

property shape

(y,x) domain shape

shift(dx, dy)

Shift the domain in place

shifted(dx, dy)

Returns a new shifted domain

property step

(dx,dy) = pixel size

property unit

(x,y) = units used on X and Y, or 1 otherwise

property xcoord

X coordinates vector

property xmap

X coordinates 2d map

property ycoord

Y coordinates vector

property ymap

Y coordinates 2d map

arte.types.fisba_measure module

class arte.types.fisba_measure.FisbaMeasure(filename)

Bases: object

TYPE_INTENSITY = 4
TYPE_RAW_PHASE_DATA = 3
TYPE_SURFACE_DEVIATION = 1
TYPE_WAVE_ABERRATION = 2
comment()
dataType()
map()

arte.types.guide_source module

@author: giuliacarla

class arte.types.guide_source.GuideSource(polar_coords, height)

Bases: object

This class defines the geometry of the guide source of interest.

Parameters:
  • polar_coords (tuple of two floats) – Source polar coordinates (rho, theta) in [arcsec, degrees]. theta is positive if generated by a counterclockwise rotation.

  • height (float) – Source height in [meters].

static fromPolarToCartesian(rho, theta, z)
getSourceCartesianCoords()
getSourcePolarCoords()

arte.types.mask module

arte.types.region_of_interest module

class arte.types.region_of_interest.RegionOfInterest(xmin, xmax, ymin, ymax)

Bases: object

cutOut(frame)
toNumpyArray()

arte.types.scalar_bidimensional_function module

class arte.types.scalar_bidimensional_function.ScalarBidimensionalFunction(values_array, xmap=None, ymap=None, domain=None)

Bases: object

Represents a scalar function in an XY plane

The function is initialized with a 2d value and one of the following:
  • a domain over which it is defined

  • two X and Y maps with the domain coordinates

  • (nothing passed) a default domain with the same shape as the value, with centered origin and unitary step

Parameters:
  • values_array (numpy.ndarray) – two-dimensional array with the function value

  • xmap (numpy.ndarray, optional) – two-dimensional array with the X coordinate at which each function value is sampled.

  • ymap (numpy.ndarray, optional) – two-dimensional array with the Y coordinate at which each function value is sampled.

  • domain (DomainXY instance, optional) – the domain over which the function is sampled.

Raises:

ValueError – if the input parameters do not satisfy the requirements, for example: - xmap is passed, but not ymap - both xmap/ymap and a domain has been passed - values_array is not a 2d array - shapes of values and xmap/ymap or domain don’t match

property domain

DomainXY instance

get_radial_profile()

Get the radial profile around the domain origin.

Assumes that the domain sampling is the same in the X and Y directions

get_roi(xmin, xmax, ymin, ymax)
help(search='', prefix='')

Interactive help

Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.

The prefix argument is prepended to the method name and is used for recursive help of every class member.

interpolate_in_xy(x, y, span=3)

Interpolate the function at points x,y

Returns an array of z[i] corresponding to the values interpolated at points x[i], y[i]

The interpolation algorithm is linear and uses a box of 3x3 points centered on the closest point to the interpolation coordinate

Parameters:
  • x (numpy.ndarray or tuple with size N) – 1D array of the x coordinates of the sampling points

  • y (numpy.ndarray or tuple with size N) – 1D array of the y coordinates of the sampling points

Returns:

z – array of shape (N,) of the sampled values. z[i] = interp(f, x[i], y[i])

Return type:

numpy.ndarray

plot_radial_profile()
property shape

(y,x) function shape

property values

2d values array

arte.types.slopes module

class arte.types.slopes.Slopes(mapX, mapY)

Bases: object

static fromNumpyArray(mapXAsMaskedNumpyArray, mapYAsMaskedNumpyArray)
mapX()
mapY()
numberOfSlopes()
toNumpyArray()
vector()
vectorX()
vectorY()

arte.types.wavefront module

class arte.types.wavefront.Wavefront(wf, counter=0)

Bases: object

counter()
static fromNumpyArray(wfAsNumpyArray, counter=0)
setCounter(counter)
std()
toNumpyArray()

arte.types.zernike_coefficients module

class arte.types.zernike_coefficients.ZernikeCoefficients(coefficients, counter=0)

Bases: object

FIRST_ZERNIKE_MODE = 2
counter()
static fromNumpyArray(coefficientsAsNumpyArray, counter=0)
getZ(zernikeIndexes)
numberOfModes()
setCounter(counter)
toDictionary()
toNumpyArray()
zernikeIndexes()

Module contents