OpticalElement¶
-
class
poppy.
OpticalElement
(name='unnamed optic', verbose=True, planetype=<PlaneType.unspecified: 0>, oversample=1, interp_order=3)[source]¶ Bases:
object
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 get_phasor() function is used to obtain the complex phasor for any desired wavelength based on the amplitude and opd arrays. Those can individually be obtained from the get_transmission() and get_opd() functions.
- name : string
- descriptive name for optic
- verbose : bool
- whether to be more verbose in log outputs while computing
- planetype : int
- either poppy.PlaneType.image or poppy.PlaneType.pupil
- oversample : int
- how much to oversample beyond Nyquist.
- interp_order : int
- the order (0 to 5) of the spline interpolation used if the optic is resized.
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. get_opd
(wave)Return the optical path difference, given a wavelength. get_phasor
(wave)Compute a complex phasor from an OPD, given a wavelength. get_transmission
(wave)Return the electric field amplitude transmission, given a wavelength. Attributes Documentation
-
shape
¶ Return shape of the OpticalElement, as a tuple
Methods Documentation
-
display
(nrows=1, row=1, what='intensity', crosshairs=False, ax=None, colorbar=True, colorbar_orientation=None, title=None, opd_vmax=<Quantity 5.e-07 m>, wavelength=<Quantity 1.e-06 m>, npix=512, grid_size=None)[source]¶ Display plots showing an optic’s transmission and OPD.
- what : str
- What to display: ‘intensity’, ‘amplitude’, ‘phase’, ‘opd’, or ‘both’ (meaning intensity and OPD in two subplots)
- ax : matplotlib.Axes instance
- Axes to display into
- nrows, row : integers
- number 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 absolute value for OPD image display, in meters.
- title : string
- Plot label
- wavelength : float, default 1 micron
- For optics with wavelength-dependent behavior, evaluate at this wavelength for display.
- npix : integer
- For optics without a fixed pixel sampling, evaluate onto this many pixels for display.
- grid_size : float
- For optics without a fixed pixel sampling, evaluate onto this large a spatial or angular extent for display. Specify in units of arcsec for image plane optics, meters for all other optics. If unspecified, a default value will be chosen instead, possibly from the ._default_display_size attribute, if present.
-
get_opd
(wave)[source]¶ Return the optical path difference, given a wavelength.
- wave : float or obj
- either a scalar wavelength or a Wavefront object
ndarray giving OPD in meters