lsst.meas.algorithms  21.0.0-10-gbfb87ad6+1472003707
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask Class Reference

Abstract base class to load objects from reference catalogs. More...

Inheritance diagram for lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask:
lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask

Public Member Functions

def __init__ (self, butler=None, *args, **kwargs)
 
def loadPixelBox (self, bbox, wcs, filterName=None, photoCalib=None, epoch=None)
 
def loadSkyCircle (self, ctrCoord, radius, filterName=None, epoch=None, centroids=False)
 
def getMetadataBox (self, bbox, wcs, filterName=None, photoCalib=None, epoch=None)
 
def getMetadataCircle (self, coord, radius, filterName, photoCalib=None, epoch=None)
 
def joinMatchListWithCatalog (self, matchCat, sourceCat)
 
def applyProperMotions (self, catalog, epoch)
 

Static Public Member Functions

def makeMinimalSchema (filterNameList, *addCentroid=False, addIsPhotometric=False, addIsResolved=False, addIsVariable=False, coordErrDim=2, addProperMotion=False, properMotionErrDim=2, addParallax=False)
 

Public Attributes

 butler
 

Static Public Attributes

 ConfigClass = LoadReferenceObjectsConfig
 

Detailed Description

Abstract base class to load objects from reference catalogs.

@anchor LoadReferenceObjectsTask_

@section meas_algorithms_loadReferenceObjects_Contents Contents

 - @ref meas_algorithms_loadReferenceObjects_Purpose
 - @ref meas_algorithms_loadReferenceObjects_Initialize
 - @ref meas_algorithms_loadReferenceObjects_IO
 - @ref meas_algorithms_loadReferenceObjects_Schema
 - @ref meas_algorithms_loadReferenceObjects_Config

@section meas_algorithms_loadReferenceObjects_Purpose  Description

Abstract base class for tasks that load objects from a reference catalog
in a particular region of the sky.

Implementations must subclass this class, override the loadSkyCircle method,
and will typically override the value of ConfigClass with a task-specific config class.

@section meas_algorithms_loadReferenceObjects_Initialize   Task initialisation

@copydoc \_\_init\_\_

@section meas_algorithms_loadReferenceObjects_IO       Invoking the Task

@copydoc loadPixelBox

@section meas_algorithms_loadReferenceObjects_Schema       Schema of the reference object catalog

Reference object catalogs are instances of lsst.afw.table.SimpleCatalog with the following schema
(other fields may also be present).
The units use astropy quantity conventions, so a 2 suffix means squared.
See also makeMinimalSchema.
- coord: ICRS position of star on sky (an lsst.geom.SpherePoint)
- centroid: position of star on an exposure, if relevant (an lsst.afw.Point2D)
- hasCentroid: is centroid usable? (a Flag)
- *referenceFilterName*_flux: brightness in the specified reference catalog filter (nJy)
    Note: you can use astropy.units to convert from AB Magnitude to nJy:
        `u.Magnitude(value, u.ABmag).to_value(u.nJy)`
- *referenceFilterName*_fluxErr (optional): brightness standard deviation (nJy);
    omitted if no data is available; possibly nan if data is available for some objects but not others
- camFlux: brightness in default camera filter (nJy); omitted if defaultFilter not specified
- camFluxErr: brightness standard deviation for default camera filter;
    omitted if defaultFilter not specified or standard deviation not available that filter
- *cameraFilterName*_camFlux: brightness in specified camera filter (nJy)
- *cameraFilterName*_camFluxErr (optional): brightness standard deviation
    in specified camera filter (nJy); omitted if no data is available;
    possibly nan if data is available for some objects but not others
- photometric (optional): is the object usable for photometric calibration? (a Flag)
- resolved (optional): is the object spatially resolved? (a Flag)
- variable (optional): does the object have variable brightness? (a Flag)
- coord_raErr: uncertainty in `coord` along the direction of right ascension (radian, an Angle)
                = uncertainty in ra * cos(dec); nan if unknown
- coord_decErr: uncertainty in `coord` along the direction of declination (radian, an Angle);
    nan if unknown

The following are optional; fields should only be present if the
information is available for at least some objects.
Numeric values are `nan` if unknown:
- epoch: date of observation as TAI MJD (day)

- pm_ra: proper motion along the direction of right ascension (rad/year, an Angle) = dra/dt * cos(dec)
- pm_dec: proper motion along the direction of declination (rad/year, and Angle)
- pm_raErr: uncertainty in `pm_ra` (rad/year)
- pm_decErr: uncertainty in `pm_dec` (rad/year)
- pm_ra_dec_Cov: covariance between pm_ra and pm_dec (rad2/year2)
- pm_flag: set if proper motion, error or covariance is bad

- parallax: parallax (rad, an Angle)
- parallaxErr: uncertainty in `parallax` (rad)
- parallax_flag: set if parallax value or parallaxErr is bad

