LSSTApplications  21.0.0+1b62c9342b,21.0.0+45a059f35e,21.0.0-1-ga51b5d4+ceb9cf20a3,21.0.0-2-g103fe59+4d13aff7ba,21.0.0-2-g1367e85+571a348718,21.0.0-2-g2909d54+45a059f35e,21.0.0-2-g45278ab+1b62c9342b,21.0.0-2-g4bc9b9f+ebfe466dad,21.0.0-2-g5242d73+571a348718,21.0.0-2-g54e2caa+ae261561d3,21.0.0-2-g66bcc37+0b2c5d3971,21.0.0-2-g7f82c8f+08f1f55c36,21.0.0-2-g8dde007+5d1b9cb3f5,21.0.0-2-g8f08a60+73884b2cf5,21.0.0-2-ga326454+08f1f55c36,21.0.0-2-ga63a54e+5beb793fda,21.0.0-2-gc738bc1+8c4731df06,21.0.0-2-gde069b7+5a8f2956b8,21.0.0-2-ge17e5af+571a348718,21.0.0-2-ge712728+cfa36ee5f9,21.0.0-2-gecfae73+e597808034,21.0.0-2-gfc62afb+571a348718,21.0.0-20-g4449a12+6d1341e0f3,21.0.0-21-g006371a9+1cd928f0c5,21.0.0-3-g4c5b185+c3794955c6,21.0.0-3-g6d51c4a+0b2c5d3971,21.0.0-3-g8076721+5adeb471db,21.0.0-3-gaa929c8+01f4b7cfca,21.0.0-3-gd222c45+afc8332dbe,21.0.0-4-g1383c07+0b2c5d3971,21.0.0-4-g3300ddd+1b62c9342b,21.0.0-4-g5873dc9+9a92674037,21.0.0-4-g8a80011+ca0917f8b6,21.0.0-5-gcff38f6+36b2eaf090,21.0.0-6-g463d161+bfc341698e,21.0.0-6-gd3283ba+01f4b7cfca,21.0.0-8-g19111d86+8234efb485,21.0.0-9-g7bed000b9+c7d3cce47e,w.2021.04
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask Class Reference
Inheritance diagram for lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask:
lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask

Public Member Functions

def __init__ (self, butler, *args, **kwargs)
 
def loadSkyCircle (self, ctrCoord, radius, filterName=None, epoch=None, centroids=False)
 
def getShards (self, shardIdList)
 
def loadPixelBox (self, bbox, wcs, filterName=None, photoCalib=None, epoch=None)
 
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

 dataset_config
 
 indexer
 
 ref_dataset_name
 
 butler
 

Static Public Attributes

 ConfigClass = LoadIndexedReferenceObjectsConfig
 

Detailed Description

Load reference objects from an indexed catalog ingested by
IngestIndexReferenceTask.

Parameters
----------
butler : `lsst.daf.persistence.Butler`
    Data butler for reading catalogs

Definition at line 43 of file loadIndexedReferenceObjects.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.__init__ (   self,
  butler,
args,
**  kwargs 
)
Construct a LoadReferenceObjectsTask

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

Reimplemented from lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.

Definition at line 55 of file loadIndexedReferenceObjects.py.

55  def __init__(self, butler, *args, **kwargs):
56  LoadReferenceObjectsTask.__init__(self, *args, **kwargs)
57  self.dataset_config = butler.get("ref_cat_config", name=self.config.ref_dataset_name, immediate=True)
58  self.indexer = IndexerRegistry[self.dataset_config.indexer.name](self.dataset_config.indexer.active)
59  # This needs to come from the loader config, not the dataset_config since directory aliases can
60  # change the path where the shards are found.
61  self.ref_dataset_name = self.config.ref_dataset_name
62  self.butler = butler
63 

Member Function Documentation

◆ applyProperMotions()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.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:

    - 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 
)
inherited
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.

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

◆ getMetadataCircle()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.getMetadataCircle (   self,
  coord,
  radius,
  filterName,
  photoCalib = None,
  epoch = None 
)
inherited
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.mjd, 'Epoch (TAI MJD) for catalog')
1371  return md
1372 

◆ getShards()

def lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.getShards (   self,
  shardIdList 
)
Get shards by ID.

Parameters
----------
shardIdList : `list` of `int`
    A list of integer shard ids.

Returns
-------
catalogs : `list` of `lsst.afw.table.SimpleCatalog`
    A list of reference catalogs, one for each entry in shardIdList.

Definition at line 130 of file loadIndexedReferenceObjects.py.

130  def getShards(self, shardIdList):
131  """Get shards by ID.
132 
133  Parameters
134  ----------
135  shardIdList : `list` of `int`
136  A list of integer shard ids.
137 
138  Returns
139  -------
140  catalogs : `list` of `lsst.afw.table.SimpleCatalog`
141  A list of reference catalogs, one for each entry in shardIdList.
142  """
143  shards = []
144  for shardId in shardIdList:
145  if self.butler.datasetExists('ref_cat',
146  dataId=self.indexer.makeDataId(shardId, self.ref_dataset_name)):
147  shards.append(self.butler.get('ref_cat',
148  dataId=self.indexer.makeDataId(shardId, self.ref_dataset_name),
149  immediate=True))
150  return shards
151 

◆ joinMatchListWithCatalog()

def lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.joinMatchListWithCatalog (   self,
  matchCat,
  sourceCat 
)
inherited
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 
)
inherited
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.

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

◆ loadSkyCircle()

def lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.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 from lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.

Definition at line 65 of file loadIndexedReferenceObjects.py.

65  def loadSkyCircle(self, ctrCoord, radius, filterName=None, epoch=None, centroids=False):
66  shardIdList, isOnBoundaryList = self.indexer.getShardIds(ctrCoord, radius)
67  shards = self.getShards(shardIdList)
68  refCat = self.butler.get('ref_cat',
69  dataId=self.indexer.makeDataId('master_schema', self.ref_dataset_name),
70  immediate=True)
71 
72  # load the catalog, one shard at a time
73  for shard, isOnBoundary in zip(shards, isOnBoundaryList):
74  if shard is None:
75  continue
76  if isOnBoundary:
77  refCat.extend(self._trimToCircle(shard, ctrCoord, radius))
78  else:
79  refCat.extend(shard)
80 
81  # make sure catalog is contiguous: must do this before PM calculations
82  if not refCat.isContiguous():
83  refCat = refCat.copy(True)
84 
85  # apply proper motion corrections
86  if epoch is not None and "pm_ra" in refCat.schema:
87  # check for a catalog in a non-standard format
88  if isinstance(refCat.schema["pm_ra"].asKey(), lsst.afw.table.KeyAngle):
89  self.applyProperMotions(refCat, epoch)
90  else:
91  self.log.warn("Catalog pm_ra field is not an Angle; not applying proper motion")
92 
93  # update version=0 style refcats to have nJy fluxes
94  if self.dataset_config.format_version == 0 or not hasNanojanskyFluxUnits(refCat.schema):
95  self.log.warn("Found version 0 reference catalog with old style units in schema.")
96  self.log.warn("run `meas_algorithms/bin/convert_refcat_to_nJy.py` to convert fluxes to nJy.")
97  self.log.warn("See RFC-575 for more details.")
98  refCat = convertToNanojansky(refCat, self.log)
99  else:
100  # For version >= 1, the version should be in the catalog header,
101  # too, and should be consistent with the version in the config.
102  catVersion = getFormatVersionFromRefCat(refCat)
103  if catVersion != self.dataset_config.format_version:
104  raise RuntimeError(f"Format version in reference catalog ({catVersion}) does not match"
105  f" format_version field in config ({self.dataset_config.format_version})")
106 
107  self._addFluxAliases(refCat.schema)
108  fluxField = getRefFluxField(schema=refCat.schema, filterName=filterName)
109 
110  if centroids:
111  # add and initialize centroid and hasCentroid fields (these are
112  # added after loading to avoid wasting space in the saved catalogs)
113  # the new fields are automatically initialized to (nan, nan) and
114  # False so no need to set them explicitly
115  mapper = afwTable.SchemaMapper(refCat.schema, True)
116  mapper.addMinimalSchema(refCat.schema, True)
117  mapper.editOutputSchema().addField("centroid_x", type=float)
118  mapper.editOutputSchema().addField("centroid_y", type=float)
119  mapper.editOutputSchema().addField("hasCentroid", type="Flag")
120  expandedCat = afwTable.SimpleCatalog(mapper.getOutputSchema())
121  expandedCat.extend(refCat, mapper=mapper)
122  refCat = expandedCat
123 
124  # return reference catalog
125  return pipeBase.Struct(
126  refCat=refCat,
127  fluxField=fluxField,
128  )
129 

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

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

Member Data Documentation

◆ butler

lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.butler

Definition at line 62 of file loadIndexedReferenceObjects.py.

◆ ConfigClass

lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.ConfigClass = LoadIndexedReferenceObjectsConfig
static

Definition at line 52 of file loadIndexedReferenceObjects.py.

◆ dataset_config

lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.dataset_config

Definition at line 57 of file loadIndexedReferenceObjects.py.

◆ indexer

lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.indexer

Definition at line 58 of file loadIndexedReferenceObjects.py.

◆ ref_dataset_name

lsst.meas.algorithms.loadIndexedReferenceObjects.LoadIndexedReferenceObjectsTask.ref_dataset_name

Definition at line 61 of file loadIndexedReferenceObjects.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.getRefFluxField
def getRefFluxField(schema, filterName=None)
Definition: loadReferenceObjects.py:689
lsst::meas::algorithms.loadReferenceObjects.getFormatVersionFromRefCat
def getFormatVersionFromRefCat(refCat)
Definition: loadReferenceObjects.py:66
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
lsst::meas::algorithms.loadReferenceObjects.convertToNanojansky
def convertToNanojansky(catalog, log, doConvert=True)
Definition: loadReferenceObjects.py:89
lsst::afw::table::SchemaMapper
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:21
lsst.pipe.tasks.cli.cmd.commands.str
str
Definition: commands.py:50
lsst::meas::algorithms.loadReferenceObjects.hasNanojanskyFluxUnits
def hasNanojanskyFluxUnits(schema)
Definition: loadReferenceObjects.py:57
lsst::afw::table::SortedCatalogT
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
Definition: SortedCatalog.h:42