lsst.meas.extensions.astrometryNet  master-g43362ee2f3+43
 All Classes Namespaces Files Functions Variables Properties Groups Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask Class Reference

Use astrometry.net to match input sources with a reference catalog and solve for the Wcs. More...

Inheritance diagram for lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask:

Public Member Functions

def __init__
 Create the astrometric calibration task. More...
 
def run
 Load reference objects, match sources and optionally fit a WCS. More...
 
def solve
 Match with reference sources and calculate an astrometric solution. More...
 
def distort
 Calculate distorted source positions. More...
 
def distortionContext
 Context manager that applies and removes distortion. More...
 
def loadAndMatch
 Load reference objects overlapping an exposure and match to sources detected on that exposure. More...
 
def refitWcs
 A final Wcs solution after matching and removing distortion. More...
 

Public Attributes

 distortedName
 
 centroidXKey
 
 centroidYKey
 
 centroidXErrKey
 
 centroidYErrKey
 
 centroidFlagKey
 
 centroidKey
 
 centroidErrKey
 
 solver
 

Static Public Attributes

 ConfigClass = ANetAstrometryConfig
 

Detailed Description

Use astrometry.net to match input sources with a reference catalog and solve for the Wcs.

The actual matching and solving is done by the 'solver'; this Task serves as a wrapper for taking into account the known optical distortion.

Contents

Description

Use astrometry.net to match input sources with a reference catalog and solve for the Wcs.

Task initialisation

Create the astrometric calibration task. Most arguments are simply passed onto pipe.base.Task.

Parameters
schemaAn lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog
refObjLoaderThe AstrometryTask constructor requires a refObjLoader. In order to make this task retargettable for AstrometryTask it needs to take the same arguments. This argument will be ignored since it uses its own internal loader.
**kwdskeyword arguments to be passed to the lsst.pipe.base.task.Task constructor

