lsst.meas.base  21.0.0-4-gc004bbf+80a0b7acb7
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.references.BaseReferencesTask Class Reference
Inheritance diagram for lsst.meas.base.references.BaseReferencesTask:
lsst.meas.base.references.CoaddSrcReferencesTask lsst.meas.base.references.MultiBandReferencesTask

Public Member Functions

def __init__ (self, butler=None, schema=None, **kwargs)
 
def getSchema (self, butler)
 
def getWcs (self, dataRef)
 
def fetchInBox (self, dataRef, bbox, wcs)
 
def fetchInPatches (self, dataRef, patchList)
 
def subset (self, sources, bbox, wcs)
 

Static Public Attributes

 ConfigClass = BaseReferencesConfig
 

Detailed Description

Base class for forced photometry subtask that fetches reference sources.

Parameters
----------
schema : `lsst.afw.table.Schema`, optional
    The schema of the reference catalog.
butler : `lsst.daf.persistence.butler.Butler`, optional
    A butler that will allow the task to load its schema from disk.

Notes
-----
At least one of the ``schema`` and ``butler`` arguments must be present;
if both are, ``schema`` takes precedence.

``BaseReferencesTask`` defines the required API for the references task,
which consists of:

- ``getSchema(butler)``
- ``fetchInPatches(butler, tract, filter, patchList)``
- ``fetchInBox(self, butler, tract, filter, bbox, wcs)``
- the ``removePatchOverlaps`` config option

It also provides the ``subset`` method, which may be of use to derived
classes when reimplementing ``fetchInBox``.

Definition at line 49 of file references.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.base.references.BaseReferencesTask.__init__ (   self,
  butler = None,
  schema = None,
**  kwargs 
)

Reimplemented in lsst.meas.base.references.CoaddSrcReferencesTask.

Definition at line 80 of file references.py.

Member Function Documentation

◆ fetchInBox()

def lsst.meas.base.references.BaseReferencesTask.fetchInBox (   self,
  dataRef,
  bbox,
  wcs 
)
Return reference sources within a given bounding box.

Reference sources are selected if they overlap a region defined by a
pixel-coordinate bounding box and corresponding WCS.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference. The implied data ID must contain the
    ``tract`` key.
bbox : `lsst.afw.geom.Box2I` or `lsst.afw.geom.Box2D`
    Defines the selection region in pixel coordinates.
wcs : `lsst.afw.image.SkyWcs`
    Maps ``bbox`` to sky coordinates.

Returns
-------
sources : iterable of `~lsst.afw.table.SourceRecord`
    Reference sources. May be any Python iterable, including a lazy
    iterator.

Notes
-----
The returned set of sources should be complete and close to minimal.

Definition at line 108 of file references.py.

◆ fetchInPatches()

def lsst.meas.base.references.BaseReferencesTask.fetchInPatches (   self,
  dataRef,
  patchList 
)
Return reference sources within one or more patches.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference. The implied data ID must contain the
    ``tract`` key.
patchList : `list` of `lsst.skymap.PatchInfo`
    Patches for which to fetch reference sources.

Returns
-------
sources : iterable of `~lsst.afw.table.SourceRecord`
    Reference sources. May be any Python iterable, including a lazy
    iterator.

Notes
-----
The returned set of sources should be complete and close to minimal.

If ``config.removePatchOverlaps`` is `True`, only sources within each
patch's "inner" bounding box should be returned.

Reimplemented in lsst.meas.base.references.CoaddSrcReferencesTask.

Definition at line 136 of file references.py.

◆ getSchema()

def lsst.meas.base.references.BaseReferencesTask.getSchema (   self,
  butler 
)
Return the schema for the reference sources.

Parameters
----------
butler : `lsst.daf.persistence.butler.Butler`
    Data butler from which the schema will be fetched.

Notes
-----
Must be available even before any data has been processed.

Definition at line 83 of file references.py.

◆ getWcs()

def lsst.meas.base.references.BaseReferencesTask.getWcs (   self,
  dataRef 
)
Return the WCS for reference sources.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    The data reference from which the WCS will be fetched. This must
    include the tract in its dataId.

Reimplemented in lsst.meas.base.references.CoaddSrcReferencesTask.

Definition at line 97 of file references.py.

◆ subset()

def lsst.meas.base.references.BaseReferencesTask.subset (   self,
  sources,
  bbox,
  wcs 
)
Filter a list of sources to only those within the bounding box.

Parameters
----------
sources : iterable of `~lsst.afw.table.SourceRecord`
    Reference sources. May be any Python iterable, including a lazy
    iterator.
bbox : `lsst.afw.geom.Box2I` or `lsst.afw.geom.Box2D`
    Defines the selection region.
wcs : `lsst.afw.image.SkyWcs`
    Maps ``bbox`` to sky coordinates.

Returns
-------
sources : iterable of `~lsst.afw.table.SourceRecord`
    Filtered sources. May be any Python iterable, including a lazy
    iterator.

Notes
-----
Instead of filtering sources directly via their positions, we filter
based on the positions of parent objects, then include or discard all
children based on their parent's status. This is necessary to support
replacement with noise in measurement, which requires all child
sources have their parent present.

This is not a part of the required `BaseReferencesTask` interface;
it's a convenience function used in implementing `fetchInBox` that may
be of use to subclasses.

Definition at line 162 of file references.py.

Member Data Documentation

◆ ConfigClass

lsst.meas.base.references.BaseReferencesTask.ConfigClass = BaseReferencesConfig
static

Definition at line 76 of file references.py.


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