TieAlgorithm#

class lsst.ts.wep.estimation.TieAlgorithm(opticalModel='offAxis', maxIter=30, compSequence=(4, 4, 6, 6, 13, 13, 13, 13, 22, 22, 22, 22), compGain=0.6, centerTol=1e-09, centerBinary=True, convergeTol=1e-09, maskKwargs=None, modelPupilKernelSize=2, binning=1, requireConverge=False, optimizeLinAlg=True)#

Bases: WfAlgorithm

Wavefront estimation algorithm class for the TIE solver.

The following sources discuss the details of the TIE algorithm: - https://sitcomtn-111.lsst.io - Xin (2015): http://arxiv.org/abs/1506.04839

Parameters:
  • opticalModel (str, optional) – The optical model to use for mapping between the image and pupil planes. Can be “offAxis”, “onAxis”, or “paraxial”. offAxis is a numerical model that is valid for all optical systems, but requires an accurate Batoid model. onAxis is an analytic model that is valid for all optical systems near the optical axis. paraxial is an analytic model that is valid for slow optical systems near the optical axis. offAxis is recommended when you have a Batoid model and onAxis is recommended when you do not. paraxial is primarily meant for testing (the default is “offAxis”) (the default is “offAxis”)

  • maxIter (int, optional) – The maximum number of iterations of the TIE loop. (the default is 30)

  • compSequence (iterable, optional) – An iterable that determines the maximum Noll index to compensate on each iteration of the TIE loop. For example, if compSequence = [4, 10], then on the first iteration, only Zk4 is used in image compensation and on iteration 2, Zk4-Zk10 are used. Once the end of the sequence has been reached, all Zernike coefficients are used during compensation. (the default is (4, 4, 6, 6, 13, 13, 13, 13, 22, 22, 22, 22))

  • compGain (float, optional) – The gain used to update the Zernikes for image compensation. (the default is 0.6)

  • centerTol (float, optional) – The maximum absolute change in any Zernike amplitude (in meters) for which the images need to be recentered. A smaller value causes the images to be recentered more often. If 0, images are recentered on every iteration. (the default is 1e-9)

  • centerBinary (bool, optional) – Whether to use a binary template when centering the image. (the default is True)

  • convergeTol (float, optional) – The maximum absolute change in any Zernike amplitude (in meters) between subsequent TIE iterations below which convergence is declared and iteration is stopped. (the default is 1e-9)

  • maskKwargs (dict or None, optional) – Dictionary of mask keyword arguments to pass to mask creation. To see possibilities, see the docstring for lsst.ts.wep.imageMapper.ImageMapper.createPupilMasks(). (the default is None)

  • modelPupilKernelSize (float, optional) – The size of the Gaussian kernel to convolve with the model pupil when estimating Zernikes with a single donut. (the default is 2)

  • binning (int, optional) – Binning factor to apply to the donut stamps before estimating Zernike coefficients. The default value of 1 means no binning. (the default is 1)

  • requireConverge (bool, optional) – Whether to require that the TIE converges. If True, and the TIE did not converge, the TIE returns NaNs. (the default is False)

  • optimizeLinAlg (bool, optional) – Whether to optimize the numpy einsum calls in the TIE solver. If True, the einsum calls are optimized for speed using the optimize keyword (the default is True).

Attributes Summary

binning

The binning factor to apply to donut stamps.

centerBinary

Whether to center donuts using a binary template.

centerTol

Max abs.

compGain

The compensation gain for the TIE loop.

compSequence

The compensation sequence for the TIE loop.

convergeTol

Mean abs.

history

The algorithm history.

maskKwargs

Mask keyword arguments to pass to ImageMapper.createPupilMasks().

maxIter

The maximum number of iterations in the TIE loop.

modelPupilKernelSize

Return the Gaussian kernel size for the model pupil.

opticalModel

The optical model to use for mapping the image to the pupil.

optimizeLinAlg

Whether to optimize the linear algebra calls.

requireConverge

Whether to require that the TIE converges.

requiresPairs

Whether the algorithm requires pairs to estimate Zernikes.

solver

The name of the TIE solver.

Attributes Documentation

binning#

The binning factor to apply to donut stamps.

centerBinary#

Whether to center donuts using a binary template.

centerTol#

Max abs. deviation in Zernike coeff. that requires re-centering.

compGain#

The compensation gain for the TIE loop.

compSequence#

The compensation sequence for the TIE loop.

convergeTol#

Mean abs. deviation in Zernikes (meters) at which TIE terminates.

history#

The algorithm history.

The history is a dictionary saving the intermediate products from each iteration of the TIE solver.

The initial products before the iteration begins are stored in history[0], which is a dictionary with the keys:

  • “intraInit” - the initial intrafocal image

  • “extraInit” - the initial extrafocal image

  • “zkStartIntra” - the starting intrafocal Zernikes

  • “zkStartExtra” - the starting extrafocal Zernikes

  • “zkStartMean” - the mean of the starting Zernikes. Note these

    Zernikes are added to zkBest to estimate the full OPD.

  • “pupil” - model pupil image, in the case where only one image

    was passed to the estimator.

  • “nollIndices” - array of Noll indices corresponding to the

    estimated Zernikes values.

Each iteration of the solver is then stored under indices >= 1. The entry for each iteration is also a dictionary, containing the following keys:

  • “intraComp” - the compensated intrafocal image

  • “extraComp” - the compensated extrafocal image

  • “I0” - the estimate of the beam intensity on the pupil

  • “dIdz” - estimate of z-derivative of intensity across the pupil

  • “zkCompIntra” - Zernikes for compensating the intrafocal image

  • “zkCompExtra” - Zernikes for compensating the extrafocal image

  • “zkResid” - the estimated residual Zernikes

  • “zkBest” - the best cumulative estimate the wavefront residual.

  • “zkSum” - the sum of zkBest and zkStartMean from history[0].

    This is the best estimate of the OPD at the end of this iteration.

  • “converged” - flag indicating if Zernike estimation has converged

  • “caustic” - flag indicating if a caustic has been hit

Note the units for all Zernikes are in meters, and the z-derivative in dIdz is also in meters. Furthermore, all Zernikes start with Noll index 4.

maskKwargs#

Mask keyword arguments to pass to ImageMapper.createPupilMasks().

maxIter#

The maximum number of iterations in the TIE loop.

modelPupilKernelSize#

Return the Gaussian kernel size for the model pupil.

opticalModel#

The optical model to use for mapping the image to the pupil.

optimizeLinAlg#

Whether to optimize the linear algebra calls.

requireConverge#

Whether to require that the TIE converges.

requiresPairs#

Whether the algorithm requires pairs to estimate Zernikes.

solver#

The name of the TIE solver.