Coverage for python/lsst/pipe/tasks/coaddInputRecorder.py : 87%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2008, 2009, 2010, 2011, 2012 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
"""Config for CoaddInputRecorderTask
The inputRecorder section of the various coadd tasks' configs should generally agree, or the schemas created by earlier tasks (like MakeCoaddTempExpTask) will not contain the fields filled by later tasks (like AssembleCoaddTask). """
dtype=bool, default=False, optional=False, doc=("Add records for CCDs we iterated over but did not add a coaddTempExp" " due to a lack of unmasked pixels in the coadd footprint.") ) dtype=bool, default=False, optional=False, doc=("Add records for CCDs we iterated over but did not add a coaddTempExp" " due to an exception (often due to the calexp not being found on disk).") ) dtype=bool, default=True, optional=False, doc=("Save the total number of good pixels in each coaddTempExp (redundant with a sum of" " good pixels in associated CCDs)") ) dtype=bool, default=True, optional=False, doc=("Save weights in the CCDs table as well as the visits table?" " (This is necessary for easy construction of CoaddPsf, but otherwise duplicate information.)") )
"""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(). """
"""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) """
"""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. """ except Exception as e: self.task.log.warn("Error getting detector serial number in visit %d; using -1; error=%s" % (self.visitRecord.getId(), e)) record.setI(self.task.ccdCcdKey, -1)
"""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. """ if False: # This causes a test failure, pending fix in issue HSC-802 coaddTempExp.setPsf(CoaddPsf(self.coaddInputs.ccds, wcs))
"""Set exposure info and bbox in an ExposureTable record
@param[in] exposure exposure whose info is to be recorded @param[in,out] record record of an ExposureTable to set """
"""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. """
doc="Number of good pixels in the coaddTempExp") doc="Weight for this visit in the coadd") doc="Foreign key for the visits (coaddTempExp) catalog") doc="Number of good pixels in this CCD") doc="Weight for this visit in the coadd") doc="Filter associated with this visit.") doc="Filter associated with this visit.")
"""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. """
"""Create a CoaddInputs object with schemas defined by the task configuration"""
"""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. """ self.log.warn("CoaddInputs for coaddTempExp should have exactly one record in visits table " "(found %d). CoaddInputs for this visit will not be saved." % len(tempExpInputs.visits)) return None self.log.warn("CoaddInputs for coaddTempExp with id %d contains CCDs with visit=%d. " "CoaddInputs may be unreliable." % (inputVisitRecord.getId(), inputCcdRecord.getL(self.ccdVisitKey))) |