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).
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.
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.
237 Note that the passed coaddTempExp may be a subimage, but that this method will only be
238 called for the first subimage.
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))
246 inputVisitRecord = tempExpInputs.visits[0]
247 outputVisitRecord = coaddInputs.visits.addNew()
248 outputVisitRecord.assign(inputVisitRecord)
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:
260 outputCcdRecord.set(self.
ccdFilterKey, coaddTempExp.getFilter().physicalLabel)
261 return inputVisitRecord