LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
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__
 
def makeCoaddTempExpRecorder
 
def makeCoaddInputs
 
def addVisitToCoadd
 

Public Attributes

 visitSchema
 
 visitGoodPixKey
 
 visitWeightKey
 
 ccdSchema
 
 ccdCcdKey
 
 ccdVisitKey
 
 ccdGoodPixKey
 
 ccdWeightKey
 

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 131 of file coaddInputRecorder.py.

Constructor & Destructor Documentation

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

Definition at line 141 of file coaddInputRecorder.py.

142  def __init__(self, *args, **kwargs):
143  pipeBase.Task.__init__(self, *args, **kwargs)
144  self.visitSchema = afwTable.ExposureTable.makeMinimalSchema()
145  if self.config.saveVisitGoodPix:
146  self.visitGoodPixKey = self.visitSchema.addField("goodpix", type=int,
147  doc="Number of good pixels in the coaddTempExp")
148  self.visitWeightKey = self.visitSchema.addField("weight", type=float,
149  doc="Weight for this visit in the coadd")
150  self.ccdSchema = afwTable.ExposureTable.makeMinimalSchema()
151  self.ccdCcdKey = self.ccdSchema.addField("ccd", type=int, doc="cameraGeom CCD serial number")
152  self.ccdVisitKey = self.ccdSchema.addField("visit", type=numpy.int64,
153  doc="Foreign key for the visits (coaddTempExp) catalog")
154  self.ccdGoodPixKey = self.ccdSchema.addField("goodpix", type=int,
155  doc="Number of good pixels in this CCD")
156  if self.config.saveCcdWeights:
157  self.ccdWeightKey = self.ccdSchema.addField("weight", type=float,
158  doc="Weight for this visit in the coadd")

Member Function Documentation

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 171 of file coaddInputRecorder.py.

172  def addVisitToCoadd(self, coaddInputs, coaddTempExp, weight):
173  """Called by AssembleCoaddTask when adding (a subset of) a coaddTempExp to a coadd. The
174  base class impementation extracts the CoaddInputs from the coaddTempExp and appends
175  them to the given coaddInputs, filling in the weight column(s).
176 
177  Note that the passed coaddTempExp may be a subimage, but that this method will only be
178  called for the first subimage
179 
180  Returns the record for the visit to allow subclasses to fill in additional fields.
181  Warns and returns None if the inputRecorder catalogs for the coaddTempExp are not usable.
182  """
183  tempExpInputs = coaddTempExp.getInfo().getCoaddInputs()
184  if len(tempExpInputs.visits) != 1:
185  self.log.warn("CoaddInputs for coaddTempExp should have exactly one record in visits table "
186  "(found %d). CoaddInputs for this visit will not be saved."
187  % len(tempExpInputs.visits))
188  return None
189  inputVisitRecord = tempExpInputs.visits[0];
190  outputVisitRecord = coaddInputs.visits.addNew()
191  outputVisitRecord.assign(inputVisitRecord)
192  outputVisitRecord.setD(self.visitWeightKey, weight)
193  for inputCcdRecord in tempExpInputs.ccds:
194  if inputCcdRecord.getL(self.ccdVisitKey) != inputVisitRecord.getId():
195  self.log.warn("CoaddInputs for coaddTempExp with id %d contains CCDs with visit=%d. "
196  "CoaddInputs may be unreliable."
197  % (inputVisitRecord.getId(), inputCcdRecord.getL(self.ccdVisitKey)))
198  outputCcdRecord = coaddInputs.ccds.addNew()
199  outputCcdRecord.assign(inputCcdRecord)
200  if self.config.saveCcdWeights:
201  outputCcdRecord.setD(self.ccdWeightKey, weight)
202  return inputVisitRecord
def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.makeCoaddInputs (   self)
Create a CoaddInputs object with schemas defined by the task configuration

Definition at line 167 of file coaddInputRecorder.py.

168  def makeCoaddInputs(self):
169  """Create a CoaddInputs object with schemas defined by the task configuration"""
170  return afwImage.CoaddInputs(self.visitSchema, self.ccdSchema)
A simple Persistable struct containing ExposureCatalogs that record the inputs to a coadd...
Definition: CoaddInputs.h:46
def lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.makeCoaddTempExpRecorder (   self,
  visitId 
)
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 159 of file coaddInputRecorder.py.

160  def makeCoaddTempExpRecorder(self, visitId):
161  """Return a CoaddTempExpInputRecorder instance to help with saving a CoaddTempExp's inputs.
162 
163  The visitId may be any number that is unique for each CoaddTempExp that goes into a coadd,
164  but ideally should be something more meaningful that can be used to reconstruct a data ID.
165  """
166  return CoaddTempExpInputRecorder(self, visitId)

Member Data Documentation

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdCcdKey

Definition at line 150 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdGoodPixKey

Definition at line 153 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdSchema

Definition at line 149 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdVisitKey

Definition at line 151 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.ccdWeightKey

Definition at line 156 of file coaddInputRecorder.py.

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

Definition at line 139 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitGoodPixKey

Definition at line 145 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitSchema

Definition at line 143 of file coaddInputRecorder.py.

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask.visitWeightKey

Definition at line 147 of file coaddInputRecorder.py.


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