lsst.meas.base  17.0.1-7-g35889ee+8
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask Class Reference
Inheritance diagram for lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask:
lsst.meas.base.forcedPhotImage.ForcedPhotImageTask

Public Member Functions

def adaptArgsAndRun (self, inputData, inputDataIds, outputDataIds, butler)
 
def filterReferences (self, exposure, refCat, refWcs)
 
def makeIdFactory (self, dataRef)
 
def getExposureId (self, dataRef)
 
def fetchReferences (self, dataRef, exposure)
 
def getExposure (self, dataRef)
 
def getInitOutputDatasets (self)
 
def generateMeasCat (self, exposureDataId, exposure, refCat, refWcs, idPackerName, butler)
 
def runDataRef (self, dataRef, psfCache=None)
 
def run (self, measCat, exposure, refCat, refWcs, exposureId=None)
 
def attachFootprints (self, sources, refCat, exposure, refWcs, dataRef)
 
def writeOutput (self, dataRef, sources)
 
def getSchemaCatalogs (self)
 

Static Public Attributes

 ConfigClass = ForcedPhotCcdConfig
 
 RunnerClass = lsst.pipe.base.ButlerInitializedTaskRunner
 
string dataPrefix = ""
 

Detailed Description

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

Notes
-----
This task is a subclass of
:lsst-task:`lsst.meas.base.forcedPhotImage.ForcedPhotImageTask` which is
specifically for doing forced measurement on a single CCD exposure, using
as a reference catalog the detections which were made on overlapping
coadds.

The `run` method (inherited from `ForcedPhotImageTask`) takes a
`~lsst.daf.persistence.ButlerDataRef` argument that corresponds to a single
CCD. This should contain the data ID keys that correspond to the
``forced_src`` dataset (the output dataset for this task), which are
typically all those used to specify the ``calexp`` dataset (``visit``,
``raft``, ``sensor`` for LSST data) as well as a coadd tract. The tract is
used to look up the appropriate coadd measurement catalogs to use as
references (e.g. ``deepCoadd_src``; see
:lsst-task:`lsst.meas.base.references.CoaddSrcReferencesTask` for more
information). While the tract must be given as part of the dataRef, the
patches are determined automatically from the bounding box and WCS of the
calexp to be measured, and the filter used to fetch references is set via
the ``filter`` option in the configuration of
:lsst-task:`lsst.meas.base.references.BaseReferencesTask`).

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

Definition at line 168 of file forcedPhotCcd.py.

Member Function Documentation

◆ adaptArgsAndRun()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.adaptArgsAndRun (   self,
  inputData,
  inputDataIds,
  outputDataIds,
  butler 
)

Definition at line 208 of file forcedPhotCcd.py.

◆ attachFootprints()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.attachFootprints (   self,
  sources,
  refCat,
  exposure,
  refWcs,
  dataRef 
)
inherited
Attach footprints to blank sources prior to measurements.

Notes
-----
`~lsst.afw.detection.Footprint`\ s 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 of this class must implement this method to define how
those `~lsst.afw.detection.Footprint`\ s should be generated.

This default implementation transforms the
`~lsst.afw.detection.Footprint`\ s from the reference catalog from the
reference WCS to the exposure's WcS, which downgrades
`lsst.afw.detection.heavyFootprint.HeavyFootprint`\ s into regular
`~lsst.afw.detection.Footprint`\ s, destroying deblend information.

Definition at line 327 of file forcedPhotImage.py.