- coord_ra_pm_ra_Cov: covariance between coord_ra and pm_ra (rad2/year)
- coord_ra_pm_dec_Cov: covariance between coord_ra and pm_dec (rad2/year)
- coord_ra_parallax_Cov: covariance between coord_ra and parallax (rad2/year)
- coord_dec_pm_ra_Cov: covariance between coord_dec and pm_ra (rad2/year)
- coord_dec_pm_dec_Cov: covariance between coord_dec and pm_dec (rad2/year)
- coord_dec_parallax_Cov: covariance between coord_dec and parallax (rad2/year)
- pm_ra_parallax_Cov: covariance between pm_ra and parallax (rad2/year)
- pm_dec_parallax_Cov: covariance between pm_dec and parallax (rad2/year)

@section meas_algorithms_loadReferenceObjects_Config       Configuration parameters

See @ref LoadReferenceObjectsConfig for a base set of configuration parameters.
Most subclasses will add configuration variables.

Definition at line 826 of file loadReferenceObjects.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.__init__ (   self,
  butler = None,
args,
**  kwargs 
)
Construct a LoadReferenceObjectsTask

Parameters
----------
butler : `lsst.daf.persistence.Butler`
    Data butler, for access reference catalogs.

Reimplemented in lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.

Definition at line 917 of file loadReferenceObjects.py.

Member Function Documentation

◆ applyProperMotions()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.applyProperMotions (   self,
  catalog,
  epoch 
)
Apply proper motion correction to a reference catalog.

Adjust position and position error in the ``catalog``
for proper motion to the specified ``epoch``,
modifying the catalog in place.

Parameters
----------
catalog : `lsst.afw.table.SimpleCatalog`
    Catalog of positions, containing:

    - Coordinates, retrieved by the table's coordinate key.
    - ``coord_raErr`` : Error in Right Ascension (rad).
    - ``coord_decErr`` : Error in Declination (rad).
    - ``pm_ra`` : Proper motion in Right Ascension (rad/yr,
        East positive)
    - ``pm_raErr`` : Error in ``pm_ra`` (rad/yr), optional.
    - ``pm_dec`` : Proper motion in Declination (rad/yr,
        North positive)
    - ``pm_decErr`` : Error in ``pm_dec`` (rad/yr), optional.
    - ``epoch`` : Mean epoch of object (an astropy.time.Time)
epoch : `astropy.time.Time`
    Epoch to which to correct proper motion,

Definition at line 1400 of file loadReferenceObjects.py.

◆ getMetadataBox()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.getMetadataBox (   self,
  bbox,
  wcs,
  filterName = None,
  photoCalib = None,
  epoch = None 
)
Return metadata about the load.

