LSSTApplications  19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+11,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+5,19.0.0-20-g5a5a17ab+9,19.0.0-21-g2644856+11,19.0.0-22-gc5dc5b1+6,19.0.0-23-gdc29a50+3,19.0.0-24-g923e380+11,19.0.0-25-g6c8df7140,19.0.0-28-g9b887e2,19.0.0-3-g2b32d65+5,19.0.0-3-g8227491+10,19.0.0-3-g9c54d0d+10,19.0.0-3-gca68e65+6,19.0.0-3-gcfc5f51+5,19.0.0-3-ge110943+9,19.0.0-3-ge74d124,19.0.0-3-gfe04aa6+11,19.0.0-4-g06f5963+5,19.0.0-4-g3d16501+11,19.0.0-4-g4a9c019+5,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8278b9b+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+11,19.0.0-4-ge404a01+10,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gfb03ce7+11,19.0.0-6-gbaebbfb+10,19.0.0-60-gafafd468+11,19.0.0-67-g3ab1e6e,19.0.0-7-g039c0b5+9,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+11,19.0.0-8-g3a3ce09+6,19.0.0-9-g463f923+10,w.2020.21
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask Class Reference
Inheritance diagram for lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask:

Public Member Functions

def getExposure (self, dataRef)
 
def makeIdFactory (self, dataRef)
 
def getExposureId (self, dataRef)
 
def fetchReferences (self, dataRef, exposure)
 
def attachFootprints (self, sources, refCat, exposure, refWcs, dataRef)
 

Static Public Attributes

 ConfigClass
 
 RunnerClass
 
 dataPrefix
 

Detailed Description

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

