lsst.meas.extensions.astrometryNet  15.0-2-g5dfaa72+8
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__ (self, schema, refObjLoader=None, kwds)
 Create the astrometric calibration task. More...
 
def run (self, exposure, sourceCat)
 Load reference objects, match sources and optionally fit a WCS. More...
 
def solve (self, exposure, sourceCat)
 Match with reference sources and calculate an astrometric solution. More...
 
def distort (self, sourceCat, exposure)
 Calculate distorted source positions. More...
 
def loadAndMatch (self, exposure, sourceCat, bbox=None)
 Load reference objects overlapping an exposure and match to sources detected on that exposure. More...
 
def refitWcs (self, sourceCat, exposure, matches)
 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:

Configuration parameters

See ANetAstrometryConfig

Debug variables

The command line task interface supports a flag -d to import debug.py from your PYTHONPATH; see Using lsstDebug to control debugging output 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

import lsstDebug
def DebugInfo(name):
di = lsstDebug.getInfo(name) # N.b. lsstDebug.Info(name) would call us recursively
if name in ("lsst.pipe.tasks.anetAstrometry", "lsst.pipe.tasks.anetBasicAstrometry"):
di.display = 1
di.frame = 1
di.pause = True
return di
lsstDebug.Info = DebugInfo

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

Definition at line 72 of file anetAstrometry.py.

Constructor & Destructor Documentation

◆ __init__()

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 144 of file anetAstrometry.py.

Member Function Documentation

◆ distort()

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 236 of file anetAstrometry.py.

◆ loadAndMatch()

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:
Note
ignores config.forceKnownWcs

Definition at line 290 of file anetAstrometry.py.

◆ refitWcs()

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 382 of file anetAstrometry.py.

◆ run()

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:

Definition at line 174 of file anetAstrometry.py.

◆ solve()

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:

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 200 of file anetAstrometry.py.

Member Data Documentation

◆ centroidErrKey

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

Definition at line 169 of file anetAstrometry.py.

◆ centroidFlagKey

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

Definition at line 166 of file anetAstrometry.py.

◆ centroidKey

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

Definition at line 168 of file anetAstrometry.py.

◆ centroidXErrKey

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

Definition at line 162 of file anetAstrometry.py.

◆ centroidXKey

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

Definition at line 158 of file anetAstrometry.py.

◆ centroidYErrKey

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

Definition at line 164 of file anetAstrometry.py.

◆ centroidYKey

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

Definition at line 160 of file anetAstrometry.py.

◆ ConfigClass

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

Definition at line 142 of file anetAstrometry.py.

◆ distortedName

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

Definition at line 157 of file anetAstrometry.py.

◆ solver

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

Definition at line 171 of file anetAstrometry.py.


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