LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
LSST Data Management Base Package
Loading...
Searching...
No Matches
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

 __init__ (self, *args, **kwargs)
 
 makeCoaddTempExpRecorder (self, visitId, num=0)
 
 makeCoaddInputs (self)
 
 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 162 of file coaddInputRecorder.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 172 of file coaddInputRecorder.py.

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

Member Function Documentation

◆ addVisitToCoadd()

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).

Parameters
----------
coaddInputs : `lsst.afw.Image.CoaddInputs`
    A record of the observations that are included in the coadd.
coaddTempExp : `lsst.afw.image.Exposure`
    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.
weight : `Unknown`

Returns
-------
inputVisitRecord : `Unknown`
    The record for the visit to allow subclasses to fill in additional fields or
    None if the inputRecorder catalogs for the coaddTempExp are not usable.

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

Definition at line 214 of file coaddInputRecorder.py.

214 def addVisitToCoadd(self, coaddInputs, coaddTempExp, weight):
215 """Called by AssembleCoaddTask when adding (a subset of) a coaddTempExp to a coadd. The
216 base class impementation extracts the CoaddInputs from the coaddTempExp and appends
217 them to the given coaddInputs, filling in the weight column(s).
218
219 Parameters
220 ----------
221 coaddInputs : `lsst.afw.Image.CoaddInputs`
222 A record of the observations that are included in the coadd.
223 coaddTempExp : `lsst.afw.image.Exposure`
224 Exposure object from which to obtain the PSF, WCS, and bounding
225 box for the entry in the 'visits' table. On return, the completed
226 CoaddInputs object will be attached to it.
227 weight : `Unknown`
228
229 Returns
230 -------
231 inputVisitRecord : `Unknown`
232 The record for the visit to allow subclasses to fill in additional fields or
233 None if the inputRecorder catalogs for the coaddTempExp are not usable.
234
235 Notes
236 -----
237 Note that the passed coaddTempExp may be a subimage, but that this method will only be
238 called for the first subimage.
239 """
240 tempExpInputs = coaddTempExp.getInfo().getCoaddInputs()
241 if len(tempExpInputs.visits) != 1:
242 self.log.warning("CoaddInputs for coaddTempExp should have exactly one record in visits table "
243 "(found %d). CoaddInputs for this visit will not be saved.",
244 len(tempExpInputs.visits))
245 return None
246 inputVisitRecord = tempExpInputs.visits[0]
247 outputVisitRecord = coaddInputs.visits.addNew()
248 outputVisitRecord.assign(inputVisitRecord)
249 outputVisitRecord.setD(self.visitWeightKey, weight)
250 outputVisitRecord.set(self.visitFilterKey, coaddTempExp.getFilter().physicalLabel)
251 for inputCcdRecord in tempExpInputs.ccds:
252 if inputCcdRecord.getL(self.ccdVisitKey) != inputVisitRecord.getId():
253 self.log.warning("CoaddInputs for coaddTempExp with id %d contains CCDs with visit=%d. "
254 "CoaddInputs may be unreliable.",
255 inputVisitRecord.getId(), inputCcdRecord.getL(self.ccdVisitKey))
256 outputCcdRecord = coaddInputs.ccds.addNew()
257 outputCcdRecord.assign(inputCcdRecord)
258 if self.config.saveCcdWeights:
259 outputCcdRecord.setD(self.ccdWeightKey, weight)
260 outputCcdRecord.set(self.ccdFilterKey, coaddTempExp.getFilter().physicalLabel)
261 return inputVisitRecord

◆ makeCoaddInputs()

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

Definition at line 210 of file coaddInputRecorder.py.

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

◆ makeCoaddTempExpRecorder()

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

Parameters
----------
visitId : `Unknown`
num : `int`, optional
    Number of CCDs for this visit that overlap this patch (for reserving memory).

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

Definition at line 194 of file coaddInputRecorder.py.

194 def makeCoaddTempExpRecorder(self, visitId, num=0):
195 """Return a CoaddTempExpInputRecorder instance to help with saving a CoaddTempExp's inputs.
196
197 Parameters
198 ----------
199 visitId : `Unknown`
200 num : `int`, optional
201 Number of CCDs for this visit that overlap this patch (for reserving memory).
202
203 Notes
204 -----
205 The visitId may be any number that is unique for each :that goes into a coadd,
206 but ideally should be something more meaningful that can be used to reconstruct a data ID.
207 """
208 return CoaddTempExpInputRecorder(self, visitId, num=num)
209

Member Data Documentation

◆ ccdCcdKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdCcdKey

Definition at line 181 of file coaddInputRecorder.py.

◆ ccdFilterKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdFilterKey

Definition at line 191 of file coaddInputRecorder.py.

◆ ccdGoodPixKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdGoodPixKey

Definition at line 184 of file coaddInputRecorder.py.

◆ ccdSchema

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdSchema

Definition at line 180 of file coaddInputRecorder.py.

◆ ccdVisitKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdVisitKey

Definition at line 182 of file coaddInputRecorder.py.

◆ ccdWeightKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdWeightKey

Definition at line 187 of file coaddInputRecorder.py.

◆ ConfigClass

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

Definition at line 170 of file coaddInputRecorder.py.

◆ visitFilterKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitFilterKey

Definition at line 189 of file coaddInputRecorder.py.

◆ visitGoodPixKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitGoodPixKey

Definition at line 176 of file coaddInputRecorder.py.

◆ visitSchema

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitSchema

Definition at line 174 of file coaddInputRecorder.py.

◆ visitWeightKey

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitWeightKey

Definition at line 178 of file coaddInputRecorder.py.


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