API Reference

poppy Package

Physical Optics Propagation in PYthon (POPPY)

POPPY is a Python package that simulates physical optical propagation including diffraction. It implements a flexible framework for modeling Fraunhofer (far-field) diffraction and point spread function formation, particularly in the context of astronomical telescopes. POPPY was developed as part of a simulation package for JWST, but is more broadly applicable to many kinds of imaging simulations.

Developed by Marshall Perrin at STScI, 2010-2014, for use simulating the James Webb Space Telescope.

Documentation can be found online at https://pythonhosted.org/poppy/

This is an Astropy affiliated package.

Functions

display_PSF(HDUlist_or_filename[, ext, ...]) Display nicely a PSF from a given HDUlist or filename
display_PSF_difference([...]) Display nicely the difference of two PSFs from given files
display_EE([HDUlist_or_filename, ext, ...]) Display Encircled Energy curve for a PSF
measure_EE([HDUlist_or_filename, ext, ...]) measure encircled energy vs radius and return as an interpolator
display_psf(HDUlist_or_filename[, ext, ...]) Display nicely a PSF from a given HDUlist or filename
display_psf_difference([...]) Display nicely the difference of two PSFs from given files
display_ee([HDUlist_or_filename, ext, ...]) Display Encircled Energy curve for a PSF
measure_ee([HDUlist_or_filename, ext, ...]) measure encircled energy vs radius and return as an interpolator
display_profiles([HDUlist_or_filename, ext, ...]) Produce two plots of PSF radial profile and encircled energy
radial_profile([HDUlist_or_filename, ext, ...]) Compute a radial profile of the image.
measure_radial([HDUlist_or_filename, ext, ...]) measure azimuthally averaged radial profile of a PSF.
measure_fwhm([HDUlist_or_filename, ext, ...]) Measure FWHM by interpolation of the radial profile
measure_sharpness([HDUlist_or_filename, ext]) Compute image sharpness, the sum of pixel squares.
measure_centroid([HDUlist_or_filename, ext, ...]) Measure the center of an image via center-of-mass
measure_strehl([HDUlist_or_filename, ext, ...]) Measure Strehl for a PSF
measure_anisotropy([HDUlist_or_filename, ...])
specFromSpectralType(sptype[, return_list, ...]) Get Pysynphot Spectrum object from a user-friendly spectral type string.

Classes

