CalcZernikesTask#

class lsst.ts.wep.task.CalcZernikesTask(**kwargs)#

Bases: PipelineTask

Base class for calculating Zernike coeffs from pairs of DonutStamps.

This class joins the EstimateZernikes and CombineZernikes subtasks to be run on sets of DonutStamps.

Parameters:

kwargs (Any)

Methods Summary

blurClip(zkTable)

Look at the donut blur values returned for all values in a sensor and use sigma clipping to remove donuts that are outliers.

createZkTable(zkCoeffRaw)

Create the Zernike table to store Zernike Coefficients.

createZkTableMetadata()

Create the metadata for the Zernike table.

empty([qualityTable, zernikeTable])

Return empty results if no donuts are available.

initZkTable()

Initialize the table to store the Zernike coefficients

run(donutStampsExtra, donutStampsIntra[, ...])

Run task algorithm on in-memory data.

runQuantum(butlerQC, inputRefs, outputRefs)

Do butler IO and transform to provide in memory objects for tasks run method.

Methods Documentation

blurClip(zkTable)#

Look at the donut blur values returned for all values in a sensor and use sigma clipping to remove donuts that are outliers.

Parameters:

zkTable (astropy.table.QTable) – Zernike table.

Returns:

Zernike table where donuts with outlier donut blur values have been changed to false and the average recomputed.

Return type:

astropy.table.QTable

createZkTable(zkCoeffRaw)#

Create the Zernike table to store Zernike Coefficients.

Note this is written with the assumption that either extraStamps or intraStamps MIGHT be empty. This is because calcZernikesUnpairedTask also uses this method.

Parameters:

zkCoeffRaw (pipeBase.Struct) – All zernikes returned by self.estimateZernikes.run(…)

Returns:

table – Table with the Zernike coefficients

Return type:

astropy.table.QTable

createZkTableMetadata()#

Create the metadata for the Zernike table.

Returns:

metadata – Metadata for the Zernike table

Return type:

dict

empty(qualityTable=None, zernikeTable=None)#

Return empty results if no donuts are available. If it is a result of no quality donuts we still include the quality table results instead of an empty quality table.

Parameters:
  • qualityTable (astropy.table.QTable) – Quality table created with donut stamp input.

  • zernikeTable (astropy.table.QTable) – Zernike table created with donut stamp input.

Returns:

Empty output tables for zernikes. Empty quality table if no donuts. Otherwise contains quality table with donuts that all failed to pass quality check.

Return type:

lsst.pipe.base.Struct

initZkTable()#

Initialize the table to store the Zernike coefficients

Returns:

table – Table to store the Zernike coefficients

Return type:

astropy.table.QTable

run(donutStampsExtra, donutStampsIntra, intrinsicZernikesExtra=None, intrinsicZernikesIntra=None, numCores=1)#

Run task algorithm on in-memory data.

This method should be implemented in a subclass. This method will receive keyword-only arguments whose names will be the same as names of connection fields describing input dataset types. Argument values will be data objects retrieved from data butler. If a dataset type is configured with multiple field set to True then the argument value will be a list of objects, otherwise it will be a single object.

If the task needs to know its input or output DataIds then it also has to override the runQuantum method.

This method should return a Struct whose attributes share the same name as the connection fields describing output dataset types.

Parameters:

**kwargs (Any) – Arbitrary parameters accepted by subclasses.

Returns:

struct – Struct with attribute names corresponding to output connection fields.

Return type:

Struct

Examples

Typical implementation of this method may look like:

def run(self, *, input, calib):
    # "input", "calib", and "output" are the names of the
    # connection fields.

    # Assuming that input/calib datasets are `scalar` they are
    # simple objects, do something with inputs and calibs, produce
    # output image.
    image = self.makeImage(input, calib)

    # If output dataset is `scalar` then return object, not list
    return Struct(output=image)
Parameters:
  • donutStampsExtra (DonutStamps)

  • donutStampsIntra (DonutStamps)

  • intrinsicZernikesExtra (IntrinsicZernikes | None, default: None)

  • intrinsicZernikesIntra (IntrinsicZernikes | None, default: None)

  • numCores (int, default: 1)

runQuantum(butlerQC, inputRefs, outputRefs)#

Do butler IO and transform to provide in memory objects for tasks run method.

Parameters:
  • butlerQC (QuantumContext) – A butler which is specialized to operate in the context of a lsst.daf.butler.Quantum.

  • inputRefs (InputQuantizedConnection) – Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined input/prerequisite connections.

  • outputRefs (OutputQuantizedConnection) – Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined output connections.

Return type:

None