DanishAlgorithm¶
- class lsst.ts.wep.estimation.DanishAlgorithm(lstsqKwargs: Optional[dict] = None)¶
Bases:
WfAlgorithm
Wavefront estimation algorithm class for Danish.
The Danish algorithm is based on Janish 2012: http://hdl.handle.net/1721.1/78543 Implemented and improved by Josh Meyers: https://github.com/jmeyers314/danish
- Parameters:
- lstsqKwargsdict, optional
A dictionary containing any of the keyword arguments for scipy.optimize.least_squares, except
fun
,x0
,jac
, orargs
.
Attributes Summary
The algorithm history.
Keyword arguments for scipy.optimize.least_squares
Whether the algorithm requires pairs to estimate Zernikes.
Methods Summary
estimateZk
(I1[, I2, jmax, instrument, ...])Return the wavefront Zernike coefficients in meters.
Attributes Documentation
- history¶
The algorithm history.
The history is a dictionary that contains intermediate products from the Zernike fitting. The dict contains entries for “intra” and/or “extra”, plus the final zernike estimate under “zk”.
The “intra” and “extra” entries are dictionaries that contain the following entries
“image” - the image that is being fit
“variance” - the background variance that was used for fitting
“zkStart” - the starting Zernike coefficients
“lstsqResult” - dictionary of results returned by least_squares
“zkFit” - the Zernike coefficients fit to the donut
“zkSum” - zkFit + the intrinsic Zernikes
“model” - the final forward-modeled donut image
“GalSimFFTSizeError” - whether this was hit during least_squares
Note the units for all Zernikes are in meters, and all Zernikes start with Noll index 4.
- lstsqKwargs¶
Keyword arguments for scipy.optimize.least_squares
- requiresPairs¶
Whether the algorithm requires pairs to estimate Zernikes.
Methods Documentation
- estimateZk(I1: ~lsst.ts.wep.image.Image, I2: ~typing.Optional[~lsst.ts.wep.image.Image] = None, jmax: int = 22, instrument: ~lsst.ts.wep.instrument.Instrument = <lsst.ts.wep.instrument.Instrument object>, startWithIntrinsic: bool = True, returnWfDev: bool = False, return4Up: bool = True, units: str = 'm', saveHistory: bool = False) ndarray ¶
Return the wavefront Zernike coefficients in meters.
- Parameters:
- I1DonutStamp
An Image object containing an intra- or extra-focal donut image.
- I2DonutStamp, optional
A second image, on the opposite side of focus from I1. (the default is None)
- jmaxint, optional
The maximum Zernike Noll index to estimate. (the default is 22)
- instrumentInstrument, optional
The Instrument object associated with the DonutStamps. (the default is the default Instrument)
- startWithIntrinsicbool, optional
Whether to start the Zernike estimation process from the intrinsic Zernikes rather than zero. (the default is True)
- returnWfDevbool, optional
If False, the full OPD is returned. If True, the wavefront deviation is returned. The wavefront deviation is defined as the OPD - intrinsic Zernikes. (the default is False)
- return4Upbool, optional
If True, the returned Zernike coefficients start with Noll index 4. If False, they follow the Galsim convention of starting with index 0 (which is meaningless), so the array index of the output corresponds to the Noll index. In this case, indices 0-3 are always set to zero, because they are not estimated by our pipeline. (the default is True)
- unitsstr, optional
Units in which the Zernike amplitudes are returned. Options are “m”, “nm”, “um”, or “arcsecs”. (the default is “m”)
- saveHistorybool, optional
Whether to save the algorithm history in the self.history attribute. If True, then self.history contains information about the most recent time the algorithm was run. (the default is False)
- Returns:
- np.ndarray
Zernike coefficients estimated from the image (or pair of images)