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.38
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask Class Reference

Load reference objects from astrometry.net index files. More...

Inheritance diagram for lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask:
lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask

Public Member Functions

def __init__ (self, config=None, andConfig=None, kwargs)
 Create a LoadAstrometryNetObjectsTask. More...
 
def loadSkyCircle (self, ctrCoord, radius, filterName=None, epoch=None, centroids=True)
 Load reference objects that overlap a circular sky region. More...
 
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

 andConfig
 
 haveIndexFiles
 
 multiInds
 
 butler
 

Static Public Attributes

 ConfigClass = LoadAstrometryNetObjectsConfig
 

Detailed Description

Load reference objects from astrometry.net index files.

Contents

Description

Load reference objects from astrometry.net index files.

Task initialisation

Create a LoadAstrometryNetObjectsTask.

Parameters
[in]configconfiguration (an instance of self.ConfigClass); if None use self.ConfigClass()
[in]andConfigastrometry.net data config (an instance of AstromNetDataConfig, or None); if None then use andConfig.py in the astrometry_net_data product (which must be setup)
[in]kwargsadditional keyword arguments for pipe_base Task.__init__
Exceptions
RuntimeErrorif andConfig is None and the configuration cannot be found, either because astrometry_net_data is not setup in eups or because the setup version does not include the file "andConfig.py"

Invoking the Task

Configuration parameters

See LoadAstrometryNetObjectsConfig

A complete example of using

LoadAstrometryNetObjectsTask

LoadAstrometryNetObjectsTask is a subtask of AstrometryTask, which is called by PhotoCalTask. See A complete example of using PhotoCalTask.

Debug variables

LoadAstrometryNetObjectsTask does not support any debug variables.

Definition at line 20 of file loadAstrometryNetObjects.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.__init__ (   self,
  config = None,
  andConfig = None,
  kwargs 
)

Create a LoadAstrometryNetObjectsTask.

Parameters
[in]configconfiguration (an instance of self.ConfigClass); if None use self.ConfigClass()
[in]andConfigastrometry.net data config (an instance of AstromNetDataConfig, or None); if None then use andConfig.py in the astrometry_net_data product (which must be setup)
[in]kwargsadditional keyword arguments for pipe_base Task.__init__
Exceptions
RuntimeErrorif andConfig is None and the configuration cannot be found, either because astrometry_net_data is not setup in eups or because the setup version does not include the file "andConfig.py"

Definition at line 63 of file loadAstrometryNetObjects.py.

63  def __init__(self, config=None, andConfig=None, **kwargs):
64  """!Create a LoadAstrometryNetObjectsTask
65 
66  @param[in] config configuration (an instance of self.ConfigClass); if None use self.ConfigClass()
67  @param[in] andConfig astrometry.net data config (an instance of AstromNetDataConfig, or None);
68  if None then use andConfig.py in the astrometry_net_data product (which must be setup)
69  @param[in] kwargs additional keyword arguments for pipe_base Task.\_\_init\_\_
70 
71  @throw RuntimeError if andConfig is None and the configuration cannot be found,
72  either because astrometry_net_data is not setup in eups
73  or because the setup version does not include the file "andConfig.py"
74  """
75  LoadReferenceObjectsTask.__init__(self, config=config, **kwargs)
76  self.andConfig = andConfig
77  self.haveIndexFiles = False # defer reading index files until we know they are needed
78  # because astrometry may not be used, in which case it may not be properly configured
79 
def __init__(self, minimum, dataRange, Q)

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 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 
)
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 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 
)
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 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 
)
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 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 
)
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 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.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.loadSkyCircle (   self,
  ctrCoord,
  radius,
  filterName = None,
  epoch = None,
  centroids = True 
)

Load reference objects that overlap a circular sky region.

Parameters
[in]ctrCoordcenter of search region (an afwGeom.Coord)
[in]radiusradius of search region (an geom.Angle)
[in]filterNamename of filter, or None for the default filter; used for flux values in case we have flux limits (which are not yet implemented)
[in]epochEpoch for proper motion and parallax correction (an astropy.time.Time), or None centroids : bool (optional) Ignored: a.net refcats always have centroid fields.

No proper motion correction is made, since our astrometry.net catalogs typically don't support that, and even if they do they format is uncertain. Users interested in proper motion corrections should use the lsst.meas.algorithms.LoadIndexedReferenceObjectsTask or they will need to subclass and define how the proper motion correction is to be done.

Returns
an lsst.pipe.base.Struct containing:
  • refCat a catalog of reference objects with the standard schema as documented in LoadReferenceObjects, including photometric, resolved and variable; hasCentroid is False for all objects.
  • fluxField = name of flux field for specified filterName

