|
LSSTApplications
8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
|
Classes | |
| class | _LoadedMIndexes |
Public Member Functions | |
| def | __init__ |
| def | memusage |
| def | setAndConfig |
| def | useKnownWcs |
| def | determineWcs |
| def | determineWcs2 |
| def | getBlindWcsSolution |
| def | getSipWcsFromWcs |
| def | getSipWcsFromCorrespondences |
| def | plotSolution |
| def | getColumnName |
| def | getCatalogFilterName |
| def | getReferenceSourcesForWcs |
| def | getReferenceSources |
| def | joinMatchListWithCatalog |
Public Attributes | |
| config | |
| log | |
| andConfig | |
| multiInds | |
Static Public Attributes | |
| ConfigClass = MeasAstromConfig | |
Private Member Functions | |
| def | _readIndexFiles |
| def | _debug |
| def | _warn |
| def | _getImageParams |
| def | _calculateSipTerms |
| def | _getMatchList |
| def | _solve |
| def | _isGoodSource |
| def | _getIndexPath |
| def | _getMIndexesWithinRange |
| def | _getSolver |
Static Private Member Functions | |
| def | _trimBadPoints |
| def lsst.meas.astrom.astrom.Astrometry.__init__ | ( | self, | |
| config, | |||
andConfig = None, |
|||
log = None, |
|||
logLevel = pexLog.Log.INFO |
|||
| ) |
|
private |
Iteratively calculate SIP distortions and regenerate matchList based on improved WCS. origWcs: original WCS object, probably (but not necessarily) a TAN WCS; this is used to set the baseline when determining whether a SIP solution is any better; it will be returned if no better SIP solution can be found. matchList: list of supposedly matched sources, using the "origWcs". cat: reference source catalog sources: sources in the image to be solved imageSize, x0, y0: these determine the bounding-box of the image, which is used when finding reverse SIP coefficients.
Definition at line 608 of file astrom.py.
|
private |
|
private |
|
private |
|
private |
|
private |
ra,dec,radius: [deg], spatial cut based on the healpix of the index Returns list of multiindex objects within range.
Definition at line 1016 of file astrom.py.
|
private |
|
private |
|
private |
|
private |
Definition at line 891 of file astrom.py.
|
staticprivate |
Remove elements from catalog whose xy positions are not within the given bbox.
sources: a Catalog of SimpleRecord or SourceRecord objects
bbox: an afwImage.Box2D
wcs: if not None, will be used to compute the xy positions on-the-fly;
this is required when sources actually contains SimpleRecords.
Returns:
a list of Source objects with xAstrom,yAstrom within the bbox.
Definition at line 1037 of file astrom.py.
|
private |
| def lsst.meas.astrom.astrom.Astrometry.determineWcs | ( | self, | |
| sources, | |||
| exposure, | |||
| kwargs | |||
| ) |
Finds a WCS solution for the given 'sources' in the given
'exposure', getting other parameters from config.
Valid kwargs include:
'radecCenter', an afw.coord.Coord giving the 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': afwGeom.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.
'imageSize', a tuple (W,H) of integers, the image size.
Defaults to the exposure.get{Width,Height}() values.
Definition at line 346 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.determineWcs2 | ( | self, | |
| sources, | |||
| kwargs | |||
| ) |
Get a blind astrometric solution for the given list 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: afwGeom::Angle per pixel.
radecCenter: afwCoord::Coord
Definition at line 407 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.getBlindWcsSolution | ( | self, | |
| sources, | |||
exposure = None, |
|||
wcs = None, |
|||
imageSize = None, |
|||
x0 = None, |
|||
y0 = None, |
|||
radecCenter = None, |
|||
searchRadius = None, |
|||
pixelScale = None, |
|||
filterName = None, |
|||
doTrim = False, |
|||
usePixelScale = True, |
|||
useRaDecCenter = True, |
|||
useParity = True, |
|||
searchRadiusScale = 2. |
|||
| ) |
| def lsst.meas.astrom.astrom.Astrometry.getCatalogFilterName | ( | self, | |
| filterName | |||
| ) |
Deprecated method for retrieving the magnitude column name from the filter name
Definition at line 791 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.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
| def lsst.meas.astrom.astrom.Astrometry.getReferenceSources | ( | self, | |
| ra, | |||
| dec, | |||
| radius, | |||
| filterName | |||
| ) |
Searches for reference-catalog sources (in the astrometry_net_data files) in the requested RA,Dec region (afwGeom::Angle objects), with the requested radius (also an Angle). The flux values will be set based on the requested filter (None => default filter). Returns: an lsst.afw.table.SimpleCatalog of reference objects
Definition at line 816 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.getReferenceSourcesForWcs | ( | self, | |
| wcs, | |||
| imageSize, | |||
| filterName, | |||
pixelMargin = 50, |
|||
x0 = 0, |
|||
y0 = 0, |
|||
trim = True |
|||
| ) |
Definition at line 796 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.getSipWcsFromCorrespondences | ( | self, | |
| origWcs, | |||
| cat, | |||
| sources, | |||
| imageSize, | |||
x0 = 0, |
|||
y0 = 0 |
|||
| ) |
Produces 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 "cat" and "sources" are assumed to be the same length;
entries "cat[i]" and "sources[i]" are assumed to be correspondences.
origWcs: the WCS to linearize in order to get the TAN part of the
TAN-SIP WCS.
cat: reference source catalog
sources: image sources
imageSize, x0, y0: these describe the bounding-box of the image,
which is used when computing reverse SIP polynomials.
Definition at line 577 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.getSipWcsFromWcs | ( | self, | |
| wcs, | |||
| imageSize, | |||
x0 = 0, |
|||
y0 = 0, |
|||
ngrid = 20, |
|||
linearizeAtCenter = True |
|||
| ) |
This function allows one to 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. linearizeCenter: 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 525 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.joinMatchListWithCatalog | ( | self, | |
| packedMatches, | |||
| sourceCat | |||
| ) |
This function is required to reconstitute a ReferenceMatchVector after being
unpersisted. The persisted form of a ReferenceMatchVector is the
normalized Catalog of IDs produced by afw.table.packMatches(), with the result of
InitialAstrometry.getMatchMetadata() in the associated tables\' metadata.
The "live" form of a matchlist has links to
the real record objects that are matched; it is "denormalized".
This function takes a normalized match catalog, along with the catalog of
sources to which the match catalog refers. It fetches the reference
sources that are within range, and then denormalizes the matches
-- sets the "matchList[*].first" and "matchList[*].second" entries
to point to the sources in the "sources" argument, and to the
reference sources fetched from the astrometry_net_data files.
@param[in] packedMatches Unpersisted match list (an lsst.afw.table.BaseCatalog).
packedMatches.table.getMetadata() must contain the
values from InitialAstrometry.getMatchMetadata()
@param[in,out] sourceCat Source catalog used for the 'second' side of the matches
(an lsst.afw.table.SourceCatalog). As a side effect,
the catalog will be sorted by ID.
@return An lsst.afw.table.ReferenceMatchVector of denormalized matches.
Definition at line 1055 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.memusage | ( | self, | |
prefix = '' |
|||
| ) |
| def lsst.meas.astrom.astrom.Astrometry.plotSolution | ( | self, | |
| matchList, | |||
| wcs, | |||
| imageSize | |||
| ) |
Plot the solution, when debugging is turned on. @param matchList The list of matches @param wcs The Wcs @param imageSize 2-tuple with the image size (W,H)
Definition at line 666 of file astrom.py.
| def lsst.meas.astrom.astrom.Astrometry.setAndConfig | ( | self, | |
| andconfig | |||
| ) |
| def lsst.meas.astrom.astrom.Astrometry.useKnownWcs | ( | self, | |
| sources, | |||
wcs = None, |
|||
exposure = None, |
|||
filterName = None, |
|||
imageSize = None, |
|||
x0 = None, |
|||
y0 = None |
|||
| ) |
Returns an InitialAstrometry object, just like determineWcs, but assuming the given input WCS is correct. This is enabled by the pipe_tasks AstrometryConfig 'forceKnownWcs' option. If you are using that option, you probably also want to turn OFF 'calculateSip'. This involves searching for reference sources within the WCS area, and matching them to the given 'sources'. If 'calculateSip' is set, we will try to compute a TAN-SIP distortion correction. sources: list of detected sources in this image. wcs: your known WCS exposure: the exposure holding metadata for this image. filterName: string, filter name, eg "i" x0,y0: image origin / offset; these coordinates along with the "imageSize" determine the bounding-box in pixel coordinates of the image in question; this is used for finding reference sources in the image, among other things. You MUST provide a WCS, either by providing the 'wcs' kwarg (an lsst.image.Wcs object), or by providing the 'exposure' on which we will call 'exposure.getWcs()'. You MUST provide a filter name, either by providing the 'filterName' kwarg (a string), or by setting the 'exposure'; we will call 'exposure.getFilter().getName()'. You MUST provide the image size, either by providing the 'imageSize' kwargs, an (W,H) tuple of ints, or by providing the 'exposure'; we will call 'exposure.getWidth()' and 'exposure.getHeight()'. Note, when modifying this function, that it is also called by 'determineWcs' (via 'determineWcs2'), since the steps are all the same.
Definition at line 247 of file astrom.py.
|
static |
1.8.5