This metadata is used for reloading the catalog (e.g., for
reconstituting a normalised match list.

Parameters
----------
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    Pixel bounding box.
wcs : `lsst.afw.geom.SkyWcs`
    WCS; used to convert pixel positions to sky coordinates.
filterName : `str`
    Name of camera filter, or `None` or `""` for the default
    filter.
photoCalib : `lsst.afw.image.PhotoCalib` (optional)
    Calibration, or `None` if unknown.
epoch : `astropy.time.Time` (optional)
    Epoch to which to correct proper motion and parallax,
    or None to not apply such corrections.

Returns
-------
metadata : lsst.daf.base.PropertyList
    Metadata about the load.

Definition at line 1307 of file loadReferenceObjects.py.

◆ getMetadataCircle()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.getMetadataCircle (   self,
  coord,
  radius,
  filterName,
  photoCalib = None,
  epoch = None 
)
Return metadata about the load.

This metadata is used for reloading the catalog (e.g., for
reconstituting a normalised match list.

Parameters
----------
coord : `lsst.geom.SpherePoint`
    ICRS center of the search region.
radius : `lsst.geom.Angle`
    Radius of the search region.
filterName : `str`
    Name of camera filter, or `None` or `""` for the default
    filter.
photoCalib : `lsst.afw.image.PhotoCalib` (optional)
    Calibration, or `None` if unknown.
epoch : `astropy.time.Time` (optional)
    Epoch to which to correct proper motion and parallax,
    or None to not apply such corrections.

Returns
-------
metadata : lsst.daf.base.PropertyList
    Metadata about the load

Definition at line 1337 of file loadReferenceObjects.py.

◆ joinMatchListWithCatalog()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.joinMatchListWithCatalog (   self,
  matchCat,
  sourceCat 
)
Relink an unpersisted match list to sources and reference
objects.

A match list is persisted and unpersisted as a catalog of IDs
produced by afw.table.packMatches(), with match metadata
(as returned by the astrometry tasks) in the catalog's metadata
attribute. This method converts such a match catalog into a match
list, with links to source records and reference object records.

Parameters
----------
matchCat : `lsst.afw.table.BaseCatalog`
    Unperisted packed match list.
    ``matchCat.table.getMetadata()`` must contain match metadata,
    as returned by the astrometry tasks.
sourceCat : `lsst.afw.table.SourceCatalog`
    Source catalog. As a side effect, the catalog will be sorted
    by ID.

Returns
-------
matchList : `lsst.afw.table.ReferenceMatchVector`
    Match list.

Definition at line 1373 of file loadReferenceObjects.py.

◆ loadPixelBox()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.loadPixelBox (   self,
  bbox,
  wcs,
  filterName = None,
  photoCalib = None,
  epoch = None 
)
Load reference objects that overlap a rectangular pixel region.

Parameters
----------
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    Bounding box for pixels.
wcs : `lsst.afw.geom.SkyWcs`
    WCS; used to convert pixel positions to sky coordinates
    and vice-versa.
filterName : `str`
    Name of filter, or `None` or `""` for the default filter.
    This is used for flux values in case we have flux limits
    (which are not yet implemented).
photoCalib : `lsst.afw.image.PhotoCalib` (optional)
    Calibration, or `None` if unknown.
epoch : `astropy.time.Time` (optional)
    Epoch to which to correct proper motion and parallax,
    or None to not apply such corrections.

Returns
-------
results : `lsst.pipe.base.Struct`
    A Struct containing the following fields:
    refCat : `lsst.afw.catalog.SimpleCatalog`
        A catalog of reference objects with the standard
        schema, as documented in the main doc string for
        `LoadReferenceObjects`.
        The catalog is guaranteed to be contiguous.
    fluxField : `str`
        Name of flux field for specified `filterName`.

Notes
-----
The search algorithm works by searching in a region in sky
coordinates whose center is the center of the bbox and radius
is large enough to just include all 4 corners of the bbox.
Stars that lie outside the bbox are then trimmed from the list.

Definition at line 929 of file loadReferenceObjects.py.

◆ loadSkyCircle()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.loadSkyCircle (   self,
  ctrCoord,
  radius,
  filterName = None,
  epoch = None,
  centroids = False 
)
Load reference objects that overlap a circular sky region.

Parameters
----------
ctrCoord : `lsst.geom.SpherePoint`
    ICRS center of search region.
radius : `lsst.geom.Angle`
    Radius of search region.
filterName : `str` (optional)
    Name of filter, or `None` or `""` for the default filter.
    This is used for flux values in case we have flux limits
    (which are not yet implemented).
epoch : `astropy.time.Time` (optional)
    Epoch to which to correct proper motion and parallax,
    or None to not apply such corrections.
centroids : `bool` (optional)
    Add centroid fields to the loaded Schema. ``loadPixelBox`` expects
    these fields to exist.

Returns
-------
results : `lsst.pipe.base.Struct`
    A Struct containing the following fields:
    refCat : `lsst.afw.catalog.SimpleCatalog`
        A catalog of reference objects with the standard
        schema, as documented in the main doc string for
        `LoadReferenceObjects`.
        The catalog is guaranteed to be contiguous.
    fluxField : `str`
        Name of flux field for specified `filterName`.

Notes
-----
Note that subclasses are responsible for performing the proper motion
correction, since this is the lowest-level interface for retrieving
the catalog.

Reimplemented in lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.

Definition at line 991 of file loadReferenceObjects.py.

◆ makeMinimalSchema()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.makeMinimalSchema (   filterNameList,
addCentroid = False,
  addIsPhotometric = False,
  addIsResolved = False,
  addIsVariable = False,
  coordErrDim = 2,
  addProperMotion = False,
  properMotionErrDim = 2,
  addParallax = False 
)
static
Make a standard schema for reference object catalogs.

Parameters
----------
filterNameList : `list` of `str`
    List of filter names. Used to create <filterName>_flux fields.
addIsPhotometric : `bool`
    If True then add field "photometric".
addIsResolved : `bool`
    If True then add field "resolved".
addIsVariable : `bool`
    If True then add field "variable".
coordErrDim : `int`
    Number of coord error fields; must be one of 0, 2, 3:

    - If 2 or 3: add fields "coord_raErr" and "coord_decErr".
    - If 3: also add field "coord_radecErr".
addProperMotion : `bool`
    If True add fields "epoch", "pm_ra", "pm_dec" and "pm_flag".
properMotionErrDim : `int`
    Number of proper motion error fields; must be one of 0, 2, 3;
    ignored if addProperMotion false:
    - If 2 or 3: add fields "pm_raErr" and "pm_decErr".
    - If 3: also add field "pm_radecErr".
addParallax : `bool`
    If True add fields "epoch", "parallax", "parallaxErr"
    and "parallax_flag".

Returns
-------
schema : `lsst.afw.table.Schema`
    Schema for reference catalog, an
    `lsst.afw.table.SimpleCatalog`.

Notes
-----
Reference catalogs support additional covariances, such as
covariance between RA and proper motion in declination,
that are not supported by this method, but can be added after
calling this method.

Definition at line 1120 of file loadReferenceObjects.py.

Member Data Documentation

◆ butler

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.butler

Definition at line 926 of file loadReferenceObjects.py.

◆ ConfigClass

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.ConfigClass = LoadReferenceObjectsConfig
static

Definition at line 914 of file loadReferenceObjects.py.


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