LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder Class Reference

Public Member Functions

def __init__ (self, task, visitId, num=0)
 
def addCalExp (self, calExp, ccdId, nGoodPix)
 
def finish (self, coaddTempExp, nGoodPix=None)
 

Public Attributes

 task
 
 coaddInputs
 
 visitRecord
 

Detailed Description

A helper class for CoaddInputRecorderTask, managing the CoaddInputs object for that single
CoaddTempExp.  This will contain a single 'visit' record for the CoaddTempExp and a number of 'ccd'
records.

Should generally be created by calling CoaddInputRecorderTask.makeCoaddTempExp().

Definition at line 63 of file coaddInputRecorder.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.__init__ (   self,
  task,
  visitId,
  num = 0 
)
Constructor

@param task  The CoaddInputRecorderTask that is utilising us
@param visitId  Identifier (integer) for the visit
@param num  Number of CCDs for this visit that overlap this
                patch (for reserving memory)

Definition at line 71 of file coaddInputRecorder.py.

71  def __init__(self, task, visitId, num=0):
72  """Constructor
73 
74  @param task The CoaddInputRecorderTask that is utilising us
75  @param visitId Identifier (integer) for the visit
76  @param num Number of CCDs for this visit that overlap this
77  patch (for reserving memory)
78  """
79  self.task = task
80  self.coaddInputs = self.task.makeCoaddInputs()
81  self.coaddInputs.visits.reserve(1)
82  if num > 0:
83  self.coaddInputs.ccds.reserve(num)
84  self.visitRecord = self.coaddInputs.visits.addNew()
85  self.visitRecord.setId(visitId)
86 

Member Function Documentation

◆ addCalExp()

def lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.addCalExp (   self,
  calExp,
  ccdId,
  nGoodPix 
)
Add a 'ccd' record for a calexp just added to the CoaddTempExp

@param[in] calExp   Calibrated exposure just added to the CoaddTempExp, or None in case of
                    failures that should nonetheless be tracked.  Should be the original
                    calexp, in that it should contain the original Psf and Wcs, not the
                    warped and/or matched ones.
@param[in] ccdId    A unique numeric ID for the Exposure.
@param[in] nGoodPix Number of good pixels this image will contribute to the CoaddTempExp.
                    If saveEmptyCcds is not set and this value is zero, no record will be
                    added.

Definition at line 87 of file coaddInputRecorder.py.

87  def addCalExp(self, calExp, ccdId, nGoodPix):
88  """Add a 'ccd' record for a calexp just added to the CoaddTempExp
89 
90  @param[in] calExp Calibrated exposure just added to the CoaddTempExp, or None in case of
91  failures that should nonetheless be tracked. Should be the original
92  calexp, in that it should contain the original Psf and Wcs, not the
93  warped and/or matched ones.
94  @param[in] ccdId A unique numeric ID for the Exposure.
95  @param[in] nGoodPix Number of good pixels this image will contribute to the CoaddTempExp.
96  If saveEmptyCcds is not set and this value is zero, no record will be
97  added.
98  """
99  if nGoodPix == 0 and not self.task.config.saveEmptyCcds:
100  return
101  record = self.coaddInputs.ccds.addNew()
102  record.setId(ccdId)
103  record.setL(self.task.ccdVisitKey, self.visitRecord.getId())
104  try:
105  record.setI(self.task.ccdCcdKey, calExp.getDetector().getId())
106  except Exception as e:
107  self.task.log.warning("Error getting detector serial number in visit %d; using -1; error=%s",
108  self.visitRecord.getId(), e)
109  record.setI(self.task.ccdCcdKey, -1)
110  record.setI(self.task.ccdGoodPixKey, nGoodPix)
111  if calExp is not None:
112  self._setExposureInfoInRecord(exposure=calExp, record=record)
113  if self.task.config.saveCcdWeights:
114  record.setD(self.task.ccdWeightKey, 1.0) # No weighting or overlap when warping
115  record.set(self.task.ccdFilterKey, calExp.getFilterLabel().physicalLabel)
116 

◆ finish()

def lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.finish (   self,
  coaddTempExp,
  nGoodPix = None 
)
Finish creating the CoaddInputs for a CoaddTempExp.

@param[in,out] coaddTempExp   Exposure object from which to obtain the PSF, WCS, and bounding
                              box for the entry in the 'visits' table.  On return, the completed
                              CoaddInputs object will be attached to it.
@param[in]     nGoodPix       Total number of good pixels in the CoaddTempExp; ignored unless
                              saveVisitGoodPix is true.

Definition at line 117 of file coaddInputRecorder.py.

117  def finish(self, coaddTempExp, nGoodPix=None):
118  """Finish creating the CoaddInputs for a CoaddTempExp.
119 
120  @param[in,out] coaddTempExp Exposure object from which to obtain the PSF, WCS, and bounding
121  box for the entry in the 'visits' table. On return, the completed
122  CoaddInputs object will be attached to it.
123  @param[in] nGoodPix Total number of good pixels in the CoaddTempExp; ignored unless
124  saveVisitGoodPix is true.
125  """
126  self._setExposureInfoInRecord(exposure=coaddTempExp, record=self.visitRecord)
127  if self.task.config.saveVisitGoodPix:
128  self.visitRecord.setI(self.task.visitGoodPixKey, nGoodPix)
129  coaddTempExp.getInfo().setCoaddInputs(self.coaddInputs)
130  wcs = coaddTempExp.getWcs()
131  if False:
132  # This causes a test failure, pending fix in issue HSC-802
133  coaddTempExp.setPsf(CoaddPsf(self.coaddInputs.ccds, wcs))
134  apCorrMap = makeCoaddApCorrMap(self.coaddInputs.ccds, coaddTempExp.getBBox(afwImage.PARENT), wcs)
135  coaddTempExp.getInfo().setApCorrMap(apCorrMap)
136 
def makeCoaddApCorrMap(catalog, coaddBox, coaddWcs, weightFieldName="weight")

Member Data Documentation

◆ coaddInputs

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.coaddInputs

Definition at line 80 of file coaddInputRecorder.py.

◆ task

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.task

Definition at line 79 of file coaddInputRecorder.py.

◆ visitRecord

lsst.pipe.tasks.coaddInputRecorder.CoaddTempExpInputRecorder.visitRecord

Definition at line 84 of file coaddInputRecorder.py.


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