Coverage for python/lsst/pipe/tasks/registerImage.py : 92%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2008-2013 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
This module contains a Task to register (align) multiple images. """
"""Configuration for RegisterTask"""
""" Task to register (align) multiple images.
The 'run' method provides a revised Wcs from matches and fitting sources. Additional methods are provided as a convenience to warp an exposure ('warpExposure') and sources ('warpSources') with the new Wcs. """
"""Register (align) an input exposure to the template
The sources must have RA,Dec set, and accurate to within the 'matchRadius' of the configuration in order to facilitate source matching. We fit a new Wcs, but do NOT set it in the input exposure.
@param inputSources: Sources from input exposure @param inputWcs: Wcs of input exposure @param inputBBox: Bounding box of input exposure @param templateSources: Sources from template exposure @return Struct(matches: Matches between sources, wcs: Wcs for input in frame of template, ) """
"""Match sources between the input and template
The order of the input arguments matters (because the later Wcs fitting assumes a particular order).
@param inputSources: Source catalog of the input frame @param templateSources: Source of the target frame @return Match list """ self.config.matchRadius*afwGeom.arcseconds) raise RuntimeError("Unable to match source catalogs")
"""Fit Wcs to matches
The fitting includes iterative sigma-clipping.
@param matches: List of matches (first is target, second is input) @param inputWcs: Original input Wcs @param inputBBox: Bounding box of input image @return Wcs """ i, sipFit.getScatterInPixels()) wcs.pixelToSky(m.second.get(inCentroidKey))).asArcseconds() for m in copyMatches]
(sipFit.getScatterInPixels(), len(copyMatches)))
"""Warp input exposure to template frame
There are a variety of data attached to the exposure (e.g., PSF, Calib and other metadata), but we do not attempt to warp these to the template frame.
@param inputExp: Input exposure, to be warped @param newWcs: Revised Wcs for input exposure @param templateWcs: Target Wcs @param templateBBox: Target bounding box @return Warped exposure """
"""Warp sources to the new frame
It would be difficult to transform all possible quantities of potential interest between the two frames. We therefore update only the sky and pixel coordinates.
@param inputSources: Sources on input exposure, to be warped @param newWcs: Revised Wcs for input exposure @param templateWcs: Target Wcs @param templateBBox: Target bounding box @return Warped sources """ # There is no method Box2I::contains(Point2D) deleteList.append(i) continue
del alignedSources[i]
|