LSSTApplications  19.0.0-14-gb0260a2+6327455aeb,20.0.0+44dbdb3492,20.0.0+8a208d85ec,20.0.0+914fcaec49,20.0.0+a571b09ef0,20.0.0+f15d39cacd,20.0.0-1-g253301a+8a208d85ec,20.0.0-1-g5b95a8c+351e15424a,20.0.0-16-g760a3dc6+7dead9ab29,20.0.0-18-gcabc0c9fd+54cb7ade16,20.0.0-2-g4dae9ad+8a636d8bd2,20.0.0-2-g61b8584+b4ab3064f8,20.0.0-2-ga51b5d4+1f4ba438e8,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+3033df31e9,20.0.0-2-gf072044+8a208d85ec,20.0.0-2-gf1f7952+8a636d8bd2,20.0.0-22-g54e2caa+8bd7be2b67,20.0.0-25-g5eafb0f+8a636d8bd2,20.0.0-28-g73474ed+df2822652a,20.0.0-29-g1235a2f+94e05d8818,20.0.0-3-g8f21e14+2bd63a3b42,20.0.0-3-gbd60e8c+ffb20d0b0d,20.0.0-3-gbecbe05+7f0063ada4,20.0.0-4-g4bc9b9f+5be46ab906,20.0.0-4-g97dc21a+df2822652a,20.0.0-4-gb4befbc+928dca1c48,20.0.0-4-gf910f65+b4ab3064f8,20.0.0-42-g74ec3ae9+afa8208526,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g4aa86cc+9b37c72498,20.0.0-6-g9a5b7a1+9aa0dcac42,20.0.0-6-gd222c45+7040a8a6f6,20.0.0-73-gf477d90+d0de1c7e9f,20.0.0-9-g4aef684+2aec92f563,20.0.0-9-g5051ac2+d529cf1a41,w.2020.47
LSSTDataManagementBasePackage
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.

Contents

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.

Task initialisation

Construct a LoadReferenceObjectsTask

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

Invoking the Task

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.

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.

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:

Configuration parameters

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

Definition at line 828 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 919 of file loadReferenceObjects.py.

919  def __init__(self, butler=None, *args, **kwargs):
920  """Construct a LoadReferenceObjectsTask
921 
922  Parameters
923  ----------
924  butler : `lsst.daf.persistence.Butler`
925  Data butler, for access reference catalogs.
926  """
927  pipeBase.Task.__init__(self, *args, **kwargs)
928  self.butler = butler
929 

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.

1400  def applyProperMotions(self, catalog, epoch):
1401  """Apply proper motion correction to a reference catalog.
1402 
1403  Adjust position and position error in the ``catalog``
1404  for proper motion to the specified ``epoch``,
1405  modifying the catalog in place.
1406 
1407  Parameters
1408  ----------
1409  catalog : `lsst.afw.table.SimpleCatalog`
1410  Catalog of positions, containing:
1411 
1412  - Coordinates, retrieved by the table's coordinate key.
1413  - ``coord_raErr`` : Error in Right Ascension (rad).
1414  - ``coord_decErr`` : Error in Declination (rad).
1415  - ``pm_ra`` : Proper motion in Right Ascension (rad/yr,
1416  East positive)
1417  - ``pm_raErr`` : Error in ``pm_ra`` (rad/yr), optional.
1418  - ``pm_dec`` : Proper motion in Declination (rad/yr,
1419  North positive)
1420  - ``pm_decErr`` : Error in ``pm_dec`` (rad/yr), optional.
1421  - ``epoch`` : Mean epoch of object (an astropy.time.Time)
1422  epoch : `astropy.time.Time`
1423  Epoch to which to correct proper motion,
1424  """
1425  if ("epoch" not in catalog.schema or "pm_ra" not in catalog.schema or "pm_dec" not in catalog.schema):
1426  if self.config.requireProperMotion:
1427  raise RuntimeError("Proper motion correction required but not available from catalog")
1428  self.log.warn("Proper motion correction not available from catalog")
1429  return
1430  applyProperMotionsImpl(self.log, catalog, epoch)
1431 
1432 

◆ 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 1308 of file loadReferenceObjects.py.

