OpticalSystem
- class poppy.OpticalSystem(name='unnamed system', verbose=True, oversample=2, npix=None, pupil_diameter=None)[source]
Bases:
BaseOpticalSystem
A class representing a series of optical elements, either Pupil, Image, or Detector planes, through which light can be propagated.
The difference between Image and Detector planes is that Detectors have fixed pixels in terms of arcsec/pixel regardless of wavelength (computed via MFT) while Image planes have variable pixels scaled in terms of lambda/D. Pupil planes are some fixed size in meters, of course.
- Parameters:
- namestring
descriptive name of optical system
- oversampleint
Either how many times above Nyquist we should be (for pupil or image planes), or how many times a fixed detector pixel will be sampled. E.g.
oversample=2
means image plane sampling lambda/4*D (twice Nyquist) and detector plane sampling 2x2 computed pixels per real detector pixel. Default is 2.- verbosebool
whether to be more verbose with log output while computing
- pupil_diameterastropy.Quantity of dimension length
Diameter of entrance pupil. Defaults to size of first optical element if unspecified, or else 1 meter.
Methods Summary
add_image
([optic, function, index])Add an image plane optic to the optical system
add_pupil
([optic, function, index])Add a pupil plane optic from file(s) giving transmission or OPD
describe
()Print out a string table describing all planes in an optical system
input_wavefront
([wavelength, inwave])Create a Wavefront object suitable for sending through a given optical system, based on the size of the first optical plane, assumed to be a pupil.
propagate
(wavefront[, normalize, ...])Core low-level routine for propagating a wavefront through an optical system
Methods Documentation
- add_image(optic=None, function=None, index=None, **kwargs)[source]
Add an image plane optic to the optical system
That image plane optic can be specified either
- from file(s) giving transmission or OPD
[set arguments
transmission=filename
and/oropd=filename
]
- from an analytic function
[set
function='circle, fieldstop, bandlimitedcoron, or FQPM'
and set additional kwargs to define shape etc.
- from an already-created OpticalElement object
[set
optic=that object
]
- Parameters:
- opticpoppy.OpticalElement
An already-created OpticalElement you would like to add
- function: string
Name of some analytic function to add. Optional
kwargs
can be used to set the parameters of that function. Allowable function names are CircularOcculter, fieldstop, BandLimitedCoron, FQPM- opd, transmissionstring
Filenames of FITS files describing the desired optic.
- indexint
Index into the optical system’s planes for where to add the new optic. Defaults to appending the optic to the end of the plane list.
- Returns:
- poppy.OpticalElement subclass
The pupil optic added (either
optic
passed in, or a new OpticalElement created)
Notes
Now you can use the optic argument for either an OpticalElement or a string function name, and it will do the right thing depending on type. Both existing arguments are left for back compatibility for now.
- add_pupil(optic=None, function=None, index=None, **kwargs)[source]
Add a pupil plane optic from file(s) giving transmission or OPD
- from file(s) giving transmission and/or OPD
[set arguments
transmission=filename
and/oropd=filename
]
- from an already-created
OpticalElement
object [set
optic=that object
]
- from an already-created
- Parameters:
- opticpoppy.OpticalElement, optional
An already-created
OpticalElement
object you would like to add- functionstring, optional
Deprecated. The name of some analytic function you would like to use. Optional
kwargs
can be used to set the parameters of that function. Allowable function names are Circle, Square, Hexagon, Rectangle, and FQPM_FFT_Aligner- opd, transmissionstring, optional
Filenames of FITS files describing the desired optic.
- indexint
Index into the optical system’s planes for where to add the new optic. Defaults to appending the optic to the end of the plane list.
- Returns:
- poppy.OpticalElement subclass
The pupil optic added (either
optic
passed in, or a new OpticalElement created)- Note: Now you can use the optic argument for either an OpticalElement or a string function name,
- and it will do the right thing depending on type. Both existing arguments are left for compatibility for now.
- Any provided parameters are passed to
OpticalElement
.
- input_wavefront(wavelength=<Quantity 1.e-06 m>, inwave=None)[source]
Create a Wavefront object suitable for sending through a given optical system, based on the size of the first optical plane, assumed to be a pupil.
Defining this needs both a number of pixels (npix) and physical size (diam) to set the sampling.
If this OpticalSystem has a provided
npix
attribute that is not None, use that to set the input wavefront size. Otherwise, check if the first optical element has a defined sampling. If not, default to 1024 pixels.Uses self.source_offset to assign an off-axis tilt, if requested.
The convention here is that the desired source position is specified with respect to the final focal plane of the optical system. If there are any intervening coordinate transformation planes, this function attempts to take them into account when setting the tilt of the input wavefront. This is subtle trickery and may not work properly in all instances.
- Parameters:
- wavelengthfloat
Wavelength in meters
- Returns:
- wavefrontpoppy.Wavefront instance
A wavefront appropriate for passing through this optical system.
- propagate(wavefront, normalize='none', return_intermediates=False, display_intermediates=False)[source]
Core low-level routine for propagating a wavefront through an optical system
This is a linear operator that acts on an input complex wavefront to give an output complex wavefront.
- Parameters:
- wavefrontWavefront instance
Wavefront to propagate through this optical system
- normalizestring
How to normalize the wavefront? * ‘first’ = set total flux = 1 after the first optic, presumably a pupil * ‘last’ = set total flux = 1 after the entire optical system. * ‘exit_pupil’ = set total flux = 1 at the last pupil of the optical system.
- display_intermediatesbool
Should intermediate steps in the calculation be displayed on screen? Default: False.
- return_intermediatesbool
Should intermediate steps in the calculation be returned? Default: False. If True, the second return value of the method will be a list of
poppy.Wavefront
objects representing intermediate optical planes from the calculation.- Returns a wavefront, and optionally also the intermediate wavefronts after
- each step of propagation.