◆ fetchReferences()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.fetchReferences (   self,
  dataRef,
  exposure 
)
Get sources that 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`
    The image to be measured (used only to obtain a WCS and bounding
    box).

Returns
-------
referencs : `lsst.afw.table.SourceCatalog`
    Catalog of sources that overlap the exposure

Notes
-----
The returned catalog is sorted by ID and guarantees that all included
children have their parent included and that all Footprints are valid.

All work is delegated to the references subtask; see
:lsst-task:`lsst.meas.base.references.CoaddSrcReferencesTask`
for information about the default behavior.

Definition at line 311 of file forcedPhotCcd.py.

◆ filterReferences()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.filterReferences (   self,
  exposure,
  refCat,
  refWcs 
)
Filter reference catalog so that all sources are within the
boundaries of the exposure.

Parameters
----------
exposure : `lsst.afw.image.exposure.Exposure`
    Exposure to generate the catalog for.
refCat : `lsst.afw.table.SourceCatalog`
    Catalog of shapes and positions at which to force photometry.
refWcs : `lsst.afw.image.SkyWcs`
    Reference world coordinate system.

Returns
-------
refSources : `lsst.afw.table.SourceCatalog`
    Filtered catalog of forced sources to measure.

Notes
-----
Filtering the reference catalog is currently handled by Gen2
specific methods.  To function for Gen3, this method copies
code segments to do the filtering and transformation.  The
majority of this code is based on the methods of
lsst.meas.algorithms.loadReferenceObjects.ReferenceObjectLoader

Definition at line 219 of file forcedPhotCcd.py.

◆ generateMeasCat()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.generateMeasCat (   self,
  exposureDataId,
  exposure,
  refCat,
  refWcs,
  idPackerName,
  butler 
)
inherited
Generate a measurement catalog for Gen3.

Parameters
----------
exposureDataId : `DataId`
    Butler dataId for this exposure.
exposure : `lsst.afw.image.exposure.Exposure`
    Exposure to generate the catalog for.
refCat : `lsst.afw.table.SourceCatalog`
    Catalog of shapes and positions at which to force photometry.
refWcs : `lsst.afw.image.SkyWcs`
    Reference world coordinate system.
idPackerName : `str`
    Type of ID packer to construct from the registry.
butler : `lsst.daf.persistence.butler.Butler`
    Butler to use to construct id packer.

Returns
-------
measCat : `lsst.afw.table.SourceCatalog`
    Catalog of forced sources to measure.

Definition at line 189 of file forcedPhotImage.py.

◆ getExposure()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.getExposure (   self,
  dataRef 
)
Read input exposure for measurement.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference. Only the ``calexp`` dataset is used, unless
    ``config.doApplyUberCal`` is `True`, in which case the
    corresponding meas_mosaic outputs are used as well.

Definition at line 354 of file forcedPhotCcd.py.

◆ getExposureId()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.getExposureId (   self,
  dataRef 
)

Definition at line 308 of file forcedPhotCcd.py.

◆ getInitOutputDatasets()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.getInitOutputDatasets (   self)
inherited

Definition at line 177 of file forcedPhotImage.py.

◆ getSchemaCatalogs()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.getSchemaCatalogs (   self)
inherited
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 370 of file forcedPhotImage.py.

◆ makeIdFactory()

def lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.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 ``ccdExposureId_bits`` and
    ``ccdExposureId`` datasets are accessed. The data ID must have the
    keys that correspond to ``ccdExposureId``, which are generally the
    same as those that correspond to ``calexp`` (``visit``, ``raft``,
    ``sensor`` for LSST data).

Definition at line 289 of file forcedPhotCcd.py.

◆ run()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.run (   self,
  measCat,
  exposure,
  refCat,
  refWcs,
  exposureId = None 
)
inherited
Perform forced measurement on a single exposure.

Parameters
----------
measCat : `lsst.afw.table.SourceCatalog`
    The measurement catalog, based on the sources listed in the
    reference catalog.
exposure : `lsst.afw.image.Exposure`
    The measurement image upon which to perform forced detection.
refCat : `lsst.afw.table.SourceCatalog`
    The reference catalog of sources to measure.
refWcs : `lsst.afw.image.SkyWcs`
    The WCS for the references.
exposureId : `int`
    Optional unique exposureId used for random seed in measurement
    task.

Returns
-------
result : `lsst.pipe.base.Struct`
    Structure with fields:

    ``measCat``
Catalog of forced measurement results
(`lsst.afw.table.SourceCatalog`).

Definition at line 263 of file forcedPhotImage.py.

◆ runDataRef()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.runDataRef (   self,
  dataRef,
  psfCache = None 
)
inherited
Perform forced measurement on a single exposure.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Passed to the ``references`` subtask to obtain the reference WCS,
    the ``getExposure`` method (implemented by derived classes) to
    read the measurment image, and the ``fetchReferences`` method to
    get the exposure and load the reference catalog (see
    :lsst-task`lsst.meas.base.references.CoaddSrcReferencesTask`).
    Refer to derived class documentation for details of the datasets
    and data ID keys which are used.
psfCache : `int`, optional
    Size of PSF cache, or `None`. The size of the PSF cache can have
    a significant effect upon the runtime for complicated PSF models.

Notes
-----
Sources are generated with ``generateMeasCat`` in the ``measurement``
subtask. These are passed to ``measurement``'s ``run`` method, which
fills the source catalog with the forced measurement results. The
sources are then passed to the ``writeOutputs`` method (implemented by
derived classes) which writes the outputs.

Definition at line 221 of file forcedPhotImage.py.

◆ writeOutput()

def lsst.meas.base.forcedPhotImage.ForcedPhotImageTask.writeOutput (   self,
  dataRef,
  sources 
)
inherited
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 357 of file forcedPhotImage.py.

Member Data Documentation

◆ ConfigClass

lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.ConfigClass = ForcedPhotCcdConfig
static

Definition at line 203 of file forcedPhotCcd.py.

◆ dataPrefix

string lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.dataPrefix = ""
static

Definition at line 206 of file forcedPhotCcd.py.

◆ RunnerClass

lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.RunnerClass = lsst.pipe.base.ButlerInitializedTaskRunner
static

Definition at line 204 of file forcedPhotCcd.py.


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