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 | Static Public Attributes | List of all members
lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask Class Reference
Inheritance diagram for lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def makeCoaddTempExpRecorder (self, visitId, num=0)
 
def makeCoaddInputs (self)
 
def addVisitToCoadd (self, coaddInputs, coaddTempExp, weight)
 

Public Attributes

 visitSchema
 
 visitGoodPixKey
 
 visitWeightKey
 
 ccdSchema
 
 ccdCcdKey
 
 ccdVisitKey
 
 ccdGoodPixKey
 
 ccdWeightKey
 
 visitFilterKey
 
 ccdFilterKey
 

Static Public Attributes

 ConfigClass = CoaddInputRecorderConfig
 

Detailed Description

Subtask that handles filling a CoaddInputs object for a coadd exposure, tracking the CCDs and
visits that went into a coadd.

The interface here is a little messy, but I think this is at least partly a product of a bit of
messiness in the coadd code it's plugged into.  I hope #2590 might result in a better design.

Definition at line 154 of file coaddInputRecorder.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 164 of file coaddInputRecorder.py.

164  def __init__(self, *args, **kwargs):
165  pipeBase.Task.__init__(self, *args, **kwargs)
166  self.visitSchema = afwTable.ExposureTable.makeMinimalSchema()
167  if self.config.saveVisitGoodPix:
168  self.visitGoodPixKey = self.visitSchema.addField("goodpix", type=numpy.int32,
169  doc="Number of good pixels in the coaddTempExp")
170  self.visitWeightKey = self.visitSchema.addField("weight", type=float,
171  doc="Weight for this visit in the coadd")
172  self.ccdSchema = afwTable.ExposureTable.makeMinimalSchema()
173  self.ccdCcdKey = self.ccdSchema.addField("ccd", type=numpy.int32, doc="cameraGeom CCD serial number")
174  self.ccdVisitKey = self.ccdSchema.addField("visit", type=numpy.int64,
175  doc="Foreign key for the visits (coaddTempExp) catalog")
176  self.ccdGoodPixKey = self.ccdSchema.addField("goodpix", type=numpy.int32,
177  doc="Number of good pixels in this CCD")
178  if self.config.saveCcdWeights:
179  self.ccdWeightKey = self.ccdSchema.addField("weight", type=float,
180  doc="Weight for this visit in the coadd")
181  self.visitFilterKey = self.visitSchema.addField("filter", type=str, size=32,
182  doc="Physical filter associated with this visit.")
183  self.ccdFilterKey = self.ccdSchema.addField("filter", type=str, size=32,
184  doc="Physical filter associated with this visit.")
185 

Member Function Documentation

◆ addVisitToCoadd()

def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.addVisitToCoadd (   self,
  coaddInputs,
  coaddTempExp,
  weight 
)
Called by AssembleCoaddTask when adding (a subset of) a coaddTempExp to a coadd.  The
base class impementation extracts the CoaddInputs from the coaddTempExp and appends
them to the given coaddInputs, filling in the weight column(s).

Note that the passed coaddTempExp may be a subimage, but that this method will only be
called for the first subimage

Returns the record for the visit to allow subclasses to fill in additional fields.
Warns and returns None if the inputRecorder catalogs for the coaddTempExp are not usable.

Definition at line 198 of file coaddInputRecorder.py.

