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
|
Basic implemeentation of the astrometry.net astrometrical fitter. More...
Public Member Functions | |
def | __init__ (self, config, andConfig=None, kwargs) |
Construct an ANetBasicAstrometryTask. More... | |
def | memusage (self, prefix='') |
def | useKnownWcs (self, sourceCat, wcs=None, exposure=None, filterName=None, bbox=None, calculateSip=None) |
Return an InitialAstrometry object, just like determineWcs, but assuming the given input WCS is correct. More... | |
def | determineWcs (self, sourceCat, exposure, kwargs) |
def | determineWcs2 (self, sourceCat, kwargs) |
def | getBlindWcsSolution (self, sourceCat, exposure=None, wcs=None, bbox=None, radecCenter=None, searchRadius=None, pixelScale=None, filterName=None, doTrim=False, usePixelScale=True, useRaDecCenter=True, useParity=True, searchRadiusScale=2.) |
def | getSipWcsFromWcs (self, wcs, bbox, ngrid=20, linearizeAtCenter=True) |
Get a TAN-SIP WCS, starting from an existing WCS. More... | |
def | getSipWcsFromCorrespondences (self, origWcs, refCat, sourceCat, bbox) |
def | plotSolution (self, matches, wcs, imageSize) |
def | getColumnName (self, filterName, columnMap, default=None) |
Public Attributes | |
config | |
refObjLoader | |
Static Public Attributes | |
ConfigClass = ANetBasicAstrometryConfig | |
Basic implemeentation of the astrometry.net astrometrical fitter.
A higher-level class ANetAstrometryTask takes care of dealing with the fact that the initial WCS is probably only a pure TAN SIP, yet we may have significant distortion and a good estimate for that distortion.
About Astrometry.net index files (astrometry_net_data):
There are three components of an index file: a list of stars (stored as a star kd-tree), a list of quadrangles of stars ("quad file") and a list of the shapes ("codes") of those quadrangles, stored as a code kd-tree.
Each index covers a region of the sky, defined by healpix nside and number, and a range of angular scales. In LSST, we share the list of stars in a part of the sky between multiple indexes. That is, the star kd-tree is shared between multiple indices (quads and code kd-trees). In the astrometry.net code, this is called a "multiindex".
It is possible to "unload" and "reload" multiindex (and index) objects. When "unloaded", they consume no FILE or mmap resources.
The multiindex object holds the star kd-tree and gives each index object it holds a pointer to it, so it is necessary to multiindex_reload_starkd() before reloading the indices it holds. The multiindex_unload() method, on the other hand, unloads its starkd and unloads each index it holds.
Definition at line 216 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.__init__ | ( | self, | |
config, | |||
andConfig = None , |
|||
kwargs | |||
) |
Construct an ANetBasicAstrometryTask.
[in] | config | configuration (an instance of self.ConfigClass) |
[in] | andConfig | astrometry.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] | kwargs | additional keyword arguments for pipe_base Task.__init__ |
RuntimeError | if 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 253 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.determineWcs | ( | self, | |
sourceCat, | |||
exposure, | |||
kwargs | |||
) |
Find a WCS solution for the given 'sourceCat' in the given 'exposure', getting other parameters from config. Valid kwargs include: 'radecCenter', an afw.geom.SpherePoint giving the ICRS RA,Dec position of the center of the field. This is used to limit the search done by Astrometry.net (to make it faster and load fewer index files, thereby using less memory). Defaults to the RA,Dec center from the exposure's WCS; turn that off with the boolean kwarg 'useRaDecCenter' or config option 'useWcsRaDecCenter' 'useRaDecCenter', a boolean. Don't use the RA,Dec center from the exposure's initial WCS. 'searchRadius', in degrees, to search for a solution around the given 'radecCenter'; default from config option 'raDecSearchRadius'. 'useParity': parity is the 'flip' of the image. Knowing it reduces the search space (hence time) for Astrometry.net. The parity can be computed from the exposure's WCS (the sign of the determinant of the CD matrix); this option controls whether we do that or force Astrometry.net to search both parities. Default from config.useWcsParity. 'pixelScale': geom.Angle, estimate of the angle-per-pixel (ie, arcseconds per pixel). Defaults to a value derived from the exposure's WCS. If enabled, this value, plus or minus config.pixelScaleUncertainty, will be used to limit Astrometry.net's search. 'usePixelScale': boolean. Use the pixel scale to limit Astrometry.net's search? Defaults to config.useWcsPixelScale. 'filterName', a string, the filter name of this image. Will be mapped through the 'filterMap' config dictionary to a column name in the astrometry_net_data index FITS files. Defaults to the exposure.getFilter() value. 'bbox', bounding box of exposure; defaults to exposure.getBBox()
Definition at line 403 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.determineWcs2 | ( | self, | |
sourceCat, | |||
kwargs | |||
) |
Get a blind astrometric solution for the given catalog of sources. We need: -the image size; -the filter And if available, we can use: -an initial Wcs estimate; --> RA,Dec center --> pixel scale --> "parity" (all of which are metadata of Exposure). filterName: string imageSize: (W,H) integer tuple/iterable pixelScale: lsst.geom.Angle per pixel. radecCenter: lsst.afw.coord.Coord
Definition at line 462 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.getBlindWcsSolution | ( | self, | |
sourceCat, | |||
exposure = None , |
|||
wcs = None , |
|||
bbox = None , |
|||
radecCenter = None , |
|||
searchRadius = None , |
|||
pixelScale = None , |
|||
filterName = None , |
|||
doTrim = False , |
|||
usePixelScale = True , |
|||
useRaDecCenter = True , |
|||
useParity = True , |
|||
searchRadiusScale = 2. |
|||
) |
Definition at line 505 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.getColumnName | ( | self, | |
filterName, | |||
columnMap, | |||
default = None |
|||
) |
Returns the column name in the astrometry_net_data index file that will be used for the given filter name. @param filterName Name of filter used in exposure @param columnMap Dict that maps filter names to column names @param default Default column name
Definition at line 844 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.getSipWcsFromCorrespondences | ( | self, | |
origWcs, | |||
refCat, | |||
sourceCat, | |||
bbox | |||
) |
Produce a SIP solution given a list of known correspondences. Unlike _calculateSipTerms, this does not iterate the solution; it assumes you have given it a good sets of corresponding stars. NOTE that "refCat" and "sourceCat" are assumed to be the same length; entries "refCat[i]" and "sourceCat[i]" are assumed to be correspondences. @param[in] origWcs the WCS to linearize in order to get the TAN part of the TAN-SIP WCS. @param[in] refCat reference source catalog @param[in] sourceCat source catalog @param[in] bbox bounding box of image
Definition at line 629 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.getSipWcsFromWcs | ( | self, | |
wcs, | |||
bbox, | |||
ngrid = 20 , |
|||
linearizeAtCenter = True |
|||
) |
Get a TAN-SIP WCS, starting from an existing WCS.
It uses your WCS to compute a fake grid of corresponding "stars" in pixel and sky coords, and feeds that to the regular SIP code.
[in] | wcs | initial WCS |
[in] | bbox | bounding box of image |
[in] | ngrid | number of grid points along x and y for fitting (fit at ngrid^2 points) |
[in] | linearizeAtCenter | if True, get a linear approximation of the input WCS at the image center and use that as the TAN initialization for the TAN-SIP solution. You probably want this if your WCS has its CRPIX outside the image bounding box. |
Definition at line 578 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.memusage | ( | self, | |
prefix = '' |
|||
) |
Definition at line 276 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.plotSolution | ( | self, | |
matches, | |||
wcs, | |||
imageSize | |||
) |
Plot the solution, when debugging is turned on. @param matches The list of matches @param wcs The Wcs @param imageSize 2-tuple with the image size (W,H)
Definition at line 712 of file anetBasicAstrometry.py.
def lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.useKnownWcs | ( | self, | |
sourceCat, | |||
wcs = None , |
|||
exposure = None , |
|||
filterName = None , |
|||
bbox = None , |
|||
calculateSip = None |
|||
) |
Return an InitialAstrometry object, just like determineWcs, but assuming the given input WCS is correct.
This involves searching for reference sources within the WCS area, and matching them to the given 'sourceCat'. If 'calculateSip' is set, we will try to compute a TAN-SIP distortion correction.
[in] | sourceCat | list of detected sources in this image. |
[in] | wcs | your known WCS, or None to get from exposure |
[in] | exposure | the exposure holding metadata for this image; if None then you must specify wcs, filterName and bbox |
[in] | filterName | string, filter name, eg "i", or None to get from exposure` |
[in] | bbox | bounding box of image, or None to get from exposure |
[in] | calculateSip | calculate SIP distortion terms for the WCS? If None then use self.config.calculateSip. To disable WCS fitting set calculateSip=False |
Definition at line 323 of file anetBasicAstrometry.py.
lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.config |
Definition at line 266 of file anetBasicAstrometry.py.
|
static |
Definition at line 247 of file anetBasicAstrometry.py.
lsst.meas.extensions.astrometryNet.anetBasicAstrometry.ANetBasicAstrometryTask.refObjLoader |
Definition at line 268 of file anetBasicAstrometry.py.