Definition at line 81 of file loadAstrometryNetObjects.py.

81  def loadSkyCircle(self, ctrCoord, radius, filterName=None, epoch=None, centroids=True):
82  """!Load reference objects that overlap a circular sky region
83 
84  @param[in] ctrCoord center of search region (an afwGeom.Coord)
85  @param[in] radius radius of search region (an geom.Angle)
86  @param[in] filterName name of filter, or None for the default filter;
87  used for flux values in case we have flux limits (which are not yet implemented)
88  @param[in] epoch Epoch for proper motion and parallax correction
89  (an astropy.time.Time), or None
90  centroids : `bool` (optional)
91  Ignored: a.net refcats always have centroid fields.
92 
93  No proper motion correction is made, since our astrometry.net catalogs
94  typically don't support that, and even if they do they format is uncertain.
95  Users interested in proper motion corrections should use the
96  lsst.meas.algorithms.LoadIndexedReferenceObjectsTask or they will need to
97  subclass and define how the proper motion correction is to be done.
98 
99  @return an lsst.pipe.base.Struct containing:
100  - refCat a catalog of reference objects with the
101  \link meas_algorithms_loadReferenceObjects_Schema standard schema \endlink
102  as documented in LoadReferenceObjects, including photometric, resolved and variable;
103  hasCentroid is False for all objects.
104  - fluxField = name of flux field for specified filterName
105  """
106  self._readIndexFiles()
107 
108  names = []
109  mcols = []
110  ecols = []
111  for col, mcol in self.andConfig.magColumnMap.items():
112  names.append(col)
113  mcols.append(mcol)
114  ecols.append(self.andConfig.magErrorColumnMap.get(col, ''))
115  margs = (names, mcols, ecols)
116 
117  solver = self._getSolver()
118 
119  # Find multi-index files within range
120  multiInds = self._getMIndexesWithinRange(ctrCoord, radius)
121 
122  # compute solver.getCatalog arguments that follow the list of star kd-trees:
123  # - center equatorial angle (e.g. RA) in deg
124  # - center polar angle (e.g. Dec) in deg
125  # - radius, in deg
126  # - idColumn
127  # - (margs)
128  # - star-galaxy column
129  # - variability column
130  fixedArgTuple = (
131  ctrCoord,
132  radius,
133  self.andConfig.idColumn,
134  ) + margs + (
135  self.andConfig.starGalaxyColumn,
136  self.andConfig.variableColumn,
137  True, # eliminate duplicate IDs
138  )
139 
140  self.log.debug("search for objects at %s with radius %s deg", ctrCoord, radius.asDegrees())
141  with LoadMultiIndexes(multiInds):
142  # We just want to pass the star kd-trees, so just pass the
143  # first element of each multi-index.
144  inds = tuple(mi[0] for mi in multiInds)
145  refCat = solver.getCatalog(inds, *fixedArgTuple)
146 
147  self._addFluxAliases(schema=refCat.schema)
148 
149  fluxField = getRefFluxField(schema=refCat.schema, filterName=filterName)
150 
151  # NOTE: sourceSelectors require contiguous catalogs, so ensure
152  # contiguity now, so views are preserved from here on.
153  if not refCat.isContiguous():
154  refCat = refCat.copy(deep=True)
155 
156  # Update flux fields to be nJy. a.net catalogs do not have a conversion script.
157  self.log.warn("Loading A.net reference catalog with old style units in schema.")
158  self.log.warn("A.net reference catalogs will not be supported in the future.")
159  self.log.warn("See RFC-562 and RFC-575 for more details.")
160  refCat = convertToNanojansky(refCat, self.log)
161 
162  self.log.debug("found %d objects", len(refCat))
163  return pipeBase.Struct(
164  refCat=refCat,
165  fluxField=fluxField,
166  )
167 
def convertToNanojansky(catalog, log, doConvert=True)

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

◆ andConfig

lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.andConfig

Definition at line 76 of file loadAstrometryNetObjects.py.

◆ butler

lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsTask.butler
inherited

Definition at line 897 of file loadReferenceObjects.py.

◆ ConfigClass

lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.ConfigClass = LoadAstrometryNetObjectsConfig
static

Definition at line 61 of file loadAstrometryNetObjects.py.

◆ haveIndexFiles

lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.haveIndexFiles

Definition at line 77 of file loadAstrometryNetObjects.py.

◆ multiInds

lsst.meas.extensions.astrometryNet.loadAstrometryNetObjects.LoadAstrometryNetObjectsTask.multiInds

Definition at line 181 of file loadAstrometryNetObjects.py.


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