Instrument([name]) A generic astronomical instrument, composed of (1) an optical system implemented using POPPY, optionally with several configurations such as selectable image plane or pupil plane stops, and (2) some defined spectral bandpass(es) such as selectable filters, implemented using pysynphot.
Wavefront([wavelength, npix, dtype, diam, ...]) A class representing a monochromatic wavefront that can be transformed between pupil and image planes (but not to intermediate planes, yet).
OpticalSystem([name, verbose, oversample, ...]) A class representing a series of optical elements, either Pupil, Image, or Detector planes, through which light can be propagated.
SemiAnalyticCoronagraph(ExistingOpticalSystem) A subclass of OpticalSystem that implements a specialized propagation algorithm for coronagraphs whose occulting mask has limited and small support in the image plane.
MatrixFTCoronagraph(ExistingOpticalSystem[, ...]) A subclass of OpticalSystem that implements a specialized propagation algorithm for coronagraphs which are most efficiently modeled by matrix Fourier transforms, and in which the semi-analytical/Babinet superposition approach does not apply.
OpticalElement([name, verbose, planetype, ...]) Base class for all optical elements, whether from FITS files or analytic functions.
FITSOpticalElement([name, transmission, ...]) Defines an arbitrary optic, based on amplitude transmission and/or OPD FITS files.
Rotation([angle, units, hide]) Performs a rotation of the axes in the optical train.
Detector([pixelscale, fov_pixels, ...]) A Detector is a specialized type of OpticalElement that forces a wavefront onto a specific fixed pixelization of an Image plane.
AnalyticOpticalElement([shift_x, shift_y, ...]) Defines an abstract analytic optical element, i.e.
ScalarTransmission([name, transmission]) Uniform transmission between 0 and 1.0 in intensity.
InverseTransmission([optic]) Given any arbitrary OpticalElement with transmission T(x,y)
BandLimitedCoron([name, kind, sigma, wavelength]) Defines an ideal band limited coronagraph occulting mask.
IdealFQPM([name, wavelength]) Defines an ideal 4-quadrant phase mask coronagraph, with its retardance set perfectly to 0.5 waves at one specific wavelength and varying linearly on either side of that.
RectangularFieldStop([name, width, height]) Defines an ideal rectangular field stop
SquareFieldStop([name, size]) Defines an ideal square field stop
AnnularFieldStop([name, radius_inner, ...]) Defines a circular field stop with an (optional) opaque circular center region
CircularOcculter([name, radius]) Defines an ideal circular occulter (opaque circle)
BarOcculter([name, width]) Defines an ideal bar occulter (like in MIRI’s Lyot coronagraph)
FQPM_FFT_aligner([name, direction]) Helper class for modeling FQPMs accurately
CircularAperture([name, radius, pad_factor, ...]) Defines an ideal circular pupil aperture
HexagonAperture([name, side, diameter, ...]) Defines an ideal hexagonal pupil aperture
MultiHexagonAperture([name, flattoflat, ...]) Defines a hexagonally segmented aperture
NgonAperture([name, nsides, radius, rotation]) Defines an ideal N-gon pupil aperture.
RectangleAperture([name, width, height, ...]) Defines an ideal rectangular pupil aperture
SquareAperture([name, size]) Defines an ideal square pupil aperture
SecondaryObscuration([name, ...]) Defines the central obscuration of an on-axis telescope including secondary mirror and
AsymmetricSecondaryObscuration([...]) Defines a central obscuration with one or more supports which can be oriented at
ThinLens([name, nwaves, ...]) An idealized thin lens, implemented as a Zernike defocus term.
GaussianAperture([name, fwhm, w, pupil_diam]) Defines an ideal Gaussian apodized pupil aperture,
CompoundAnalyticOptic([opticslist, name, ...]) Define a compound analytic optical element made up of the combination of two or more individual optical elements.
QuadPhase([z, planetype, name]) Quadratic phase factor, q(z) suitable for representing a radially-dependent wavefront curvature.
QuadraticLens([f_lens, planetype, name]) Gaussian Lens
FresnelWavefront(beam_radius[, units, ...]) Wavefront for Fresnel diffraction calculation.
FresnelOpticalSystem([name, pupil_diameter, ...]) Class representing a series of optical elements, through which light can be propagated using the Fresnel formalism.
WavefrontError(\*\*kwargs) A base class for different sources of wavefront error
ParameterizedWFE([name, coefficients, ...]) Define an optical element in terms of its distortion as decomposed into a set of orthonormal basis functions (e.g.
ZernikeWFE([name, coefficients, radius]) Define an optical element in terms of its Zernike components by providing coefficients for each Zernike term contributing to the analytic optical element.
SineWaveWFE([name, spatialfreq, amplitude, ...]) A single sine wave ripple across the optic

Class Inheritance Diagram

Inheritance diagram of poppy.instrument.Instrument, poppy.poppy_core.Wavefront, poppy.poppy_core.OpticalSystem, poppy.poppy_core.SemiAnalyticCoronagraph, poppy.poppy_core.MatrixFTCoronagraph, poppy.poppy_core.OpticalElement, poppy.poppy_core.FITSOpticalElement, poppy.poppy_core.Rotation, poppy.poppy_core.Detector, poppy.optics.AnalyticOpticalElement, poppy.optics.ScalarTransmission, poppy.optics.InverseTransmission, poppy.optics.BandLimitedCoron, poppy.optics.IdealFQPM, poppy.optics.RectangularFieldStop, poppy.optics.SquareFieldStop, poppy.optics.AnnularFieldStop, poppy.optics.CircularOcculter, poppy.optics.BarOcculter, poppy.optics.FQPM_FFT_aligner, poppy.optics.CircularAperture, poppy.optics.HexagonAperture, poppy.optics.MultiHexagonAperture, poppy.optics.NgonAperture, poppy.optics.RectangleAperture, poppy.optics.SquareAperture, poppy.optics.SecondaryObscuration, poppy.optics.AsymmetricSecondaryObscuration, poppy.optics.ThinLens, poppy.optics.GaussianAperture, poppy.optics.CompoundAnalyticOptic, poppy.fresnel.QuadPhase, poppy.fresnel.QuadraticLens, poppy.fresnel.FresnelWavefront, poppy.fresnel.FresnelOpticalSystem, poppy.wfe.WavefrontError, poppy.wfe.ParameterizedWFE, poppy.wfe.ZernikeWFE, poppy.wfe.SineWaveWFE

poppy.zernike Module

Functions

R(n, m, rho) Compute R[n, m], the Zernike radial polynomial
cached_zernike1(\*args, \*\*kwds) Compute Zernike based on Noll index j, using an LRU cache for efficiency.
hex_aperture([npix, rho, theta, vertical]) Return an aperture function for a hexagon.
hexike_basis([nterms, npix, rho, theta, ...]) Return a list of hexike polynomials 1-N following the
noll_indices(j) Convert from 1-D to 2-D indexing for Zernikes or Hexikes.
opd_expand(opd[, aperture, nterms, basis]) Given a wavefront OPD map, return the list of coefficients in a given basis set (by default, Zernikes) that best fit the OPD map.
str_zernike(n, m) Return analytic expression for a given Zernike in LaTeX syntax
zern_name(i) Return a human-readable text name corresponding to some Zernike term as specified
zernike(n, m[, npix, rho, theta, outside, ...]) Return the Zernike polynomial Z[m,n] for a given pupil.
zernike1(j, \*\*kwargs) Return the Zernike polynomial Z_j for pupil points {r,theta}.
zernike_basis([nterms, npix, rho, theta]) Return a cube of Zernike terms from 1 to N each as a 2D array showing the value at each point.