1308  def getMetadataBox(self, bbox, wcs, filterName=None, photoCalib=None, epoch=None):
1309  """Return metadata about the load.
1310 
1311  This metadata is used for reloading the catalog (e.g., for
1312  reconstituting a normalised match list.
1313 
1314  Parameters
1315  ----------
1316  bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
1317  Pixel bounding box.
1318  wcs : `lsst.afw.geom.SkyWcs`
1319  WCS; used to convert pixel positions to sky coordinates.
1320  filterName : `str`
1321  Name of camera filter, or `None` or `""` for the default
1322  filter.
1323  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
1324  Calibration, or `None` if unknown.
1325  epoch : `astropy.time.Time` (optional)
1326  Epoch to which to correct proper motion and parallax,
1327  or None to not apply such corrections.
1328 
1329  Returns
1330  -------
1331  metadata : lsst.daf.base.PropertyList
1332  Metadata about the load.
1333  """
1334  circle = self._calculateCircle(bbox, wcs)
1335  return self.getMetadataCircle(circle.coord, circle.radius, filterName, photoCalib)
1336 

◆ 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.

1337  def getMetadataCircle(self, coord, radius, filterName, photoCalib=None, epoch=None):
1338  """Return metadata about the load.
1339 
1340  This metadata is used for reloading the catalog (e.g., for
1341  reconstituting a normalised match list.
1342 
1343  Parameters
1344  ----------
1345  coord : `lsst.geom.SpherePoint`
1346  ICRS center of the search region.
1347  radius : `lsst.geom.Angle`
1348  Radius of the search region.
1349  filterName : `str`
1350  Name of camera filter, or `None` or `""` for the default
1351  filter.
1352  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
1353  Calibration, or `None` if unknown.
1354  epoch : `astropy.time.Time` (optional)
1355  Epoch to which to correct proper motion and parallax,
1356  or None to not apply such corrections.
1357 
1358  Returns
1359  -------
1360  metadata : lsst.daf.base.PropertyList
1361  Metadata about the load
1362  """
1363  md = PropertyList()
1364  md.add('RA', coord.getRa().asDegrees(), 'field center in degrees')
1365  md.add('DEC', coord.getDec().asDegrees(), 'field center in degrees')
1366  md.add('RADIUS', radius.asDegrees(), 'field radius in degrees, minimum')
1367  md.add('SMATCHV', 1, 'SourceMatchVector version number')
1368  filterName = "UNKNOWN" if filterName is None else str(filterName)
1369  md.add('FILTER', filterName, 'filter name for photometric data')
1370  md.add('EPOCH', "NONE" if epoch is None else epoch, 'Epoch (TAI MJD) for catalog')
1371  return md
1372 

◆ 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.

1373  def joinMatchListWithCatalog(self, matchCat, sourceCat):
1374  """Relink an unpersisted match list to sources and reference
1375  objects.
1376 
1377  A match list is persisted and unpersisted as a catalog of IDs
1378  produced by afw.table.packMatches(), with match metadata
1379  (as returned by the astrometry tasks) in the catalog's metadata
1380  attribute. This method converts such a match catalog into a match
1381  list, with links to source records and reference object records.
1382 
1383  Parameters
1384  ----------
1385  matchCat : `lsst.afw.table.BaseCatalog`
1386  Unperisted packed match list.
1387  ``matchCat.table.getMetadata()`` must contain match metadata,
1388  as returned by the astrometry tasks.
1389  sourceCat : `lsst.afw.table.SourceCatalog`
1390  Source catalog. As a side effect, the catalog will be sorted
1391  by ID.
1392 
1393  Returns
1394  -------
1395  matchList : `lsst.afw.table.ReferenceMatchVector`
1396  Match list.
1397  """
1398  return joinMatchListWithCatalogImpl(self, matchCat, sourceCat)
1399 

◆ 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 931 of file loadReferenceObjects.py.

931  def loadPixelBox(self, bbox, wcs, filterName=None, photoCalib=None, epoch=None):
932  """Load reference objects that overlap a rectangular pixel region.
933 
934  Parameters
935  ----------
936  bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
937  Bounding box for pixels.
938  wcs : `lsst.afw.geom.SkyWcs`
939  WCS; used to convert pixel positions to sky coordinates
940  and vice-versa.
941  filterName : `str`
942  Name of filter, or `None` or `""` for the default filter.
943  This is used for flux values in case we have flux limits
944  (which are not yet implemented).
945  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
946  Calibration, or `None` if unknown.
947  epoch : `astropy.time.Time` (optional)
948  Epoch to which to correct proper motion and parallax,
949  or None to not apply such corrections.
950 
951  Returns
952  -------
953  results : `lsst.pipe.base.Struct`
954  A Struct containing the following fields:
955  refCat : `lsst.afw.catalog.SimpleCatalog`
956  A catalog of reference objects with the standard
957  schema, as documented in the main doc string for
958  `LoadReferenceObjects`.
959  The catalog is guaranteed to be contiguous.
960  fluxField : `str`
961  Name of flux field for specified `filterName`.
962 
963  Notes
964  -----
965  The search algorithm works by searching in a region in sky
966  coordinates whose center is the center of the bbox and radius
967  is large enough to just include all 4 corners of the bbox.
968  Stars that lie outside the bbox are then trimmed from the list.
969  """
970  circle = self._calculateCircle(bbox, wcs)
971 
972  # find objects in circle
973  self.log.info("Loading reference objects using center %s and radius %s deg" %
974  (circle.coord, circle.radius.asDegrees()))
975  loadRes = self.loadSkyCircle(circle.coord, circle.radius, filterName, centroids=True)
976  refCat = loadRes.refCat
977  numFound = len(refCat)
978 
979  # trim objects outside bbox
980  refCat = self._trimToBBox(refCat=refCat, bbox=circle.bbox, wcs=wcs)
981  numTrimmed = numFound - len(refCat)
982  self.log.debug("trimmed %d out-of-bbox objects, leaving %d", numTrimmed, len(refCat))
983  self.log.info("Loaded %d reference objects", len(refCat))
984 
985  # make sure catalog is contiguous
986  if not refCat.isContiguous():
987  loadRes.refCat = refCat.copy(deep=True)
988 
989  return loadRes
990 