A centroid field "centroid.distorted" (used internally during the Task's operation) will be added to the schema.

Invoking the Task

Load reference objects, match sources and optionally fit a WCS. This is a thin layer around solve or loadAndMatch, depending on config.forceKnownWcs

Parameters
[in,out]exposureexposure whose WCS is to be fit The following are read only:
  • bbox
  • calib (may be absent)
  • filter (may be unset)
  • detector (if wcs is pure tangent; may be absent) The following are updated:
  • wcs (the initial value is used as an initial guess, and is required)
[in]sourceCatcatalog of sourceCat detected on the exposure (an lsst.afw.table.SourceCatalog)
Returns
an lsst.pipe.base.Struct with these fields:
  • refCat reference object catalog of objects that overlap the exposure (with some margin) (an lsst::afw::table::SimpleCatalog)
  • matches astrometric matches, a list of lsst.afw.table.ReferenceMatch
  • matchMeta metadata about the field (an lsst.daf.base.PropertyList)

Configuration parameters

See ANetAstrometryConfig

Debug variables

The command line task interface supports a flag -d to import debug.py from your PYTHONPATH; see baseDebug for more about debug.py files.

The available variables in ANetAstrometryTask are:

display
If True call showAstrometry while iterating ANetAstrometryConfig.rejectIter times, and also after converging; and call displayAstrometry after applying the distortion correction.
frame
ds9 frame to use in showAstrometry and displayAstrometry
pause
Pause after showAstrometry and displayAstrometry?

A complete example of using ANetAstrometryTask

See pipe_tasks_photocal_Example.

To investigate the Debug variables, put something like

1 import lsstDebug
2 def DebugInfo(name):
3  di = lsstDebug.getInfo(name) # N.b. lsstDebug.Info(name) would call us recursively
4  if name in ("lsst.pipe.tasks.anetAstrometry", "lsst.pipe.tasks.anetBasicAstrometry"):
5  di.display = 1
6  di.frame = 1
7  di.pause = True
8 
9  return di
10 
11 lsstDebug.Info = DebugInfo

into your debug.py file and run photoCalTask.py with the –debug flag.

Definition at line 73 of file anetAstrometry.py.

Constructor & Destructor Documentation

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.__init__ (   self,
  schema,
  refObjLoader = None,
  kwds 
)

Create the astrometric calibration task.

Most arguments are simply passed onto pipe.base.Task.

Parameters
schemaAn lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog
refObjLoaderThe AstrometryTask constructor requires a refObjLoader. In order to make this task retargettable for AstrometryTask it needs to take the same arguments. This argument will be ignored since it uses its own internal loader.
**kwdskeyword arguments to be passed to the lsst.pipe.base.task.Task constructor

A centroid field "centroid.distorted" (used internally during the Task's operation) will be added to the schema.

Definition at line 145 of file anetAstrometry.py.

Member Function Documentation

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.distort (   self,
  sourceCat,
  exposure 
)

Calculate distorted source positions.

CCD images are often affected by optical distortion that makes the astrometric solution higher order than linear. Unfortunately, most (all?) matching algorithms require that the distortion be small or zero, and so it must be removed. We do this by calculating (un-)distorted positions, based on a known optical distortion model in the Ccd.

The distortion correction moves sources, so we return the distorted bounding box.

Parameters
[in]exposureExposure to process
[in,out]sourceCatSourceCatalog; getX() and getY() will be used as inputs, with distorted points in "centroid.distorted" field.
Returns
bounding box of distorted exposure

Definition at line 237 of file anetAstrometry.py.

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.distortionContext (   self,
  sourceCat,
  exposure 
)

Context manager that applies and removes distortion.

We move the "centroid" definition in the catalog table to point to the distorted positions. This is undone on exit from the context.

The input Wcs is taken to refer to the coordinate system with the distortion correction applied, and hence no shift is required when the sources are distorted. However, after Wcs fitting, the Wcs is in the distorted frame so when the distortion correction is removed, the Wcs needs to be shifted to compensate.

Parameters
sourceCatSources on exposure, an lsst.afw.table.SourceCatalog
exposureExposure holding Wcs, an lsst.afw.image.ExposureF or D
Returns
bounding box of distorted exposure

Definition at line 292 of file anetAstrometry.py.

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.loadAndMatch (   self,
  exposure,
  sourceCat,
  bbox = None 
)

Load reference objects overlapping an exposure and match to sources detected on that exposure.

Parameters
[in]exposureexposure whose WCS is to be fit
[in]sourceCatcatalog of sourceCat detected on the exposure (an lsst.afw.table.SourceCatalog)
[in]bboxbounding box go use for finding reference objects; if None, use exposure's bbox
Returns
an lsst.pipe.base.Struct with these fields:
  • refCat reference object catalog of objects that overlap the exposure (with some margin) (an lsst::afw::table::SimpleCatalog)
  • matches astrometric matches, a list of lsst.afw.table.ReferenceMatch
  • matchMeta metadata about the field (an lsst.daf.base.PropertyList)
Note
ignores config.forceKnownWcs

Definition at line 328 of file anetAstrometry.py.

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.refitWcs (   self,
  sourceCat,
  exposure,
  matches 
)

A final Wcs solution after matching and removing distortion.

Specifically, fitting the non-linear part, since the linear part has been provided by the matching engine.

Parameters
sourceCatSources on exposure, an lsst.afw.table.SourceCatalog
exposureExposure of interest, an lsst.afw.image.ExposureF or D
matchesAstrometric matches, as a list of lsst.afw.table.ReferenceMatch
Returns
the resolved-Wcs object, or None if config.solver.calculateSip is False.

Definition at line 420 of file anetAstrometry.py.

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.run (   self,
  exposure,
  sourceCat 
)

Load reference objects, match sources and optionally fit a WCS.

This is a thin layer around solve or loadAndMatch, depending on config.forceKnownWcs

Parameters
[in,out]exposureexposure whose WCS is to be fit The following are read only:
  • bbox
  • calib (may be absent)
  • filter (may be unset)
  • detector (if wcs is pure tangent; may be absent) The following are updated:
  • wcs (the initial value is used as an initial guess, and is required)
[in]sourceCatcatalog of sourceCat detected on the exposure (an lsst.afw.table.SourceCatalog)
Returns
an lsst.pipe.base.Struct with these fields:
  • refCat reference object catalog of objects that overlap the exposure (with some margin) (an lsst::afw::table::SimpleCatalog)
  • matches astrometric matches, a list of lsst.afw.table.ReferenceMatch
  • matchMeta metadata about the field (an lsst.daf.base.PropertyList)

Definition at line 175 of file anetAstrometry.py.

def lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.solve (   self,
  exposure,
  sourceCat 
)

Match with reference sources and calculate an astrometric solution.

Parameters
[in,out]exposureExposure to calibrate; wcs is updated
[in]sourceCatcatalog of measured sources (an lsst.afw.table.SourceCatalog)
Returns
a pipeBase.Struct with fields:
  • refCat reference object catalog of objects that overlap the exposure (with some margin) (an lsst::afw::table::SimpleCatalog)
  • matches astrometric matches, a list of lsst.afw.table.ReferenceMatch
  • matchMeta metadata about the field (an lsst.daf.base.PropertyList)

The reference catalog actually used is up to the implementation of the solver; it will be manifested in the returned matches as a list of lsst.afw.table.ReferenceMatch objects (i.e. of lsst.afw.table.Match with first being of type lsst.afw.table.SimpleRecord and second type lsst.afw.table.SourceRecord — the reference object and matched object respectively).

Note
The input sources have the centroid slot moved to a new column "centroid.distorted" which has the positions corrected for any known optical distortion; the 'solver' (which is instantiated in the 'astrometry' member) should therefore simply use the centroids provided by calling afw.table.Source.getCentroid() on the individual source records. This column must be present in the sources table.
ignores config.forceKnownWcs

Definition at line 201 of file anetAstrometry.py.

Member Data Documentation

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidErrKey

Definition at line 170 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidFlagKey

Definition at line 167 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidKey

Definition at line 169 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidXErrKey

Definition at line 163 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidXKey

Definition at line 159 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidYErrKey

Definition at line 165 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.centroidYKey

Definition at line 161 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.ConfigClass = ANetAstrometryConfig
static

Definition at line 143 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.distortedName

Definition at line 158 of file anetAstrometry.py.

lsst.meas.extensions.astrometryNet.anetAstrometry.ANetAstrometryTask.solver

Definition at line 172 of file anetAstrometry.py.


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