JWST POPPY:docs

OpticalElement

class poppy.OpticalElement(name=u'unnamed optic', verbose=True, planetype=None, oversample=1, opdunits=u'meters')[source]

Base class for all optical elements, whether from FITS files or analytic functions.

If instantiated on its own, this just produces a null optical element (empty space, i.e. an identity function on transmitted wavefronts.) Use one of the many subclasses to create a nontrivial optic.

The OpticalElement class follows the behavoior of the Wavefront class, using units of meters/pixel in pupil space and arcsec/pixel in image space.

The internal implementation of this class represents an optic with an array for the electric field amplitude transmissivity (or reflectivity), plus an array for the optical path difference in units of meters. This representation was chosen since most typical optics of interest will have wavefront error properties that are independent of wavelength. Subclasses particularly the AnalyticOpticalElements extend this paradigm with optics that have wavelength-dependent properties.

The getPhasor() function is used to obtain the complex phasor for any desired wavelength based on the amplitude and opd arrays.

Parameters:

name : string

descriptive name for optic

verbose : bool

whether to be more verbose in log outputs while computing

planetype : int

either poppy._IMAGE or poppy._PUPIL

oversample : int

how much to oversample beyond Nyquist.

Attributes Summary

shape Return shape of the OpticalElement, as a tuple

Methods Summary

display([nrows, row, what, crosshairs, ax, ...]) Display plots showing an optic’s transmission and OPD.
getPhasor(wave) Compute a complex phasor from an OPD, given a wavelength.

Attributes Documentation

shape

Return shape of the OpticalElement, as a tuple

Methods Documentation

display(nrows=1, row=1, what=u'intensity', crosshairs=True, ax=None, colorbar=True, colorbar_orientation=None, title=None, opd_vmax=5e-07)[source]

Display plots showing an optic’s transmission and OPD.

Parameters:

what : str

What to display: ‘intensity’, ‘amplitude’, ‘phase’, or ‘both’ (meaning intensity + phase)

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]

Compute a complex phasor from an OPD, given a wavelength.

The returned value should be the complex phasor array as appropriate for multiplying by the wavefront amplitude.

Parameters:

wave : float or obj

either a scalar wavelength or a Wavefront object

Page Contents