LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask Class Reference
Inheritance diagram for lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask:
lsst.meas.algorithms.loadReferenceObjects.ReferenceObjectLoaderBase 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.

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

907  def __init__(self, butler=None, *args, **kwargs):
908  """Construct a LoadReferenceObjectsTask
909 
910  Parameters
911  ----------
912  butler : `lsst.daf.persistence.Butler`
913  Data butler, for access reference catalogs.
914  """
915  pipeBase.Task.__init__(self, *args, **kwargs)
916  self.butler = butler
917 

Member Function Documentation

◆ applyProperMotions()

def lsst.meas.algorithms.loadReferenceObjects.ReferenceObjectLoaderBase.applyProperMotions (   self,
  catalog,
  epoch 
)
inherited
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 at least these fields:

    - 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.
    If None, do not apply PM corrections or raise if
    ``config.requireProperMotion`` is True.

Raises
------
RuntimeError
    Raised if ``config.requireProperMotion`` is set but we cannot
    apply the proper motion correction for some reason.

Definition at line 197 of file loadReferenceObjects.py.

197  def applyProperMotions(self, catalog, epoch):
198  """Apply proper motion correction to a reference catalog.
199 
200  Adjust position and position error in the ``catalog``
201  for proper motion to the specified ``epoch``,
202  modifying the catalog in place.
203 
204  Parameters
205  ----------
206  catalog : `lsst.afw.table.SimpleCatalog`
207  Catalog of positions, containing at least these fields:
208 
209  - Coordinates, retrieved by the table's coordinate key.
210  - ``coord_raErr`` : Error in Right Ascension (rad).
211  - ``coord_decErr`` : Error in Declination (rad).
212  - ``pm_ra`` : Proper motion in Right Ascension (rad/yr,
213  East positive)
214  - ``pm_raErr`` : Error in ``pm_ra`` (rad/yr), optional.
215  - ``pm_dec`` : Proper motion in Declination (rad/yr,
216  North positive)
217  - ``pm_decErr`` : Error in ``pm_dec`` (rad/yr), optional.
218  - ``epoch`` : Mean epoch of object (an astropy.time.Time)
219  epoch : `astropy.time.Time`
220  Epoch to which to correct proper motion.
221  If None, do not apply PM corrections or raise if
222  ``config.requireProperMotion`` is True.
223 
224  Raises
225  ------
226  RuntimeError
227  Raised if ``config.requireProperMotion`` is set but we cannot
228  apply the proper motion correction for some reason.
229  """
230  if epoch is None:
231  if self.config.requireProperMotion:
232  raise RuntimeError("requireProperMotion=True but epoch not provided to loader.")
233  else:
234  self.log.debug("No epoch provided: not applying proper motion corrections to refcat.")
235  return
236 
237  # Warn/raise for a catalog in an incorrect format, if epoch was specified.
238  if ("pm_ra" in catalog.schema
239  and not isinstance(catalog.schema["pm_ra"].asKey(), afwTable.KeyAngle)):
240  if self.config.requireProperMotion:
241  raise RuntimeError("requireProperMotion=True but refcat pm_ra field is not an Angle.")
242  else:
243  self.log.warning("Reference catalog pm_ra field is not an Angle; cannot apply proper motion.")
244  return
245 
246  if ("epoch" not in catalog.schema or "pm_ra" not in catalog.schema):
247  if self.config.requireProperMotion:
248  raise RuntimeError("requireProperMotion=True but PM data not available from catalog.")
249  else:
250  self.log.warning("Proper motion correction not available for this reference catalog.")
251  return
252 
253  applyProperMotionsImpl(self.log, catalog, epoch)
254 
255 

◆ 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` or `None`, optional
    Name of camera filter, or `None` or `""` for the default
    filter.
photoCalib : `None`
    Deprecated, only included for api compatibility.
epoch : `astropy.time.Time` or `None`, 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 1301 of file loadReferenceObjects.py.

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

◆ 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 : `None`
    Deprecated, only included for api compatibility.
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 1330 of file loadReferenceObjects.py.

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

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

1366  def joinMatchListWithCatalog(self, matchCat, sourceCat):
1367  """Relink an unpersisted match list to sources and reference
1368  objects.
1369 
1370  A match list is persisted and unpersisted as a catalog of IDs
1371  produced by afw.table.packMatches(), with match metadata
1372  (as returned by the astrometry tasks) in the catalog's metadata
1373  attribute. This method converts such a match catalog into a match
1374  list, with links to source records and reference object records.
1375 
1376  Parameters
1377  ----------
1378  matchCat : `lsst.afw.table.BaseCatalog`
1379  Unperisted packed match list.
1380  ``matchCat.table.getMetadata()`` must contain match metadata,
1381  as returned by the astrometry tasks.
1382  sourceCat : `lsst.afw.table.SourceCatalog`
1383  Source catalog. As a side effect, the catalog will be sorted
1384  by ID.
1385 
1386  Returns
1387  -------
1388  matchList : `lsst.afw.table.ReferenceMatchVector`
1389  Match list.
1390  """
1391  return joinMatchListWithCatalogImpl(self, matchCat, sourceCat)
1392 
1393 
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` or `None`, 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).
photoCalib : `None`
    Deprecated, only included for api compatibility.
epoch : `astropy.time.Time` or `None`, 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 919 of file loadReferenceObjects.py.

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

◆ 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` or `None`, 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` or `None`, 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 981 of file loadReferenceObjects.py.

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

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

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

Member Data Documentation

◆ butler

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.butler

Definition at line 916 of file loadReferenceObjects.py.

◆ ConfigClass

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

Definition at line 904 of file loadReferenceObjects.py.


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