31 namespace lsst {
namespace meas {
namespace astrom {
48 forwardSipPoly._xCoeffs(1, 0) -= 1;
49 forwardSipPoly._yCoeffs(0, 1) -= 1;
67 forwardSipPoly._xCoeffs(1, 0) -= 1;
68 forwardSipPoly._yCoeffs(0, 1) -= 1;
75 return convert(scaled, pixelOrigin, cdMatrix);
104 reverseSipPoly._xCoeffs(1, 0) -= 1;
105 reverseSipPoly._yCoeffs(0, 1) -= 1;
124 reverseSipPoly._xCoeffs(1, 0) -= 1;
125 reverseSipPoly._yCoeffs(0, 1) -= 1;
152 afw::coord::
Coord const & skyOrigin
154 if (!sipForward.getPixelOrigin().asEigen().isApprox(sipReverse.getPixelOrigin().asEigen())) {
155 std::ostringstream oss;
156 oss <<
"SIP forward and reverse transforms have inconsistent CRPIX: "
157 << sipForward.getPixelOrigin() <<
" != " << sipReverse.getPixelOrigin();
159 pex::exceptions::InvalidParameterError,
163 if (!sipForward.getCDMatrix().getMatrix().isApprox(sipReverse.getCDMatrix().getMatrix())) {
164 std::ostringstream oss;
165 oss <<
"SIP forward and reverse transforms have inconsistent CD matrix: "
166 << sipForward.getCDMatrix() <<
"\n!=\n" << sipReverse.getCDMatrix();
168 pex::exceptions::InvalidParameterError,
172 Eigen::MatrixXd sipA(sipForward.getPoly().getXCoeffs().asEigen());
173 Eigen::MatrixXd sipB(sipForward.getPoly().getYCoeffs().asEigen());
174 Eigen::MatrixXd sipAP(sipReverse.getPoly().getXCoeffs().asEigen());
175 Eigen::MatrixXd sipBP(sipReverse.getPoly().getYCoeffs().asEigen());
178 std::string coordSys;
179 switch (skyOrigin.getCoordSystem()) {
188 pex::exceptions::InvalidParameterError,
189 "Coordinate system not supported"
192 return std::make_shared<afw::image::TanWcs>(
194 sipForward.getPixelOrigin(),
195 sipForward.getCDMatrix().getMatrix(),
196 sipA, sipB, sipAP, sipBP,
197 skyOrigin.getEpoch(),
lsst::afw::coord::Coord Coord
Extent< double, 2 > Extent2D
PolynomialTransform compose(afw::geom::AffineTransform const &t1, PolynomialTransform const &t2)
Return a PolynomialTransform that is equivalent to the composition t1(t2())
Implementation of the WCS standard for the special case of the Gnomonic (tangent plane) projection...
std::shared_ptr< afw::image::TanWcs > makeWcs(SipForwardTransform const &sipForward, SipReverseTransform const &sipReverse, afw::coord::Coord const &skyOrigin)
Create a new TAN SIP Wcs from a pair of SIP transforms and the sky origin.
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Functions to handle coordinates.