LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
Classes | Functions | Variables
lsst.meas.base.forcedPhotCoadd Namespace Reference

Classes

class  ForcedPhotCoaddRunner
 
class  ForcedPhotCoaddConnections
 
class  documentation
 

Functions

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

Variables

 removePatchOverlaps
 
 expBits = dataRef.get(self.config.coaddName + "CoaddId_bits")
 
 expId = int(dataRef.get(self.config.coaddName + "CoaddId"))
 

Function Documentation

◆ attachFootprints()

def lsst.meas.base.forcedPhotCoadd.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 388 of file forcedPhotCoadd.py.

388  def attachFootprints(self, sources, refCat, exposure, refWcs, dataRef):
389  r"""Attach Footprints to source records.
390 
391  For coadd forced photometry, we use the deblended "heavy"
392  `~lsst.afw.detection.Footprint`\ s from the single-band measurements
393  of the same band - because we've guaranteed that the peaks (and hence
394  child sources) will be consistent across all bands before we get to
395  measurement, this should yield reasonable deblending for most sources.
396  It's most likely limitation is that it will not provide good flux
397  upper limits for sources that were not detected in this band but were
398  blended with sources that were.
399  """
400  if self.config.footprintDatasetName is None:
401  return self.measurement.attachTransformedFootprints(sources, refCat, exposure, refWcs)
402 
403  self.log.info("Loading deblended footprints for sources from %s, %s" %
404  (self.config.footprintDatasetName, dataRef.dataId))
405  fpCat = dataRef.get("%sCoadd_%s" % (self.config.coaddName, self.config.footprintDatasetName),
406  immediate=True)
407  for refRecord, srcRecord in zip(refCat, sources):
408  fpRecord = fpCat.find(refRecord.getId())
409  if fpRecord is None:
410  raise LookupError("Cannot find Footprint for source %s; please check that %sCoadd_%s "
411  "IDs are compatible with reference source IDs" %
412  (srcRecord.getId(), self.config.coaddName,
413  self.config.footprintDatasetName))
414  srcRecord.setFootprint(fpRecord.getFootprint())
415 
def attachFootprints(self, sources, refCat, exposure, refWcs, dataRef)

◆ fetchReferences()

def lsst.meas.base.forcedPhotCoadd.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 363 of file forcedPhotCoadd.py.

363  def fetchReferences(self, dataRef, exposure):
364  """Return an iterable of reference sources which overlap the exposure.
365 
366  Parameters
367  ----------
368  dataRef : `lsst.daf.persistence.ButlerDataRef`
369  Butler data reference corresponding to the image to be measured;
370  should have tract, patch, and filter keys.
371 
372  exposure : `lsst.afw.image.Exposure`
373  Unused.
374 
375  Notes
376  -----
377  All work is delegated to the references subtask; see
378  `CoaddSrcReferencesTask` for information about the default behavior.
379  """
380  skyMap = dataRef.get(self.dataPrefix + "skyMap", immediate=True)
381  tractInfo = skyMap[dataRef.dataId["tract"]]
382  patch = tuple(int(v) for v in dataRef.dataId["patch"].split(","))
383  patchInfo = tractInfo.getPatchInfo(patch)
384  references = lsst.afw.table.SourceCatalog(self.references.schema)
385  references.extend(self.references.fetchInPatches(dataRef, patchList=[patchInfo]))
386  return references
387 
def fetchReferences(self, dataRef, exposure)

◆ getExposure()

def lsst.meas.base.forcedPhotCoadd.getExposure (   self,
  dataRef 
)
Read input exposure on which measurement will be performed.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference.

Definition at line 416 of file forcedPhotCoadd.py.

416  def getExposure(self, dataRef):
417  """Read input exposure on which measurement will be performed.
418 
419  Parameters
420  ----------
421  dataRef : `lsst.daf.persistence.ButlerDataRef`
422  Butler data reference.
423  """
424  if self.config.hasFakes:
425  name = "fakes_" + self.config.coaddName + "Coadd_calexp"
426  else:
427  name = self.config.coaddName + "Coadd_calexp"
428 
429  return dataRef.get(name) if dataRef.datasetExists(name) else None
430 

◆ getExposureId()

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

Definition at line 360 of file forcedPhotCoadd.py.

360  def getExposureId(self, dataRef):
361  return int(dataRef.get(self.config.coaddName + "CoaddId"))
362 

◆ getSchemaCatalogs()

def lsst.meas.base.forcedPhotCoadd.getSchemaCatalogs (   self)
The schema catalogs that will be used by this task.

Returns
-------
schemaCatalogs : `dict`
    Dictionary mapping dataset type to schema catalog.

Notes
-----
There is only one schema for each type of forced measurement. The
dataset type for this measurement is defined in the mapper.

Definition at line 444 of file forcedPhotCoadd.py.

444  def getSchemaCatalogs(self):
445  """The schema catalogs that will be used by this task.
446 
447  Returns
448  -------
449  schemaCatalogs : `dict`
450  Dictionary mapping dataset type to schema catalog.
451 
452  Notes
453  -----
454  There is only one schema for each type of forced measurement. The
455  dataset type for this measurement is defined in the mapper.
456  """
457  catalog = lsst.afw.table.SourceCatalog(self.measurement.schema)
458  catalog.getTable().setMetadata(self.measurement.algMetadata)
459  datasetType = self.dataPrefix + "forced_src"
460  return {datasetType: catalog}
461 

◆ writeOutput()

def lsst.meas.base.forcedPhotCoadd.writeOutput (   self,
  dataRef,
  sources 
)
Write forced source table

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference. The forced_src dataset (with
    self.dataPrefix prepended) is all that will be modified.
sources : `lsst.afw.table.SourceCatalog`
    Catalog of sources to save.

Definition at line 431 of file forcedPhotCoadd.py.

431  def writeOutput(self, dataRef, sources):
432  """Write forced source table
433 
434  Parameters
435  ----------
436  dataRef : `lsst.daf.persistence.ButlerDataRef`
437  Butler data reference. The forced_src dataset (with
438  self.dataPrefix prepended) is all that will be modified.
439  sources : `lsst.afw.table.SourceCatalog`
440  Catalog of sources to save.
441  """
442  dataRef.put(sources, self.dataPrefix + "forced_src", flags=lsst.afw.table.SOURCE_IO_NO_FOOTPRINTS)
443 
def writeOutput(self, dataRef, sources)

Variable Documentation

◆ expBits

lsst.meas.base.forcedPhotCoadd.expBits = dataRef.get(self.config.coaddName + "CoaddId_bits")

Definition at line 356 of file forcedPhotCoadd.py.

◆ expId

lsst.meas.base.forcedPhotCoadd.expId = int(dataRef.get(self.config.coaddName + "CoaddId"))

Definition at line 357 of file forcedPhotCoadd.py.

◆ removePatchOverlaps

lsst.meas.base.forcedPhotCoadd.removePatchOverlaps

Definition at line 152 of file forcedPhotCoadd.py.