lsst.meas.base  16.0-14-ga5060d2+3
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.forcedPhotImage.ForcedPhotImageTask Class Reference

A base class for command-line forced measurement drivers. More...

Inheritance diagram for lsst.meas.base.forcedPhotImage.ForcedPhotImageTask:
lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask lsst.meas.base.forcedPhotCoadd.ForcedPhotCoaddTask

Public Member Functions

def __init__ (self, butler=None, refSchema=None, kwds)
 
def runDataRef (self, dataRef, psfCache=None)
 Measure a single exposure for forced detection for a reference catalog using a dataRef. More...
 
def run (self, measCat, exposure, refCat, refWcs, exposureId=None)
 Measure a single exposure with forced detection for a reference catalog. More...
 
def makeIdFactory (self, dataRef)
 Hook for derived classes to define how to make an IdFactory for forced sources. More...
 
def getExposureId (self, dataRef)
 
def fetchReferences (self, dataRef, exposure)
 Hook for derived classes to define how to get references objects. More...
 
def attachFootprints (self, sources, refCat, exposure, refWcs, dataRef)
 Hook for derived classes to define how to attach Footprints to blank sources prior to measurement. More...
 
def getExposure (self, dataRef)
 Read input exposure on which to perform the measurements. More...
 
def writeOutput (self, dataRef, sources)
 Write forced source table. More...
 
def getSchemaCatalogs (self)
 Get a dict of Schema catalogs that will be used by this Task. More...
 

Static Public Attributes

 ConfigClass = ForcedPhotImageConfig
 

Detailed Description

A base class for command-line forced measurement drivers.

This is a an abstract class, which is the common ancestor for ForcedPhotCcdTask and ForcedPhotCoaddTask. It provides the runDataRef() method that does most of the work, while delegating a few customization tasks to other methods that are overridden by subclasses.

This task is not directly usable as a CmdLineTask; subclasses must:

Definition at line 85 of file forcedPhotImage.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.__init__ (   self,
  butler = None,
  refSchema = None,
  kwds 
)
Initialize the task.

ForcedPhotImageTask takes two keyword arguments beyond the usual CmdLineTask arguments:
 - refSchema: the Schema of the reference catalog, passed to the constructor of the references
   subtask
 - butler: a butler that will be passed to the references subtask to allow it to load its Schema
   from disk
At least one of these arguments must be present; if both are, schema takes precedence.

Definition at line 102 of file forcedPhotImage.py.

Member Function Documentation

◆ attachFootprints()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.attachFootprints (   self,
  sources,
  refCat,
  exposure,
  refWcs,
  dataRef 
)

Hook for derived classes to define how to attach Footprints to blank sources prior to measurement.

Footprints for forced photometry must be in the pixel coordinate system of the image being measured, while the actual detections may start out in a different coordinate system.

Subclasses for ForcedPhotImageTask must implement this method to define how those Footprints should be generated.

The default implementation (defined in forcedMeasurement.py) transforms the Footprints from the reference catalog from the refWcs to the exposure's Wcs, which downgrades HeavyFootprints into regular Footprints, destroying deblend information.

Definition at line 199 of file forcedPhotImage.py.

◆ fetchReferences()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.fetchReferences (   self,
  dataRef,
  exposure 
)

Hook for derived classes to define how to get references objects.

Derived classes should call one of the fetch* methods on the references subtask, but which one they call depends on whether the region to get references for is a easy to describe in patches (as it would be when doing forced measurements on a coadd), or is just an arbitrary box (as it would be for CCD forced measurements).

Definition at line 189 of file forcedPhotImage.py.

◆ getExposure()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.getExposure (   self,
  dataRef 
)

Read input exposure on which to perform the measurements.

Parameters
dataRefData reference from butler.

Definition at line 214 of file forcedPhotImage.py.

◆ getExposureId()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.getExposureId (   self,
  dataRef 
)

Definition at line 186 of file forcedPhotImage.py.

◆ getSchemaCatalogs()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.getSchemaCatalogs (   self)

Get a dict of Schema catalogs that will be used by this Task.

In the case of forced taks, 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 230 of file forcedPhotImage.py.

◆ makeIdFactory()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.makeIdFactory (   self,
  dataRef 
)

Hook for derived classes to define how to make an IdFactory for forced sources.

Note that this is for forced source IDs, not object IDs, which are usually handled by the measurement.copyColumns config option.

Definition at line 178 of file forcedPhotImage.py.

◆ run()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.run (   self,
  measCat,
  exposure,
  refCat,
  refWcs,
  exposureId = None 
)

Measure a single exposure with forced detection for a reference catalog.

Parameters
[in]measCatThe measurement catalog generated by measurement.generateMeasCat(), based on the sources listed in the reference catalog.
[in]exposureThe measurement image upon which to perform forced detection.
[in]refCatThe reference catalog of sources to measure.
[in]refWcsThe WCS for the references.
[in]exposureIdOptional unique exposureId used for random seed in measurement task.
Returns
result An lsst.pipe.base.Struct containing fields: measCat Source catalog of forced measurement results from measurement.run().

Definition at line 155 of file forcedPhotImage.py.

◆ runDataRef()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.runDataRef (   self,
  dataRef,
  psfCache = None 
)

Measure a single exposure for forced detection for a reference catalog using a dataRef.

Parameters
[in]dataRefAn lsst.daf.persistence.ButlerDataRef. It is passed to the references subtask to obtain the reference WCS, the getExposure() method (implemented by derived classes) to read the measurement image, and the fetchReferences() method (implemented by derived classes) to get the exposure and load the reference catalog (see the CoaddSrcReferencesTask for more information). The sources are then passed to the writeOutputs() method (implemented by derived classes) which writes the outputs. See derived class documentation for which datasets and data ID keys are used.
[in]psfCacheSize of PSF cache, or None. The size of the PSF cache can have a significant effect upon the runtime for complicated PSF models.

Definition at line 123 of file forcedPhotImage.py.

◆ writeOutput()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.writeOutput (   self,
  dataRef,
  sources 
)

Write forced source table.

Parameters
dataRefData reference from butler; the forced_src dataset (with self.dataPrefix included) is all that will be modified.
sourcesSourceCatalog to save

Definition at line 221 of file forcedPhotImage.py.

Member Data Documentation

◆ ConfigClass

lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.ConfigClass = ForcedPhotImageConfig
static

Definition at line 99 of file forcedPhotImage.py.


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