Notes
-----
In addition to the run method, `ForcedPhotCcdTask` overrides several
methods of `ForcedPhotImageTask` to specialize it for coadd processing,
including `~ForcedPhotImageTask.makeIdFactory` and
`~ForcedPhotImageTask.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 80 of file forcedPhotCoadd.py.

Member Function Documentation

◆ attachFootprints()

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.attachFootprints (   self,
  sources,
  refCat,
  exposure,
  refWcs,
  dataRef 
)
Attach Footprints to source records.

For coadd forced photometry, we use the deblended "heavy"
`~lsst.afw.detection.Footprint`\ s 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 158 of file forcedPhotCoadd.py.

158  def attachFootprints(self, sources, refCat, exposure, refWcs, dataRef):
159  r"""Attach Footprints to source records.
160 
161  For coadd forced photometry, we use the deblended "heavy"
162  `~lsst.afw.detection.Footprint`\ s from the single-band measurements
163  of the same band - because we've guaranteed that the peaks (and hence
164  child sources) will be consistent across all bands before we get to
165  measurement, this should yield reasonable deblending for most sources.
166  It's most likely limitation is that it will not provide good flux
167  upper limits for sources that were not detected in this band but were
168  blended with sources that were.
169  """
170  if self.config.footprintDatasetName is None:
171  return ForcedPhotImageTask.attachFootprints(self, sources, refCat, exposure, refWcs, dataRef)
172  self.log.info("Loading deblended footprints for sources from %s, %s" %
173  (self.config.footprintDatasetName, dataRef.dataId))
174  fpCat = dataRef.get("%sCoadd_%s" % (self.config.coaddName, self.config.footprintDatasetName),
175  immediate=True)
176  for refRecord, srcRecord in zip(refCat, sources):
177  fpRecord = fpCat.find(refRecord.getId())
178  if fpRecord is None:
179  raise LookupError("Cannot find Footprint for source %s; please check that %sCoadd_%s "
180  "IDs are compatible with reference source IDs" %
181  (srcRecord.getId(), self.config.coaddName,
182  self.config.footprintDatasetName))
183  srcRecord.setFootprint(fpRecord.getFootprint())
184 

◆ fetchReferences()

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.fetchReferences (   self,
  dataRef,
  exposure 
)
Return an iterable of reference sources which overlap the exposure.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference corresponding to the image to be measured;
    should have tract, patch, and filter keys.

exposure : `lsst.afw.image.Exposure`
    Unused.

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

Definition at line 133 of file forcedPhotCoadd.py.

133  def fetchReferences(self, dataRef, exposure):
134  """Return an iterable of reference sources which overlap the exposure.
135 
136  Parameters
137  ----------
138  dataRef : `lsst.daf.persistence.ButlerDataRef`
139  Butler data reference corresponding to the image to be measured;
140  should have tract, patch, and filter keys.
141 
142  exposure : `lsst.afw.image.Exposure`
143  Unused.
144 
145  Notes
146  -----
147  All work is delegated to the references subtask; see
148  `CoaddSrcReferencesTask` for information about the default behavior.
149  """
150  skyMap = dataRef.get(self.dataPrefix + "skyMap", immediate=True)
151  tractInfo = skyMap[dataRef.dataId["tract"]]
152  patch = tuple(int(v) for v in dataRef.dataId["patch"].split(","))
153  patchInfo = tractInfo.getPatchInfo(patch)
154  references = lsst.afw.table.SourceCatalog(self.references.schema)
155  references.extend(self.references.fetchInPatches(dataRef, patchList=[patchInfo]))
156  return references
157 

◆ getExposure()

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.getExposure (   self,
  dataRef 
)

Definition at line 98 of file forcedPhotCoadd.py.

98  def getExposure(self, dataRef):
99 
100  if self.config.hasFakes:
101  name = "fakes_" + self.config.coaddName + "Coadd_calexp"
102  else:
103  name = self.config.coaddName + "Coadd_calexp"
104 
105  return dataRef.get(name) if dataRef.datasetExists(name) else None
106 

◆ getExposureId()

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.getExposureId (   self,
  dataRef 
)

Definition at line 130 of file forcedPhotCoadd.py.

130  def getExposureId(self, dataRef):
131  return int(dataRef.get(self.config.coaddName + "CoaddId"))
132 

◆ makeIdFactory()

def lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.makeIdFactory (   self,
  dataRef 
)
Create an object that generates globally unique source IDs.

Source IDs are created based on a per-CCD ID and the ID of the CCD
itself.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference. The "CoaddId_bits" and "CoaddId" datasets
    are accessed. The data ID must have tract and patch keys.

Definition at line 107 of file forcedPhotCoadd.py.

107  def makeIdFactory(self, dataRef):
108  """Create an object that generates globally unique source IDs.
109 
110  Source IDs are created based on a per-CCD ID and the ID of the CCD
111  itself.
112 
113  Parameters
114  ----------
115  dataRef : `lsst.daf.persistence.ButlerDataRef`
116  Butler data reference. The "CoaddId_bits" and "CoaddId" datasets
117  are accessed. The data ID must have tract and patch keys.
118  """
119  # With the default configuration, this IdFactory doesn't do anything,
120  # because the IDs it generates are immediately overwritten by the ID
121  # from the reference catalog (since that's in
122  # config.measurement.copyColumns). But we create one here anyway, to
123  # allow us to revert back to the old behavior of generating new forced
124  # source IDs, just by renaming the ID in config.copyColumns to
125  # "object_id".
126  expBits = dataRef.get(self.config.coaddName + "CoaddId_bits")
127  expId = int(dataRef.get(self.config.coaddName + "CoaddId"))
128  return lsst.afw.table.IdFactory.makeSource(expId, 64 - expBits)
129 

Member Data Documentation

◆ ConfigClass

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

Definition at line 93 of file forcedPhotCoadd.py.

◆ dataPrefix

lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.dataPrefix
static

Definition at line 96 of file forcedPhotCoadd.py.

◆ RunnerClass

lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask.RunnerClass
static

Definition at line 94 of file forcedPhotCoadd.py.


The documentation for this class was generated from the following file:
lsst::afw::table::IdFactory::makeSource
static std::shared_ptr< IdFactory > makeSource(RecordId expId, int reserved)
Return an IdFactory that includes another, fixed ID in the higher-order bits.
Definition: IdFactory.cc:72
lsst::log.log.logContinued.info
def info(fmt, *args)
Definition: logContinued.py:198
lsst::afw::table._source.SourceCatalog
Definition: _source.py:33