DanishAlgorithm

class lsst.ts.wep.estimation.DanishAlgorithm(lstsqKwargs: Optional[dict] = None, binning: int = 1)

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, or args.

binningint, optional

Binning factor to apply to the donut stamps before estimating Zernike coefficients. The default value of 1 means no binning.

Attributes Summary

binning

Binning factor to apply to donut stamps.

history

The algorithm history.

lstsqKwargs

Keyword arguments for scipy.optimize.least_squares

requiresPairs

Whether the algorithm requires pairs to estimate Zernikes.

Methods Summary

estimateZk(I1[, I2, nollIndices, ...])

Return the wavefront Zernike coefficients in meters.

Attributes Documentation

binning

Binning factor to apply to donut stamps.

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

  • “nollIndices” - Noll indices for which Zernikes are estimated

  • “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, nollIndices: ~typing.Sequence = (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22), instrument: ~lsst.ts.wep.instrument.Instrument = <lsst.ts.wep.instrument.Instrument object>, startWithIntrinsic: bool = True, returnWfDev: bool = False, 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)

nollIndicesSequence, optional

List, tuple, or array of Noll indices for which you wish to estimate Zernike coefficients. Note these values must be unique, ascending, and >= 4. (the default is indices 4-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)

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)