◆ 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 992 of file loadReferenceObjects.py.

992  def loadSkyCircle(self, ctrCoord, radius, filterName=None, epoch=None, centroids=False):
993  """Load reference objects that overlap a circular sky region.
994 
995  Parameters
996  ----------
997  ctrCoord : `lsst.geom.SpherePoint`
998  ICRS center of search region.
999  radius : `lsst.geom.Angle`
1000  Radius of search region.
1001  filterName : `str` (optional)
1002  Name of filter, or `None` or `""` for the default filter.
1003  This is used for flux values in case we have flux limits
1004  (which are not yet implemented).
1005  epoch : `astropy.time.Time` (optional)
1006  Epoch to which to correct proper motion and parallax,
1007  or None to not apply such corrections.
1008  centroids : `bool` (optional)
1009  Add centroid fields to the loaded Schema. ``loadPixelBox`` expects
1010  these fields to exist.
1011 
1012  Returns
1013  -------
1014  results : `lsst.pipe.base.Struct`
1015  A Struct containing the following fields:
1016  refCat : `lsst.afw.catalog.SimpleCatalog`
1017  A catalog of reference objects with the standard
1018  schema, as documented in the main doc string for
1019  `LoadReferenceObjects`.
1020  The catalog is guaranteed to be contiguous.
1021  fluxField : `str`
1022  Name of flux field for specified `filterName`.
1023 
1024  Notes
1025  -----
1026  Note that subclasses are responsible for performing the proper motion
1027  correction, since this is the lowest-level interface for retrieving
1028  the catalog.
1029  """
1030  return
1031 

◆ 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 1121 of file loadReferenceObjects.py.

