lsst.cp.pipe  21.0.0-16-g434b3eb+a783293e9c
Public Member Functions | Static Public Attributes | List of all members
lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask Class Reference
Inheritance diagram for lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask:

Public Member Functions

def runQuantum (self, butlerQC, inputRefs, outputRefs)
 
def run (self, inputExp, inputDims)
 
def measureMeanVarCov (self, exposure1, exposure2, region=None, covAstierRealSpace=False)
 

Static Public Attributes

 ConfigClass = PhotonTransferCurveExtractConfig
 

Detailed Description

Task to measure covariances from flat fields.
This task receives as input a list of flat-field images
(flats), and sorts these flats in pairs taken at the
same time (if there's a different number of flats,
those flats are discarded). The mean, variance, and
covariances are measured from the difference of the flat
pairs at a given time. The variance is calculated
via afwMath, and the covariance via the methods in Astier+19
(appendix A). In theory, var = covariance[0,0]. This should
be validated, and in the future, we may decide to just keep
one (covariance).

The measured covariances at a particular time (along with
other quantities such as the mean) are stored in a PTC dataset
object (`PhotonTransferCurveDataset`), which gets partially
filled. The number of partially-filled PTC dataset objects
will be less than the number of input exposures, but gen3
requires/assumes that the number of input dimensions matches
bijectively the number of output dimensions. Therefore, a
number of "dummy" PTC dataset are inserted in the output list
that has the partially-filled PTC datasets with the covariances.
This output list will be used as input of
`PhotonTransferCurveSolveTask`, which will assemble the multiple
`PhotonTransferCurveDataset`s into a single one in order to fit
the measured covariances as a function of flux to a particular
model.

Astier+19: "The Shape of the Photon Transfer Curve of CCD
sensors", arXiv:1905.08677.

Definition at line 142 of file cpExtractPtcTask.py.

Member Function Documentation

◆ measureMeanVarCov()

def lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask.measureMeanVarCov (   self,
  exposure1,
  exposure2,
  region = None,
  covAstierRealSpace = False 
)
Calculate the mean of each of two exposures and the variance
and covariance of their difference. The variance is calculated
via afwMath, and the covariance via the methods in Astier+19
(appendix A). In theory, var = covariance[0,0]. This should
be validated, and in the future, we may decide to just keep
one (covariance).

Parameters
----------
exposure1 : `lsst.afw.image.exposure.exposure.ExposureF`
    First exposure of flat field pair.
exposure2 : `lsst.afw.image.exposure.exposure.ExposureF`
    Second exposure of flat field pair.
region : `lsst.geom.Box2I`, optional
    Region of each exposure where to perform the calculations (e.g, an amplifier).
covAstierRealSpace : `bool`, optional
    Should the covariannces in Astier+19 be calculated in real space or via FFT?
    See Appendix A of Astier+19.

Returns
-------
mu : `float` or `NaN`
    0.5*(mu1 + mu2), where mu1, and mu2 are the clipped means of the regions in
    both exposures. If either mu1 or m2 are NaN's, the returned value is NaN.
varDiff : `float` or `NaN`
    Half of the clipped variance of the difference of the regions inthe two input
    exposures. If either mu1 or m2 are NaN's, the returned value is NaN.
covDiffAstier : `list` or `NaN`
    List with tuples of the form (dx, dy, var, cov, npix), where:
        dx : `int`
            Lag in x
        dy : `int`
            Lag in y
        var : `float`
            Variance at (dx, dy).
        cov : `float`
            Covariance at (dx, dy).
        nPix : `int`
            Number of pixel pairs used to evaluate var and cov.
    If either mu1 or m2 are NaN's, the returned value is NaN.

Definition at line 344 of file cpExtractPtcTask.py.

◆ run()

def lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask.run (   self,
  inputExp,
  inputDims 
)
Measure covariances from difference of flat pairs

Parameters
----------
inputExp : `dict` [`float`,
                (`~lsst.afw.image.exposure.exposure.ExposureF`,
                `~lsst.afw.image.exposure.exposure.ExposureF`, ...,
                `~lsst.afw.image.exposure.exposure.ExposureF`)]
    Dictionary that groups flat-field exposures that have the same
    exposure time (seconds).

inputDims : `list`
    List of exposure IDs.

Definition at line 200 of file cpExtractPtcTask.py.

◆ runQuantum()

def lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask.runQuantum (   self,
  butlerQC,
  inputRefs,
  outputRefs 
)
Ensure that the input and output dimensions are passed along.

Parameters
----------
butlerQC : `~lsst.daf.butler.butlerQuantumContext.ButlerQuantumContext`
    Butler to operate on.
inputRefs : `~lsst.pipe.base.connections.InputQuantizedConnection`
    Input data refs to load.
ouptutRefs : `~lsst.pipe.base.connections.OutputQuantizedConnection`
    Output data refs to persist.

Definition at line 177 of file cpExtractPtcTask.py.

Member Data Documentation

◆ ConfigClass

lsst.cp.pipe.ptc.cpExtractPtcTask.PhotonTransferCurveExtractTask.ConfigClass = PhotonTransferCurveExtractConfig
static

Definition at line 174 of file cpExtractPtcTask.py.


The documentation for this class was generated from the following file: