LSSTApplications  17.0+103,17.0+11,17.0+61,18.0.0+13,18.0.0+25,18.0.0+5,18.0.0+52,18.0.0-4-g68ffd23,18.1.0-1-g0001055+8,18.1.0-1-g03d53ef+1,18.1.0-1-g1349e88+28,18.1.0-1-g2505f39+22,18.1.0-1-g380d4d4+27,18.1.0-1-g5315e5e+1,18.1.0-1-g5e4b7ea+10,18.1.0-1-g7e8fceb+1,18.1.0-1-g85f8cd4+23,18.1.0-1-g9a6769a+13,18.1.0-1-ga1a4c1a+22,18.1.0-1-gd55f500+17,18.1.0-12-g42eabe8e+10,18.1.0-14-gd04256d+15,18.1.0-16-g430f6a53+1,18.1.0-17-gd2166b6e4,18.1.0-18-gb5d19ff+1,18.1.0-2-gfbf3545+7,18.1.0-2-gfefb8b5+16,18.1.0-3-g52aa583+13,18.1.0-3-g62b5e86+14,18.1.0-3-g8f4a2b1+17,18.1.0-3-g9bc06b8+7,18.1.0-3-gb69f684+9,18.1.0-4-g1ee41a7+1,18.1.0-5-g6dbcb01+13,18.1.0-5-gc286bb7+3,18.1.0-6-g48bdcd3+2,18.1.0-6-gd05e160+9,18.1.0-7-gc4d902b+2,18.1.0-7-gebc0338+8,18.1.0-9-gae7190a+10,w.2019.37
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 lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask

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

Definition at line 888 of file loadReferenceObjects.py.