1121  def makeMinimalSchema(filterNameList, *, addCentroid=False,
1122  addIsPhotometric=False, addIsResolved=False,
1123  addIsVariable=False, coordErrDim=2,
1124  addProperMotion=False, properMotionErrDim=2,
1125  addParallax=False):
1126  """Make a standard schema for reference object catalogs.
1127 
1128  Parameters
1129  ----------
1130  filterNameList : `list` of `str`
1131  List of filter names. Used to create <filterName>_flux fields.
1132  addIsPhotometric : `bool`
1133  If True then add field "photometric".
1134  addIsResolved : `bool`
1135  If True then add field "resolved".
1136  addIsVariable : `bool`
1137  If True then add field "variable".
1138  coordErrDim : `int`
1139  Number of coord error fields; must be one of 0, 2, 3:
1140 
1141  - If 2 or 3: add fields "coord_raErr" and "coord_decErr".
1142  - If 3: also add field "coord_radecErr".
1143  addProperMotion : `bool`
1144  If True add fields "epoch", "pm_ra", "pm_dec" and "pm_flag".
1145  properMotionErrDim : `int`
1146  Number of proper motion error fields; must be one of 0, 2, 3;
1147  ignored if addProperMotion false:
1148  - If 2 or 3: add fields "pm_raErr" and "pm_decErr".
1149  - If 3: also add field "pm_radecErr".
1150  addParallax : `bool`
1151  If True add fields "epoch", "parallax", "parallaxErr"
1152  and "parallax_flag".
1153 
1154  Returns
1155  -------
1156  schema : `lsst.afw.table.Schema`
1157  Schema for reference catalog, an
1158  `lsst.afw.table.SimpleCatalog`.
1159 
1160  Notes
1161  -----
1162  Reference catalogs support additional covariances, such as
1163  covariance between RA and proper motion in declination,
1164  that are not supported by this method, but can be added after
1165  calling this method.
1166  """
1167  schema = afwTable.SimpleTable.makeMinimalSchema()
1168  if addCentroid:
1169  afwTable.Point2DKey.addFields(
1170  schema,
1171  "centroid",
1172  "centroid on an exposure, if relevant",
1173  "pixel",
1174  )
1175  schema.addField(
1176  field="hasCentroid",
1177  type="Flag",
1178  doc="is position known?",
1179  )
1180  for filterName in filterNameList:
1181  schema.addField(
1182  field="%s_flux" % (filterName,),
1183  type=numpy.float64,
1184  doc="flux in filter %s" % (filterName,),
1185  units="nJy",
1186  )
1187  for filterName in filterNameList:
1188  schema.addField(
1189  field="%s_fluxErr" % (filterName,),
1190  type=numpy.float64,
1191  doc="flux uncertainty in filter %s" % (filterName,),
1192  units="nJy",
1193  )
1194  if addIsPhotometric:
1195  schema.addField(
1196  field="photometric",
1197  type="Flag",
1198  doc="set if the object can be used for photometric calibration",
1199  )
1200  if addIsResolved:
1201  schema.addField(
1202  field="resolved",
1203  type="Flag",
1204  doc="set if the object is spatially resolved",
1205  )
1206  if addIsVariable:
1207  schema.addField(
1208  field="variable",
1209  type="Flag",
1210  doc="set if the object has variable brightness",
1211  )
1212  if coordErrDim not in (0, 2, 3):
1213  raise ValueError("coordErrDim={}; must be (0, 2, 3)".format(coordErrDim))
1214  if coordErrDim > 0:
1215  afwTable.CovarianceMatrix2fKey.addFields(
1216  schema=schema,
1217  prefix="coord",
1218  names=["ra", "dec"],
1219  units=["rad", "rad"],
1220  diagonalOnly=(coordErrDim == 2),
1221  )
1222 
1223  if addProperMotion or addParallax:
1224  schema.addField(
1225  field="epoch",
1226  type=numpy.float64,
1227  doc="date of observation (TAI, MJD)",
1228  units="day",
1229  )
1230 
1231  if addProperMotion:
1232  schema.addField(
1233  field="pm_ra",
1234  type="Angle",
1235  doc="proper motion in the right ascension direction = dra/dt * cos(dec)",
1236  units="rad/year",
1237  )
1238  schema.addField(
1239  field="pm_dec",
1240  type="Angle",
1241  doc="proper motion in the declination direction",
1242  units="rad/year",
1243  )
1244  if properMotionErrDim not in (0, 2, 3):
1245  raise ValueError("properMotionErrDim={}; must be (0, 2, 3)".format(properMotionErrDim))
1246  if properMotionErrDim > 0:
1247  afwTable.CovarianceMatrix2fKey.addFields(
1248  schema=schema,
1249  prefix="pm",
1250  names=["ra", "dec"],
1251  units=["rad/year", "rad/year"],
1252  diagonalOnly=(properMotionErrDim == 2),
1253  )
1254  schema.addField(
1255  field="pm_flag",
1256  type="Flag",
1257  doc="Set if proper motion or proper motion error is bad",
1258  )
1259 
1260  if addParallax:
1261  schema.addField(
1262  field="parallax",
1263  type="Angle",
1264  doc="parallax",
1265  units="rad",
1266  )
1267  schema.addField(
1268  field="parallaxErr",
1269  type="Angle",
1270  doc="uncertainty in parallax",
1271  units="rad",
1272  )
1273  schema.addField(
1274  field="parallax_flag",
1275  type="Flag",
1276  doc="Set if parallax or parallax error is bad",
1277  )
1278  return schema
1279 

Member Data Documentation

◆ butler

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.butler

Definition at line 928 of file loadReferenceObjects.py.

◆ ConfigClass

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

Definition at line 916 of file loadReferenceObjects.py.


The documentation for this class was generated from the following file:
lsst::log.log.logContinued.warn
def warn(fmt, *args)
Definition: logContinued.py:205
lsst::log.log.logContinued.info
def info(fmt, *args)
Definition: logContinued.py:201
lsst.gdb.afw.printers.debug
bool debug
Definition: printers.py:9
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::meas::algorithms.loadReferenceObjects.applyProperMotionsImpl
def applyProperMotionsImpl(log, catalog, epoch)
Definition: loadReferenceObjects.py:1494
lsst::meas::algorithms.loadReferenceObjects.joinMatchListWithCatalogImpl
def joinMatchListWithCatalogImpl(refObjLoader, matchCat, sourceCat)
Definition: loadReferenceObjects.py:1433