198  def addVisitToCoadd(self, coaddInputs, coaddTempExp, weight):
199  """Called by AssembleCoaddTask when adding (a subset of) a coaddTempExp to a coadd. The
200  base class impementation extracts the CoaddInputs from the coaddTempExp and appends
201  them to the given coaddInputs, filling in the weight column(s).
202 
203  Note that the passed coaddTempExp may be a subimage, but that this method will only be
204  called for the first subimage
205 
206  Returns the record for the visit to allow subclasses to fill in additional fields.
207  Warns and returns None if the inputRecorder catalogs for the coaddTempExp are not usable.
208  """
209  tempExpInputs = coaddTempExp.getInfo().getCoaddInputs()
210  if len(tempExpInputs.visits) != 1:
211  self.log.warning("CoaddInputs for coaddTempExp should have exactly one record in visits table "
212  "(found %d). CoaddInputs for this visit will not be saved.",
213  len(tempExpInputs.visits))
214  return None
215  inputVisitRecord = tempExpInputs.visits[0]
216  outputVisitRecord = coaddInputs.visits.addNew()
217  outputVisitRecord.assign(inputVisitRecord)
218  outputVisitRecord.setD(self.visitWeightKey, weight)
219  outputVisitRecord.set(self.visitFilterKey, coaddTempExp.getFilterLabel().physicalLabel)
220  for inputCcdRecord in tempExpInputs.ccds:
221  if inputCcdRecord.getL(self.ccdVisitKey) != inputVisitRecord.getId():
222  self.log.warning("CoaddInputs for coaddTempExp with id %d contains CCDs with visit=%d. "
223  "CoaddInputs may be unreliable.",
224  inputVisitRecord.getId(), inputCcdRecord.getL(self.ccdVisitKey))
225  outputCcdRecord = coaddInputs.ccds.addNew()
226  outputCcdRecord.assign(inputCcdRecord)
227  if self.config.saveCcdWeights:
228  outputCcdRecord.setD(self.ccdWeightKey, weight)
229  outputCcdRecord.set(self.ccdFilterKey, coaddTempExp.getFilterLabel().physicalLabel)
230  return inputVisitRecord

◆ makeCoaddInputs()

def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.makeCoaddInputs (   self)
Create a CoaddInputs object with schemas defined by the task configuration

Definition at line 194 of file coaddInputRecorder.py.

194  def makeCoaddInputs(self):
195  """Create a CoaddInputs object with schemas defined by the task configuration"""
196  return afwImage.CoaddInputs(self.visitSchema, self.ccdSchema)
197 
A simple Persistable struct containing ExposureCatalogs that record the inputs to a coadd.
Definition: CoaddInputs.h:49

◆ makeCoaddTempExpRecorder()

def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.makeCoaddTempExpRecorder (   self,
  visitId,
  num = 0 
)
Return a CoaddTempExpInputRecorder instance to help with saving a CoaddTempExp's inputs.

The visitId may be any number that is unique for each CoaddTempExp that goes into a coadd,
but ideally should be something more meaningful that can be used to reconstruct a data ID.

Definition at line 186 of file coaddInputRecorder.py.

186  def makeCoaddTempExpRecorder(self, visitId, num=0):
187  """Return a CoaddTempExpInputRecorder instance to help with saving a CoaddTempExp's inputs.
188 
189  The visitId may be any number that is unique for each CoaddTempExp that goes into a coadd,
190  but ideally should be something more meaningful that can be used to reconstruct a data ID.
191  """
192  return CoaddTempExpInputRecorder(self, visitId, num=num)
193 

Member Data Documentation

◆ ccdCcdKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdCcdKey

Definition at line 173 of file coaddInputRecorder.py.

◆ ccdFilterKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdFilterKey

Definition at line 183 of file coaddInputRecorder.py.

◆ ccdGoodPixKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdGoodPixKey

Definition at line 176 of file coaddInputRecorder.py.

◆ ccdSchema

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdSchema

Definition at line 172 of file coaddInputRecorder.py.

◆ ccdVisitKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdVisitKey

Definition at line 174 of file coaddInputRecorder.py.

◆ ccdWeightKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdWeightKey

Definition at line 179 of file coaddInputRecorder.py.

◆ ConfigClass

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ConfigClass = CoaddInputRecorderConfig
static

Definition at line 162 of file coaddInputRecorder.py.

◆ visitFilterKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitFilterKey

Definition at line 181 of file coaddInputRecorder.py.

◆ visitGoodPixKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitGoodPixKey

Definition at line 168 of file coaddInputRecorder.py.

◆ visitSchema

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitSchema

Definition at line 166 of file coaddInputRecorder.py.

◆ visitWeightKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitWeightKey

Definition at line 170 of file coaddInputRecorder.py.


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