|
lsst.afw gf03f0b42f3+e27ba6bf39
|
A fitter and results class for approximating a general Transform in a form compatible with FITS WCS persistence. More...
#include <SipApproximation.h>
Classes | |
| struct | FitGrid |
| struct | Solution |
| struct | ValidationGrid |
Public Member Functions | |
| SipApproximation (SkyWcs const &target, lsst::geom::Box2D const &bbox, lsst::geom::Extent2I const &gridShape, int order=5, std::optional< lsst::geom::Point2D > const &pixelOrigin=std::nullopt, double svdThreshold=-1) | |
| Construct a new approximation by fitting on a grid of points. | |
| SipApproximation (SipApproximation const &)=delete | |
| SipApproximation & | operator= (SipApproximation const &)=delete |
| SipApproximation (SipApproximation &&) noexcept=default | |
| SipApproximation & | operator= (SipApproximation &&) noexcept=default |
| ~SipApproximation () noexcept | |
| int | getOrder () const noexcept |
| Return the polynomial order of the current solution (same for forward and reverse). | |
| double | getA (int p, int q) const |
| Return a coefficient of the forward transform polynomial. | |
| double | getB (int p, int q) const |
| Return a coefficient of the forward transform polynomial. | |
| Eigen::MatrixXd | getA () const |
| Return the coefficients of the forward transform polynomial. | |
| Eigen::MatrixXd | getB () const |
| Return the coefficients of the forward transform polynomial. | |
| lsst::geom::Box2D | getBBox () const noexcept |
| Return the pixel-coordinate bounding box over which the approximation should be valid. | |
| lsst::geom::SpherePoint | getSkyOrigin () const noexcept |
| Return the sky-coordinate origin of the WCS. | |
| lsst::geom::Point2D | getPixelOrigin () const noexcept |
| Return the pixel origin of the WCS. | |
| Eigen::Matrix2d | getCdMatrix () const noexcept |
| Return the CD matrix of the WCS (in degrees). | |
| std::shared_ptr< SkyWcs > | getWcs () const noexcept |
| Return a TAN-SIP WCS object that evaluates the approximation. | |
| std::pair< lsst::geom::Angle, double > | computeDeltas () const |
| Return the maximum deviations of the solution from the exact transform on a grid offset from the one used in the fit. | |
A fitter and results class for approximating a general Transform in a form compatible with FITS WCS persistence.
The Simple Imaging Polynomial (SIP) convention (Shupe et al 2005) adds forward and reverse polynomial mappings to a standard projection FITS WCS projection (e.g. "TAN" for gnomonic) that relate Intermediate World Coordinates (see Calabretta & Greisen 2002) to image pixel coordinates. The SIP "forward" transform is defined by polynomial coefficients \(A\) and \(B\) that map pixel coordinates \((u, v)\) to Intermediate World Coordinates \((x, y)\) via
\[ \boldsymbol{S}\left[\begin{array}{c} x \\ y \end{array}\right] \equiv \left[\begin{array}{c} x_s \\ y_s \end{array}\right] = \left[\begin{array}{c} (u - u_0) + \displaystyle\sum_{p,q}^{0 \le p + q \le N} \mathrm{A}_{p,q} (u - u_0)^p (v - v_0)^q \\ (v - v_0) + \displaystyle\sum_{p,q}^{0 \le p + q \le N} \mathrm{B}_{p,q} (u - u_0)^p (v - v_0)^q \end{array}\right] \]
The reverse transform has essentially the same form:
\[ \left[\begin{array}{c} u - u_0 \\ v - v_0 \end{array}\right] = \left[\begin{array}{c} x_s + \displaystyle\sum_{p,q}^{0 \le p + q \le N} \mathrm{AP}_{p,q} x_s^p y_s^q \\ y_s + \displaystyle\sum_{p,q}^{0 \le p + q \le N} \mathrm{BP}_{p,q} x_s^p y_s^q \end{array}\right] \]
In both cases, \((u_0, v_0)\) is the pixel origin (CRPIX in FITS WCS) and \(\boldsymbol{S}\) is the inverse of the Jacobian "CD" matrix.
dpix (for "pixel delta"), and \((x_s, y_s)\) as iwc (for intermediate world coordinates").While LSST WCSs are in general too complex to be described exactly in FITS WCS, they can generally be closely approximated by standard FITS WCS projection with additional SIP distortions. This class fits such an approximation.
Definition at line 89 of file SipApproximation.h.
| lsst::afw::geom::SipApproximation::SipApproximation | ( | SkyWcs const & | target, |
| lsst::geom::Box2D const & | bbox, | ||
| lsst::geom::Extent2I const & | gridShape, | ||
| int | order = 5, | ||
| std::optional< lsst::geom::Point2D > const & | pixelOrigin = std::nullopt, | ||
| double | svdThreshold = -1 ) |
Construct a new approximation by fitting on a grid of points.
| [in] | target | The true WCS to approximate. |
| [in] | bbox | Pixel-coordinate bounding box over which the approximation should be valid. Used to construct the grid of points to fit. |
| [in] | gridShape | Number of points in x and y for the grid of points. |
| [in] | order | Order of the polynomial (same for forward and reverse transforms). |
| [in] | pixelOrigin | Pixel reference point. If not provided, the center of bbox is used. Must lie within bbox. Note that this is 0-indexed, and is hence one less than the FITS CRPIX value. |
| [in] | svdThreshold | Fraction of the largest singular value at which to declare smaller singular values zero in the least squares solution. Negative values use Eigen's internal default. |
| lsst::pex::exceptions::InvalidParameterError | Thrown if order is negative or gridShape is non-positive. |
Definition at line 244 of file SipApproximation.cc.
|
delete |
|
defaultnoexcept |
|
defaultnoexcept |
| std::pair< lsst::geom::Angle, double > lsst::afw::geom::SipApproximation::computeDeltas | ( | ) | const |
Return the maximum deviations of the solution from the exact transform on a grid offset from the one used in the fit.
The returned quantities are the maxima of:
at all pixel points p and sky points s on the offset grid.
Definition at line 329 of file SipApproximation.cc.
| Eigen::MatrixXd lsst::afw::geom::SipApproximation::getA | ( | ) | const |
Return the coefficients of the forward transform polynomial.
Definition at line 307 of file SipApproximation.cc.
| double lsst::afw::geom::SipApproximation::getA | ( | int | p, |
| int | q ) const |
Return a coefficient of the forward transform polynomial.
Out-of-bounds arguments yields undefined behavior.
Definition at line 284 of file SipApproximation.cc.
| Eigen::MatrixXd lsst::afw::geom::SipApproximation::getB | ( | ) | const |
Return the coefficients of the forward transform polynomial.
Definition at line 314 of file SipApproximation.cc.
| double lsst::afw::geom::SipApproximation::getB | ( | int | p, |
| int | q ) const |
Return a coefficient of the forward transform polynomial.
Out-of-bounds arguments yields undefined behavior.
Definition at line 288 of file SipApproximation.cc.
|
inlinenoexcept |
Return the pixel-coordinate bounding box over which the approximation should be valid.
Definition at line 165 of file SipApproximation.h.
|
noexcept |
Return the CD matrix of the WCS (in degrees).
Definition at line 321 of file SipApproximation.cc.
|
noexcept |
Return the polynomial order of the current solution (same for forward and reverse).
Definition at line 280 of file SipApproximation.cc.
|
inlinenoexcept |
Return the pixel origin of the WCS.
Definition at line 171 of file SipApproximation.h.
|
inlinenoexcept |
Return the sky-coordinate origin of the WCS.
Definition at line 168 of file SipApproximation.h.
|
noexcept |
Return a TAN-SIP WCS object that evaluates the approximation.
Definition at line 325 of file SipApproximation.cc.
|
defaultnoexcept |
|
delete |