888  def __init__(self, butler=None, *args, **kwargs):
889  """Construct a LoadReferenceObjectsTask
890 
891  Parameters
892  ----------
893  butler : `lsst.daf.persistence.Butler`
894  Data butler, for access reference catalogs.
895  """
896  pipeBase.Task.__init__(self, *args, **kwargs)
897  self.butler = butler
898 
def __init__(self, minimum, dataRange, Q)

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 catalong 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` (optional)
    Epoch to which to correct proper motion and parallax,
    or None to not apply such corrections.

Definition at line 1361 of file loadReferenceObjects.py.

1361  def applyProperMotions(self, catalog, epoch):
1362  """Apply proper motion correction to a reference catalog.
1363 
1364  Adjust position and position error in the ``catalog``
1365  for proper motion to the specified ``epoch``,
1366  modifying the catalong in place.
1367 
1368  Parameters
1369  ----------
1370  catalog : `lsst.afw.table.SimpleCatalog`
1371  Catalog of positions, containing:
1372 
1373  - Coordinates, retrieved by the table's coordinate key.
1374  - ``coord_raErr`` : Error in Right Ascension (rad).
1375  - ``coord_decErr`` : Error in Declination (rad).
1376  - ``pm_ra`` : Proper motion in Right Ascension (rad/yr,
1377  East positive)
1378  - ``pm_raErr`` : Error in ``pm_ra`` (rad/yr), optional.
1379  - ``pm_dec`` : Proper motion in Declination (rad/yr,
1380  North positive)
1381  - ``pm_decErr`` : Error in ``pm_dec`` (rad/yr), optional.
1382  - ``epoch`` : Mean epoch of object (an astropy.time.Time)
1383  epoch : `astropy.time.Time` (optional)
1384  Epoch to which to correct proper motion and parallax,
1385  or None to not apply such corrections.
1386  """
1387  if ("epoch" not in catalog.schema or "pm_ra" not in catalog.schema or "pm_dec" not in catalog.schema):
1388  if self.config.requireProperMotion:
1389  raise RuntimeError("Proper motion correction required but not available from catalog")
1390  self.log.warn("Proper motion correction not available from catalog")
1391  return
1392  applyProperMotionsImpl(self.log, catalog, epoch)
1393 
1394 

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

1269  def getMetadataBox(self, bbox, wcs, filterName=None, photoCalib=None, epoch=None):
1270  """Return metadata about the load.
1271 
1272  This metadata is used for reloading the catalog (e.g., for
1273  reconstituting a normalised match list.
1274 
1275  Parameters
1276  ----------
1277  bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
1278  Pixel bounding box.
1279  wcs : `lsst.afw.geom.SkyWcs`
1280  WCS; used to convert pixel positions to sky coordinates.
1281  filterName : `str`
1282  Name of camera filter, or `None` or `""` for the default
1283  filter.
1284  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
1285  Calibration, or `None` if unknown.
1286  epoch : `astropy.time.Time` (optional)
1287  Epoch to which to correct proper motion and parallax,
1288  or None to not apply such corrections.
1289 
1290  Returns
1291  -------
1292  metadata : lsst.daf.base.PropertyList
1293  Metadata about the load.
1294  """
1295  circle = self._calculateCircle(bbox, wcs)
1296  return self.getMetadataCircle(circle.coord, circle.radius, filterName, photoCalib)
1297 

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

1298  def getMetadataCircle(self, coord, radius, filterName, photoCalib=None, epoch=None):
1299  """Return metadata about the load.
1300 
1301  This metadata is used for reloading the catalog (e.g., for
1302  reconstituting a normalised match list.
1303 
1304  Parameters
1305  ----------
1306  coord : `lsst.geom.SpherePoint`
1307  ICRS center of the search region.
1308  radius : `lsst.geom.Angle`
1309  Radius of the search region.
1310  filterName : `str`
1311  Name of camera filter, or `None` or `""` for the default
1312  filter.
1313  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
1314  Calibration, or `None` if unknown.
1315  epoch : `astropy.time.Time` (optional)
1316  Epoch to which to correct proper motion and parallax,
1317  or None to not apply such corrections.
1318 
1319  Returns
1320  -------
1321  metadata : lsst.daf.base.PropertyList
1322  Metadata about the load
1323  """
1324  md = PropertyList()
1325  md.add('RA', coord.getRa().asDegrees(), 'field center in degrees')
1326  md.add('DEC', coord.getDec().asDegrees(), 'field center in degrees')
1327  md.add('RADIUS', radius.asDegrees(), 'field radius in degrees, minimum')
1328  md.add('SMATCHV', 1, 'SourceMatchVector version number')
1329  filterName = "UNKNOWN" if filterName is None else str(filterName)
1330  md.add('FILTER', filterName, 'filter name for photometric data')
1331  md.add('EPOCH', "NONE" if epoch is None else epoch, 'Epoch (TAI MJD) for catalog')
1332  return md
1333 

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

1334  def joinMatchListWithCatalog(self, matchCat, sourceCat):
1335  """Relink an unpersisted match list to sources and reference
1336  objects.
1337 
1338  A match list is persisted and unpersisted as a catalog of IDs
1339  produced by afw.table.packMatches(), with match metadata
1340  (as returned by the astrometry tasks) in the catalog's metadata
1341  attribute. This method converts such a match catalog into a match
1342  list, with links to source records and reference object records.
1343 
1344  Parameters
1345  ----------
1346  matchCat : `lsst.afw.table.BaseCatalog`
1347  Unperisted packed match list.
1348  ``matchCat.table.getMetadata()`` must contain match metadata,
1349  as returned by the astrometry tasks.
1350  sourceCat : `lsst.afw.table.SourceCatalog`
1351  Source catalog. As a side effect, the catalog will be sorted
1352  by ID.
1353 
1354  Returns
1355  -------
1356  matchList : `lsst.afw.table.ReferenceMatchVector`
1357  Match list.
1358  """
1359  return joinMatchListWithCatalogImpl(self, matchCat, sourceCat)
1360 
def joinMatchListWithCatalogImpl(refObjLoader, matchCat, sourceCat)

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

900  def loadPixelBox(self, bbox, wcs, filterName=None, photoCalib=None, epoch=None):
901  """Load reference objects that overlap a rectangular pixel region.
902 
903  Parameters
904  ----------
905  bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
906  Bounding box for pixels.
907  wcs : `lsst.afw.geom.SkyWcs`
908  WCS; used to convert pixel positions to sky coordinates
909  and vice-versa.
910  filterName : `str`
911  Name of filter, or `None` or `""` for the default filter.
912  This is used for flux values in case we have flux limits
913  (which are not yet implemented).
914  photoCalib : `lsst.afw.image.PhotoCalib` (optional)
915  Calibration, or `None` if unknown.
916  epoch : `astropy.time.Time` (optional)
917  Epoch to which to correct proper motion and parallax,
918  or None to not apply such corrections.
919 
920  Returns
921  -------
922  results : `lsst.pipe.base.Struct`
923  A Struct containing the following fields:
924  refCat : `lsst.afw.catalog.SimpleCatalog`
925  A catalog of reference objects with the standard
926  schema, as documented in the main doc string for
927  `LoadReferenceObjects`.
928  The catalog is guaranteed to be contiguous.
929  fluxField : `str`
930  Name of flux field for specified `filterName`.
931 
932  Notes
933  -----
934  The search algorithm works by searching in a region in sky
935  coordinates whose center is the center of the bbox and radius
936  is large enough to just include all 4 corners of the bbox.
937  Stars that lie outside the bbox are then trimmed from the list.
938  """
939  circle = self._calculateCircle(bbox, wcs)
940 
941  # find objects in circle
942  self.log.info("Loading reference objects using center %s and radius %s deg" %
943  (circle.coord, circle.radius.asDegrees()))
944  loadRes = self.loadSkyCircle(circle.coord, circle.radius, filterName, centroids=True)
945  refCat = loadRes.refCat
946  numFound = len(refCat)
947 
948  # trim objects outside bbox
949  refCat = self._trimToBBox(refCat=refCat, bbox=circle.bbox, wcs=wcs)
950  numTrimmed = numFound - len(refCat)
951  self.log.debug("trimmed %d out-of-bbox objects, leaving %d", numTrimmed, len(refCat))
952  self.log.info("Loaded %d reference objects", len(refCat))
953 
954  # make sure catalog is contiguous
955  if not refCat.isContiguous():
956  loadRes.refCat = refCat.copy(deep=True)
957 
958  return loadRes
959 

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

Definition at line 961 of file loadReferenceObjects.py.

961  def loadSkyCircle(self, ctrCoord, radius, filterName=None, epoch=None, centroids=False):
962  """Load reference objects that overlap a circular sky region.
963 
964  Parameters
965  ----------
966  ctrCoord : `lsst.geom.SpherePoint`
967  ICRS center of search region.
968  radius : `lsst.geom.Angle`
969  Radius of search region.
970  filterName : `str` (optional)
971  Name of filter, or `None` or `""` for the default filter.
972  This is used for flux values in case we have flux limits
973  (which are not yet implemented).
974  epoch : `astropy.time.Time` (optional)
975  Epoch to which to correct proper motion and parallax,
976  or None to not apply such corrections.
977  centroids : `bool` (optional)
978  Add centroid fields to the loaded Schema. ``loadPixelBox`` expects
979  these fields to exist.
980 
981  Returns
982  -------
983  results : `lsst.pipe.base.Struct`
984  A Struct containing the following fields:
985  refCat : `lsst.afw.catalog.SimpleCatalog`
986  A catalog of reference objects with the standard
987  schema, as documented in the main doc string for
988  `LoadReferenceObjects`.
989  The catalog is guaranteed to be contiguous.
990  fluxField : `str`
991  Name of flux field for specified `filterName`.
992 
993  Notes
994  -----
995  Note that subclasses are responsible for performing the proper motion
996  correction, since this is the lowest-level interface for retrieving
997  the catalog.
998  """
999  return
1000 

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

1086  addParallax=False):
1087  """Make a standard schema for reference object catalogs.
1088 
1089  Parameters
1090  ----------
1091  filterNameList : `list` of `str`
1092  List of filter names. Used to create <filterName>_flux fields.
1093  addIsPhotometric : `bool`
1094  If True then add field "photometric".
1095  addIsResolved : `bool`
1096  If True then add field "resolved".
1097  addIsVariable : `bool`
1098  If True then add field "variable".
1099  coordErrDim : `int`
1100  Number of coord error fields; must be one of 0, 2, 3:
1101 
1102  - If 2 or 3: add fields "coord_raErr" and "coord_decErr".
1103  - If 3: also add field "coord_radecErr".
1104  addProperMotion : `bool`
1105  If True add fields "epoch", "pm_ra", "pm_dec" and "pm_flag".
1106  properMotionErrDim : `int`
1107  Number of proper motion error fields; must be one of 0, 2, 3;
1108  ignored if addProperMotion false:
1109  - If 2 or 3: add fields "pm_raErr" and "pm_decErr".
1110  - If 3: also add field "pm_radecErr".
1111  addParallax : `bool`
1112  If True add fields "epoch", "parallax", "parallaxErr"
1113  and "parallax_flag".
1114 
1115  Returns
1116  -------
1117  schema : `lsst.afw.table.Schema`
1118  Schema for reference catalog, an
1119  `lsst.afw.table.SimpleCatalog`.
1120 
1121  Notes
1122  -----
1123  Reference catalogs support additional covariances, such as
1124  covariance between RA and proper motion in declination,
1125  that are not supported by this method, but can be added after
1126  calling this method.
1127  """
1128  schema = afwTable.SimpleTable.makeMinimalSchema()
1129  if addCentroid:
1130  afwTable.Point2DKey.addFields(
1131  schema,
1132  "centroid",
1133  "centroid on an exposure, if relevant",
1134  "pixel",
1135  )
1136  schema.addField(
1137  field="hasCentroid",
1138  type="Flag",
1139  doc="is position known?",
1140  )
1141  for filterName in filterNameList:
1142  schema.addField(
1143  field="%s_flux" % (filterName,),
1144  type=numpy.float64,
1145  doc="flux in filter %s" % (filterName,),
1146  units="nJy",
1147  )
1148  for filterName in filterNameList:
1149  schema.addField(
1150  field="%s_fluxErr" % (filterName,),
1151  type=numpy.float64,
1152  doc="flux uncertainty in filter %s" % (filterName,),
1153  units="nJy",
1154  )
1155  if addIsPhotometric:
1156  schema.addField(
1157  field="photometric",
1158  type="Flag",
1159  doc="set if the object can be used for photometric calibration",
1160  )
1161  if addIsResolved:
1162  schema.addField(
1163  field="resolved",
1164  type="Flag",
1165  doc="set if the object is spatially resolved",
1166  )
1167  if addIsVariable:
1168  schema.addField(
1169  field="variable",
1170  type="Flag",
1171  doc="set if the object has variable brightness",
1172  )
1173  if coordErrDim not in (0, 2, 3):
1174  raise ValueError("coordErrDim={}; must be (0, 2, 3)".format(coordErrDim))
1175  if coordErrDim > 0:
1176  afwTable.CovarianceMatrix2fKey.addFields(
1177  schema=schema,
1178  prefix="coord",
1179  names=["ra", "dec"],
1180  units=["rad", "rad"],
1181  diagonalOnly=(coordErrDim == 2),
1182  )
1183 
1184  if addProperMotion or addParallax:
1185  schema.addField(
1186  field="epoch",
1187  type=numpy.float64,
1188  doc="date of observation (TAI, MJD)",
1189  units="day",
1190  )
1191 
1192  if addProperMotion:
1193  schema.addField(
1194  field="pm_ra",
1195  type="Angle",
1196  doc="proper motion in the right ascension direction = dra/dt * cos(dec)",
1197  units="rad/year",
1198  )
1199  schema.addField(
1200  field="pm_dec",
1201  type="Angle",
1202  doc="proper motion in the declination direction",
1203  units="rad/year",
1204  )
1205  if properMotionErrDim not in (0, 2, 3):
1206  raise ValueError("properMotionErrDim={}; must be (0, 2, 3)".format(properMotionErrDim))
1207  if properMotionErrDim > 0:
1208  afwTable.CovarianceMatrix2fKey.addFields(
1209  schema=schema,
1210  prefix="pm",
1211  names=["ra", "dec"],
1212  units=["rad/year", "rad/year"],
1213  diagonalOnly=(properMotionErrDim == 2),
1214  )
1215  schema.addField(
1216  field="pm_flag",
1217  type="Flag",
1218  doc="Set if proper motion or proper motion error is bad",
1219  )
1220 
1221  if addParallax:
1222  schema.addField(
1223  field="parallax",
1224  type="Angle",
1225  doc="parallax",
1226  units="rad",
1227  )
1228  schema.addField(
1229  field="parallaxErr",
1230  type="Angle",
1231  doc="uncertainty in parallax",
1232  units="rad",
1233  )
1234  schema.addField(
1235  field="parallax_flag",
1236  type="Flag",
1237  doc="Set if parallax or parallax error is bad",
1238  )
1239  return schema
1240 
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:167

Member Data Documentation

◆ butler

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.butler

Definition at line 897 of file loadReferenceObjects.py.

◆ ConfigClass

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

Definition at line 885 of file loadReferenceObjects.py.


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