26 const bool noLowOrderSipTerms) {
37 linPart.
invert().
apply(0., 0., crpix_lsst[0], crpix_lsst[1]);
42 if (noLowOrderSipTerms) {
43 Point ctmp =
Point(crpix_lsst[0], crpix_lsst[1]);
48 r->apply(0, 0, crpix_lsst[0], crpix_lsst[1]);
61 Eigen::Matrix2d cdMat;
62 cdMat(0, 0) = linPart.
coeff(1, 0, 0);
63 cdMat(0, 1) = linPart.
coeff(0, 1, 0);
64 cdMat(1, 0) = linPart.
coeff(1, 0, 1);
65 cdMat(1, 1) = linPart.
coeff(0, 1, 1);
94 "GtransfoToSip: could not invert the input wcs ");
101 Eigen::MatrixXd sipA(Eigen::MatrixXd::Zero(sipOrder + 1, sipOrder + 1));
102 Eigen::MatrixXd sipB(Eigen::MatrixXd::Zero(sipOrder + 1, sipOrder + 1));
103 for (
int i = 0; i <= sipOrder; ++i) {
104 for (
int j = 0; j <= sipOrder - i; ++j) {
105 sipA(i, j) = sipPoly.
coeff(i, j, 0);
106 sipB(i, j) = sipPoly.
coeff(i, j, 1);
112 Eigen::MatrixXd sipAp(Eigen::MatrixXd::Zero(sipOrder + 1, sipOrder + 1));
113 Eigen::MatrixXd sipBp(Eigen::MatrixXd::Zero(sipOrder + 1, sipOrder + 1));
114 for (
int i = 0; i <= sipOrder; ++i) {
115 for (
int j = 0; j <= sipOrder - i; ++j) {
116 sipAp(i, j) = sipPolyInv.
coeff(i, j, 0);
117 sipBp(i, j) = sipPolyInv.
coeff(i, j, 1);
Implements the (forward) SIP distorsion scheme.
implements the linear transformations (6 real coefficients).
Point in an unspecified spherical coordinate system.
void apply(const double xIn, const double yIn, double &xOut, double &yOut) const
GtransfoLin invert() const
returns the inverse: T1 = T2.invert();
AngleUnit constexpr degrees
constant with units of degrees
table::PointKey< double > crval
Polynomial transformation class.
std::shared_ptr< lsst::afw::geom::SkyWcs > gtransfoToTanWcs(const lsst::jointcal::TanSipPix2RaDec wcsTransfo, const lsst::jointcal::Frame &ccdFrame, const bool noLowOrderSipTerms=false)
Transform the other way around.
GtransfoPoly getPix2TangentPlane() const
the transformation from pixels to tangent plane (degrees)
std::unique_ptr< GtransfoPoly > inversePolyTransfo(const Gtransfo &Direct, const Frame &frame, const double Prec)
approximates the inverse by a polynomial, up to required precision.
rectangle with sides parallel to axes.
A base class for image defects.
GtransfoLin getLinPart() const
The Linear part (corresponding to CD's and CRPIX's)
const GtransfoPoly * getCorr() const
Get a non-owning pointer to the correction transform polynomial.
unsigned getDegree() const
returns degree
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
virtual GtransfoLin linearApproximation(const Point &where, const double step=0.01) const
linear (local) approximation.
just here to provide a specialized constructor, and fit.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
Point getTangentPoint() const
Get the sky origin (CRVAL in FITS WCS terminology) in degrees.
double coeff(const unsigned powX, const unsigned powY, const unsigned whichCoord) const
access to coefficients (read only)
std::shared_ptr< jointcal::GtransfoPoly > GtPoly_Ptr
virtual std::unique_ptr< Gtransfo > inverseTransfo(const double precision, const Frame ®ion) const
returns an inverse transfo. Numerical if not overloaded.
std::shared_ptr< SkyWcs > makeTanSipWcs(Point2D const &crpix, SpherePoint const &crval, Eigen::Matrix2d const &cdMatrix, Eigen::MatrixXd const &sipA, Eigen::MatrixXd const &sipB)
Construct a TAN-SIP SkyWcs with forward SIP distortion terms and an iterative inverse.