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

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.

origin

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

origin_in_px

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

radial_map

(r, angle [radians]) 2d map

restrict(x, y)

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

shape

(y,x) domain shape

shift(dx, dy)

Shift the domain in place

shifted(dx, dy)

Returns a new shifted domain

step

(dx,dy) = pixel size

unit

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

xcoord

X coordinates vector

xmap

X coordinates 2d map

ycoord

Y coordinates vector

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

class arte.types.mask.AnnularMask(frameShape, maskRadius=None, maskCenter=None, inRadius=0)

Bases: arte.types.mask.CircularMask

Inheritance of CircularMask class to provide an annular mask

Added inRadius parameter, radius of central obstruction. Default inRadius values is 0 with AnnularMask converging to CircularMask

static fromMaskedArray(maskedArray)

Creates a CircularMask roughly corresponding to the mask of a masked array

Returns a CircularMask object having radius and center guessed from the passed mask using ImageMoments centroid and semiAxes. Important note: the created CircularMask object is not guaranteed to have the same set of valid points of the passed mask, but it is included in the passed mask, i.e. all the valid points of the created mask are also valid points of the passed masked array

Parameters:maskedArray (MaskedArray) – a masked array with a circular mask
Returns:circular_mask – a circular mask included in the mask of maskedArray
Return type:CircularMask
inRadius()
class arte.types.mask.CircularMask(frameShape, maskRadius=None, maskCenter=None)

Bases: object

Represent a circular mask

A array representing a circular pupil. Frame shape, pupil radius and center can be specified.

Use mask method to access the mask as boolean mask (e.g. to be used in a masked_array object) with False values where the frame is not masked (i.e. within the pupil) and True values outside

Use asTransmissionValue method to acces the mask as transmission mask, i.e. 1 within the pupil and 0 outside. Fractional transmission for edge pixels is not implemented

If a masked_array having a circular mask is available, the static method fromMaskedArray can be used to create a CircularMask object having the same shape of the masked array and the same pupil center and radius

Parameters:
  • frameShape (tuple (2,)) – shape of the returned array
  • maskRadius (real) – pupil radius in pixel
  • maskCenter (list (2,) or array) – Y-X coordinates of the pupil center in pixel
asTransmissionValue()
as_masked_array()
center()

Y, X coordinates of the mask center

Returns:center – Y, X coordinate of the mask center in the array reference system
Return type:array of shape (2,)
static fromMaskedArray(maskedArray)

Creates a CircularMask roughly corresponding to the mask of a masked array

Returns a CircularMask object having radius and center guessed from the passed mask using ImageMoments centroid and semiAxes. Important note: the created CircularMask object is not guaranteed to have the same set of valid points of the passed mask, but it is included in the passed mask, i.e. all the valid points of the created mask are also valid points of the passed masked array

Parameters:maskedArray (MaskedArray) – a masked array with a circular mask
Returns:circular_mask – a circular mask included in the mask of maskedArray
Return type:CircularMask
in_mask_indices()
mask()

Boolean mask of the Circular Mask

Returns:mask – mask of the circular pupil. Array is True outside the pupil, and False inside the pupil
Return type:boolean array
radius()

Radius of the mask

Returns:radius – mask radius in pixel
Return type:real
regionOfInterest()
shape()

Array shape

Returns:shape – shape of the mask array
Return type:list (2,)

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

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 value at x,y

plot_radial_profile()
shape

(y,x) function shape

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