JWST POPPY:docs

AnalyticOpticalElement

class poppy.AnalyticOpticalElement(**kwargs)[source] [edit on github]

Bases: poppy.poppy_core.OpticalElement

Defines an abstract analytic optical element, i.e. one definable by some formula rather than by an input OPD or pupil file.

This class is useless on its own; instead use its various subclasses that implement appropriate getPhasor functions. It exists mostly to provide some behaviors & initialization common to all analytic optical elements.

Parameters :

name, verbose, oversample, planetype : various

Same as for OpticalElement

transmission, opd : string

These are not allowed for Analytic optical elements, and this class will raise an error if you try to set one.

Methods Summary

display([nrows, row, wavelength, npix]) Display an Analytic optic by first computing it onto a grid...
getPhasor(wave)
sample([wavelength, npix, grid_size, what, ...]) Sample the Analytic Optic onto a grid and return the array :Parameters: wavelength : float Wavelength in meters.
toFITS([outname, what, wavelength, npix]) Save an analytic optic computed onto a grid to a FITS file

Methods Documentation

display(nrows=1, row=1, wavelength=2e-06, npix=512, **kwargs)[source] [edit on github]

Display an Analytic optic by first computing it onto a grid...

Parameters :

wavelength : float

Wavelength to evaluate this optic’s properties at

npix : int

Number of pixels to use when sampling the analytic optical element.

what : str

What to display: ‘intensity’, ‘phase’, or ‘both’

ax : matplotlib.Axes instance

Axes to display into

nrows, row : integers

# of rows and row index for subplot display

crosshairs : bool

Display crosshairs indicating the center?

colorbar : bool

Show colorbar?

colorbar_orientation : bool

Desired orientation, horizontal or vertical? Default is horizontal if only 1 row of plots, else vertical

opd_vmax : float

Max value for OPD image display, in meters.

title : string

Plot label

getPhasor(wave)[source] [edit on github]
sample(wavelength=2e-06, npix=512, grid_size=None, what='amplitude', return_scale=False, phase_unit='waves')[source] [edit on github]

Sample the Analytic Optic onto a grid and return the array

Parameters :

wavelength : float

Wavelength in meters.

npix : integer

Number of pixels for sampling the array

grid_size : float

Field of view grid size (diameter) for sampling the optic, in meters for pupil plane optics and arcseconds for image planes. Default value is taken from the optic’s properties, if defined. Otherwise defaults to 6.5 meters or 2 arcseconds depending on plane.

what : string

What to return: optic ‘amplitude’ transmission, ‘intensity’ transmission, or ‘phase’. Note that phase with phase_unit = ‘waves’ should give the optical path difference, OPD.

phase_unit : string

Unit for returned phase array IF what==’phase’. One of ‘radians’, ‘waves’, ‘meters’.

return_scale : float

if True, will return a tuple containing the desired array and a float giving the pixel scale.

toFITS(outname=None, what='amplitude', wavelength=2e-06, npix=512)[source] [edit on github]

Save an analytic optic computed onto a grid to a FITS file

Page Contents