LSST Applications  21.0.0-131-g8cabc107+528f53ee53,22.0.0+00495a2688,22.0.0+0ef2527977,22.0.0+11a2aa21cd,22.0.0+269b7e55e3,22.0.0+2c6b6677a3,22.0.0+64c1bc5aa5,22.0.0+7b3a3f865e,22.0.0+e1b6d2281c,22.0.0+ff3c34362c,22.0.1-1-g1b65d06+c95cbdf3df,22.0.1-1-g7058be7+1cf78af69b,22.0.1-1-g7dab645+2a65e40b06,22.0.1-1-g8760c09+64c1bc5aa5,22.0.1-1-g949febb+64c1bc5aa5,22.0.1-1-ga324b9c+269b7e55e3,22.0.1-1-gf9d8b05+ff3c34362c,22.0.1-10-g781e53d+9b51d1cd24,22.0.1-10-gba590ab+b9624b875d,22.0.1-13-g76f9b8d+2c6b6677a3,22.0.1-14-g22236948+57af756299,22.0.1-18-g3db9cf4b+9b7092c56c,22.0.1-18-gb17765a+2264247a6b,22.0.1-2-g8ef0a89+2c6b6677a3,22.0.1-2-gcb770ba+c99495d3c6,22.0.1-24-g2e899d296+4206820b0d,22.0.1-3-g7aa11f2+2c6b6677a3,22.0.1-3-g8c1d971+f253ffa91f,22.0.1-3-g997b569+ff3b2f8649,22.0.1-4-g1930a60+6871d0c7f6,22.0.1-4-g5b7b756+6b209d634c,22.0.1-6-ga02864e+6871d0c7f6,22.0.1-7-g3402376+a1a2182ac4,22.0.1-7-g65f59fa+54b92689ce,master-gcc5351303a+e1b6d2281c,w.2021.32
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask Class Reference
Inheritance diagram for lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def runDataRef (self, dataRefList)
 

Static Public Attributes

 RunnerClass = DataRefListRunner
 
 ConfigClass = MeasurePhotonTransferCurveTaskConfig
 

Detailed Description

A class to calculate, fit, and plot a PTC from a set of flat pairs.
The Photon Transfer Curve (var(signal) vs mean(signal)) is a standard
tool used in astronomical detectors characterization (e.g., Janesick 2001,
Janesick 2007). If ptcFitType is "EXPAPPROXIMATION" or "POLYNOMIAL",
this task calculates the PTC from a series of pairs of flat-field images;
each pair taken at identical exposure times. The difference image of each
pair is formed to eliminate fixed pattern noise, and then the variance
of the difference image and the mean of the average image
are used to produce the PTC. An n-degree polynomial or the approximation
in Equation 16 of Astier+19 ("The Shape of the Photon Transfer Curve
of CCD sensors", arXiv:1905.08677) can be fitted to the PTC curve. These
models include parameters such as the gain (e/DN) and readout noise.
Linearizers to correct for signal-chain non-linearity are also calculated.
The `Linearizer` class, in general, can support per-amp linearizers, but
in this task this is not supported.
If ptcFitType is "FULLCOVARIANCE", the covariances of the difference
images are calculated via the DFT methods described in Astier+19 and the
variances for the PTC are given by the cov[0,0] elements at each signal
level. The full model in Equation 20 of Astier+19 is fit to the PTC
to get the gain and the noise.

Parameters
----------
*args: `list`
    Positional arguments passed to the Task constructor. None used at this
    time.
**kwargs: `dict`
    Keyword arguments passed on to the Task constructor. None used at this
    time.

Definition at line 64 of file measurePtcGen2Task.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 100 of file measurePtcGen2Task.py.

100  def __init__(self, *args, **kwargs):
101  super().__init__(**kwargs)
102  self.makeSubtask("extract")
103  self.makeSubtask("solve")
104 

Member Function Documentation

◆ runDataRef()

def lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask.runDataRef (   self,
  dataRefList 
)
Run the Photon Transfer Curve (PTC) measurement task.
For a dataRef (which is each detector here),
and given a list of exposure pairs (postISR) at different exposure times,
measure the PTC.

Parameters
----------
dataRefList : `list` [`lsst.daf.peristence.ButlerDataRef`]
    Data references for exposures.

Definition at line 106 of file measurePtcGen2Task.py.

106  def runDataRef(self, dataRefList):
107  """Run the Photon Transfer Curve (PTC) measurement task.
108  For a dataRef (which is each detector here),
109  and given a list of exposure pairs (postISR) at different exposure times,
110  measure the PTC.
111 
112  Parameters
113  ----------
114  dataRefList : `list` [`lsst.daf.peristence.ButlerDataRef`]
115  Data references for exposures.
116  """
117  if len(dataRefList) < 2:
118  raise RuntimeError("Insufficient inputs to combine.")
119 
120  # setup necessary objects
121  dataRef = dataRefList[0]
122  camera = dataRef.get('camera')
123 
124  if len(set([dataRef.dataId[self.config.ccdKey] for dataRef in dataRefList])) > 1:
125  raise RuntimeError("Too many detectors supplied")
126  # Get exposure list.
127  expList = []
128  for dataRef in dataRefList:
129  try:
130  tempFlat = dataRef.get("postISRCCD")
131  except RuntimeError:
132  self.log.warn("postISR exposure could not be retrieved. Ignoring flat.")
133  continue
134  expList.append(tempFlat)
135  expIds = [exp.getInfo().getVisitInfo().getExposureId() for exp in expList]
136 
137  # Create dictionary of exposures, keyed by exposure time
138  expDict = arrangeFlatsByExpTime(expList)
139  # Call the "extract" (measure flat covariances) and "solve" (fit covariances) subtasks
140  resultsExtract = self.extract.run(inputExp=expDict, inputDims=expIds)
141  resultsSolve = self.solve.run(resultsExtract.outputCovariances, camera=camera)
142 
143  # Fill up the photodiode data, if found, that will be used by linearity task.
144  # Get expIdPairs from one of the amps
145  expIdsPairsList = []
146  ampNames = resultsSolve.outputPtcDataset.ampNames
147  for ampName in ampNames:
148  tempAmpName = ampName
149  if ampName not in resultsSolve.outputPtcDataset.badAmps:
150  break
151  for pair in resultsSolve.outputPtcDataset.inputExpIdPairs[tempAmpName]:
152  first, second = pair[0]
153  expIdsPairsList.append((first, second))
154 
155  resultsSolve.outputPtcDataset = self._setBOTPhotocharge(dataRef, resultsSolve.outputPtcDataset,
156  expIdsPairsList)
157  self.log.info("Writing PTC data.")
158  dataRef.put(resultsSolve.outputPtcDataset, datasetType="photonTransferCurveDataset")
159 
160  return
161 
daf::base::PropertySet * set
Definition: fits.cc:912
def arrangeFlatsByExpTime(exposureList, exposureIdList)
Definition: utils.py:594
def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, altMaskList=None, mask=None, supplementaryData=None)

Member Data Documentation

◆ ConfigClass

lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask.ConfigClass = MeasurePhotonTransferCurveTaskConfig
static

Definition at line 97 of file measurePtcGen2Task.py.

◆ RunnerClass

lsst.cp.pipe.ptc.measurePtcGen2Task.MeasurePhotonTransferCurveTask.RunnerClass = DataRefListRunner
static

Definition at line 96 of file measurePtcGen2Task.py.


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