lsst.meas.base  16.0-17-g7e0e4ff+2
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.references.BaseReferencesTask Class Reference

Base class for forced photometry subtask that retrieves reference sources. More...

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)
 Initialize the task. More...
 
def getSchema (self, butler)
 Return the schema for the reference sources. More...
 
def getWcs (self, dataRef)
 Return the WCS for reference sources. More...
 
def fetchInBox (self, dataRef, bbox, wcs)
 Return reference sources that overlap a region defined by a pixel-coordinate bounding box and corresponding Wcs. More...
 
def fetchInPatches (self, dataRef, patchList)
 Return reference sources that overlap a region defined by one or more SkyMap patches. More...
 
def subset (self, sources, bbox, wcs)
 Filter sources to contain only those within the given box, defined in the coordinate system defined by the given Wcs. More...
 

Static Public Attributes

 ConfigClass = BaseReferencesConfig
 

Detailed Description

Base class for forced photometry subtask that retrieves reference sources.

BaseReferencesTask defines the required API for the references task, which includes:

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

Definition at line 47 of file references.py.

Constructor & Destructor Documentation

◆ __init__()

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

Initialize the task.

BaseReferencesTask and its subclasses take two keyword arguments beyond the usual Task arguments:

  • schema: the Schema of the reference catalog
  • butler: a butler that will allow the task to load its Schema from disk. At least one of these arguments must be present; if both are, schema takes precedence.

Definition at line 63 of file references.py.

Member Function Documentation

◆ fetchInBox()

def lsst.meas.base.references.BaseReferencesTask.fetchInBox (   self,
  dataRef,
  bbox,
  wcs 
)

Return reference sources that overlap a region defined by a pixel-coordinate bounding box and corresponding Wcs.

Parameters
[in]dataRefButlerDataRef; the implied data ID must contain the 'tract' key.
[in]bboxa geom.Box2I or Box2D that defines the region in pixel coordinates
[in]wcsafw.image.Wcs that maps the bbox to sky coordinates
Returns
an iterable of reference sources

It is not required that the returned object be a SourceCatalog; it may be any Python iterable containing SourceRecords (including a lazy iterator).

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

Definition at line 87 of file references.py.

◆ fetchInPatches()

def lsst.meas.base.references.BaseReferencesTask.fetchInPatches (   self,
  dataRef,
  patchList 
)

Return reference sources that overlap a region defined by one or more SkyMap patches.

Parameters
[in]dataRefButlerDataRef; the implied data ID must contain the 'tract' key.
[in]patchListlist of skymap.PatchInfo instances for which to fetch reference sources
Returns
an iterable of reference sources

It is not required that the returned object be a SourceCatalog; it may be any Python sequence containing SourceRecords (including a lazy iterator).

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.

Definition at line 105 of file references.py.

◆ getSchema()

def lsst.meas.base.references.BaseReferencesTask.getSchema (   self,
  butler 
)

Return the schema for the reference sources.

Must be available even before any data has been processed.

Definition at line 73 of file references.py.

◆ getWcs()

def lsst.meas.base.references.BaseReferencesTask.getWcs (   self,
  dataRef 
)

Return the WCS for reference sources.

The given dataRef must include the tract in its dataId.

Definition at line 81 of file references.py.

◆ subset()

def lsst.meas.base.references.BaseReferencesTask.subset (   self,
  sources,
  bbox,
  wcs 
)

Filter sources to contain only those within the given box, defined in the coordinate system defined by the given Wcs.

Parameters
[in]sourcesinput iterable of SourceRecords
[in]bboxbounding box with which to filter reference sources (Box2I or Box2D)
[in]wcsafw.image.Wcs that defines the coordinate system of bbox

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 ReplaceWithNoise in measurement, which requires all child sources have their parent present.

Returns
an iterable of filtered reference sources

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 123 of file references.py.

Member Data Documentation

◆ ConfigClass

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

Definition at line 61 of file references.py.


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