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 | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask Class Reference

A command-line driver for performing forced measurement on coadd images. More...

Inheritance diagram for lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask:

Public Member Functions

def getExposure
 
def makeIdFactory
 
def fetchReferences
 
def attachFootprints
 

Static Public Attributes

 ConfigClass = ForcedPhotCoaddConfig
 
 RunnerClass = lsst.pipe.base.ButlerInitializedTaskRunner
 
string dataPrefix = "deepCoadd_"
 

Private Member Functions

def _makeArgumentParser
 

Static Private Attributes

string _DefaultName = "forcedPhotCoadd"
 

Detailed Description

A command-line driver for performing forced measurement on coadd images.

This task is a subclass of ForcedPhotImageTask which is specifically for doing forced measurement on a coadd, using as a reference catalog detections which were made on overlapping coadds (i.e. in other bands).

The run method (inherited from ForcedPhotImageTask) takes a lsst.daf.persistence.ButlerDataRef argument that corresponds to a coadd image. This is used to provide all the inputs and outputs for the task:

In addition to the run method, ForcedPhotCcdTask overrides several methods of ForcedPhotImageTask to specialize it for coadd processing, including makeIdFactory() and fetchReferences(). None of these should be called directly by the user, though it may be useful to override them further in subclasses.

Definition at line 60 of file forcedPhotCoadd.py.

Member Function Documentation

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask._makeArgumentParser (   cls)
private

Definition at line 151 of file forcedPhotCoadd.py.

152  def _makeArgumentParser(cls):
153  parser = lsst.pipe.base.ArgumentParser(name=cls._DefaultName)
154  parser.add_id_argument("--id", "deepCoadd_forced_src", help="data ID, with raw CCD keys + tract",
155  ContainerClass=lsst.coadd.utils.CoaddDataIdContainer)
156  return parser
157 
158 
def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.attachFootprints (   self,
  sources,
  refCat,
  exposure,
  refWcs,
  dataRef 
)
For coadd forced photometry, we use the deblended HeavyFootprints from the single-band
measurements of the same band - because we've guaranteed that the peaks (and hence child sources)
will be consistent across all bands before we get to measurement, this should yield reasonable
deblending for most sources.  It's most likely limitation is that it will not provide good flux
upper limits for sources that were not detected in this band but were blended with sources that
were.

Definition at line 127 of file forcedPhotCoadd.py.

128  def attachFootprints(self, sources, refCat, exposure, refWcs, dataRef):
129  """For coadd forced photometry, we use the deblended HeavyFootprints from the single-band
130  measurements of the same band - because we've guaranteed that the peaks (and hence child sources)
131  will be consistent across all bands before we get to measurement, this should yield reasonable
132  deblending for most sources. It's most likely limitation is that it will not provide good flux
133  upper limits for sources that were not detected in this band but were blended with sources that
134  were.
135  """
136  if self.config.footprintDatasetName is None:
137  return ForcedPhotImageTask.attachFootprints(sources, refCat, exposure, refWcs, dataRef)
138  self.log.info("Loading deblended footprints for sources from %s, %s" %
139  (self.config.footprintDatasetName, dataRef.dataId))
140  fpCat = dataRef.get("%sCoadd_%s" % (self.config.coaddName, self.config.footprintDatasetName),
141  immediate=True)
142  for refRecord, srcRecord in zip(refCat, sources):
143  fpRecord = fpCat.find(refRecord.getId())
144  if fpRecord is None:
145  raise LookupError("Cannot find Footprint for source %s; please check that %sCoadd_%s"
146  "IDs are compatible with reference source IDs" %
147  (srcRecord.getId(), self.config.coaddName,
148  self.config.footprintDatasetName))
149  srcRecord.setFootprint(fpRecord.getFootprint())
def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.fetchReferences (   self,
  dataRef,
  exposure 
)
Return an iterable of reference sources which overlap the exposure

@param dataRef       Data reference from butler corresponding to the image to be measured;
             should have tract, patch, and filter keys.
@param exposure      lsst.afw.image.Exposure to be measured (not used by this implementation)

All work is delegated to the references subtask; see CoaddSrcReferencesTask for information
about the default behavior.

Definition at line 109 of file forcedPhotCoadd.py.

110  def fetchReferences(self, dataRef, exposure):
111  """Return an iterable of reference sources which overlap the exposure
112 
113  @param dataRef Data reference from butler corresponding to the image to be measured;
114  should have tract, patch, and filter keys.
115  @param exposure lsst.afw.image.Exposure to be measured (not used by this implementation)
116 
117  All work is delegated to the references subtask; see CoaddSrcReferencesTask for information
118  about the default behavior.
119  """
120  skyMap = dataRef.get(self.dataPrefix + "skyMap", immediate=True)
121  tractInfo = skyMap[dataRef.dataId["tract"]]
122  patch = tuple(int(v) for v in dataRef.dataId["patch"].split(","))
123  patchInfo = tractInfo.getPatchInfo(patch)
124  references = lsst.afw.table.SourceCatalog(self.references.schema)
125  references.extend(self.references.fetchInPatches(dataRef, patchList=[patchInfo]))
126  return references
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
Definition: fwd.h:55
def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.getExposure (   self,
  dataRef 
)

Definition at line 90 of file forcedPhotCoadd.py.

90 
91  def getExposure(self, dataRef):
92  name = self.config.coaddName + "Coadd_calexp_det"
93  return dataRef.get(name) if dataRef.datasetExists(name) else None
def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.makeIdFactory (   self,
  dataRef 
)
Create an object that generates globally unique source IDs from per-CCD IDs and the CCD ID.

@param dataRef       Data reference from butler.  The "CoaddId_bits" and "CoaddId"
             datasets are accessed.  The data ID must have tract and patch keys.

Definition at line 94 of file forcedPhotCoadd.py.

94 
95  def makeIdFactory(self, dataRef):
96  """Create an object that generates globally unique source IDs from per-CCD IDs and the CCD ID.
97 
98  @param dataRef Data reference from butler. The "CoaddId_bits" and "CoaddId"
99  datasets are accessed. The data ID must have tract and patch keys.
100  """
101  # With the default configuration, this IdFactory doesn't do anything, because
102  # the IDs it generates are immediately overwritten by the ID from the reference
103  # catalog (since that's in config.copyColumns). But we create one here anyway, to
104  # allow us to revert back to the old behavior of generating new forced source IDs,
105  # just by renaming the ID in config.copyColumns to "object_id".
106  expBits = dataRef.get(self.config.coaddName + "CoaddId_bits")
107  expId = long(dataRef.get(self.config.coaddName + "CoaddId"))
108  return lsst.afw.table.IdFactory.makeSource(expId, 64 - expBits)
static boost::shared_ptr< IdFactory > makeSource(RecordId expId, int reserved)
Return an IdFactory that includes another, fixed ID in the higher-order bits.

Member Data Documentation

string lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask._DefaultName = "forcedPhotCoadd"
staticprivate

Definition at line 87 of file forcedPhotCoadd.py.

lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.ConfigClass = ForcedPhotCoaddConfig
static

Definition at line 85 of file forcedPhotCoadd.py.

string lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.dataPrefix = "deepCoadd_"
static

Definition at line 88 of file forcedPhotCoadd.py.

lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.RunnerClass = lsst.pipe.base.ButlerInitializedTaskRunner
static

Definition at line 86 of file forcedPhotCoadd.py.


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