LSST Applications  21.0.0+3c14b91618,21.0.0+9f51b1e3f7,21.0.0-1-ga51b5d4+6691386486,21.0.0-10-g2408eff+49d24385eb,21.0.0-10-g560fb7b+6deed7dcb5,21.0.0-10-gcf60f90+8a335ee4d8,21.0.0-15-g490e301a+3275d29b7b,21.0.0-2-g103fe59+8d3bd148b2,21.0.0-2-g1367e85+7f080822af,21.0.0-2-g45278ab+9f51b1e3f7,21.0.0-2-g5242d73+7f080822af,21.0.0-2-g7f82c8f+0446281eca,21.0.0-2-g8f08a60+e6fd6d9ff9,21.0.0-2-ga326454+0446281eca,21.0.0-2-gde069b7+66c51b65da,21.0.0-2-gecfae73+2991dc08df,21.0.0-2-gfc62afb+7f080822af,21.0.0-20-g09baf175d+b753e4a737,21.0.0-3-g357aad2+29041d4ddb,21.0.0-3-g4be5c26+7f080822af,21.0.0-3-g65f322c+910dc3add9,21.0.0-3-g7d9da8d+3c14b91618,21.0.0-3-gaa929c8+6deed7dcb5,21.0.0-3-ge02ed75+f91014d647,21.0.0-4-g3af6bfd+4bd7f27a2e,21.0.0-4-g591bb35+f91014d647,21.0.0-4-g88306b8+fb98652b4f,21.0.0-4-gccdca77+86bf7a300d,21.0.0-4-ge8a399c+950ca2ef13,21.0.0-45-g0dcdce56+90354a0300,21.0.0-5-g073e055+57e5e98977,21.0.0-6-g2d4f3f3+9f51b1e3f7,21.0.0-6-g4e60332+f91014d647,21.0.0-6-g8356267+ce55d80eb2,21.0.0-7-g6531d7b+c3c1e9b0a0,21.0.0-7-g98eecf7+3609eddee2,21.0.0-8-ga5967ee+5685175956,master-gac4afde19b+f91014d647,w.2021.09
LSST Data Management Base Package
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 = ForcedPhotCoaddConfig
 
 RunnerClass = lsst.pipe.base.ButlerInitializedTaskRunner
 
string dataPrefix = "deepCoadd_"
 

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 
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

Member Data Documentation

◆ ConfigClass

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

Definition at line 93 of file forcedPhotCoadd.py.

◆ dataPrefix

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

Definition at line 96 of file forcedPhotCoadd.py.

◆ RunnerClass

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

Definition at line 94 of file forcedPhotCoadd.py.


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