LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
SipApproximation.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * Developed for the LSST Data Management System.
4  * This product includes software developed by the LSST Project
5  * (https://www.lsst.org).
6  * See the COPYRIGHT file at the top-level directory of this distribution
7  * for details of code ownership.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
23 #include <algorithm>
24 #include <vector>
25 
26 #include "Eigen/SVD"
27 #include "Eigen/QR"
30 
31 namespace lsst { namespace afw { namespace geom {
32 
33 namespace poly = lsst::geom::polynomials;
34 
35 namespace {
36 
38  int order,
39  lsst::geom::Box2D const & box,
40  double svdThreshold,
43 ) {
44  // The scaled polynomial basis evaluates polynomials after mapping the
45  // input coordinates from the given box to [-1, 1]x[-1, 1] (for numerical
46  // stability).
47  auto basis = poly::ScaledPolynomialBasis2dYX(order, box);
48  auto workspace = basis.makeWorkspace();
49  Eigen::MatrixXd matrix = Eigen::MatrixXd::Zero(input.size(), basis.size());
50  Eigen::VectorXd xRhs(input.size());
51  Eigen::VectorXd yRhs(input.size());
52  for (int i = 0; i < matrix.rows(); ++i) {
53  basis.fill(input[i], matrix.row(i), workspace);
54  auto rhs = output[i] - input[i];
55  xRhs[i] = rhs.getX();
56  yRhs[i] = rhs.getY();
57  }
58  // Since we're not trying to null the zeroth- and first-order terms, the
59  // solution is just linear least squares, and we can do that with SVD.
60  auto decomp = matrix.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV);
61  if (svdThreshold >= 0) {
62  decomp.setThreshold(svdThreshold);
63  }
64  auto scaledX = makeFunction2d(basis, decomp.solve(xRhs));
65  auto scaledY = makeFunction2d(basis, decomp.solve(yRhs));
66  // On return, we simplify the polynomials by moving the remapping transform
67  // into the coefficients themselves.
68  return std::make_pair(simplified(scaledX), simplified(scaledY));
69 }
70 
71 // Return a vector of points on a grid, covering the given bounding box.
73  lsst::geom::Extent2I const & shape) {
74  if (shape.getX() <= 0 || shape.getY() <= 0) {
75  throw LSST_EXCEPT(
76  pex::exceptions::InvalidParameterError,
77  "Grid shape must be positive."
78  );
79  }
81  points.reserve(shape.getX()*shape.getY());
82  double const dx = bbox.getWidth()/shape.getX();
83  double const dy = bbox.getHeight()/shape.getY();
84  for (int iy = 0; iy < shape.getY(); ++iy) {
85  double const y = bbox.getMinY() + iy*dy;
86  for (int ix = 0; ix < shape.getX(); ++ix) {
87  points.emplace_back(bbox.getMinX() + ix*dx, y);
88  }
89  }
90  return points;
91 }
92 
93 // Make a polynomial object (with packed coefficients) from a square coefficients matrix.
94 poly::PolynomialFunction2dYX makePolynomialFromCoeffMatrix(ndarray::Array<double const, 2> const & coeffs) {
95  LSST_THROW_IF_NE(coeffs.getSize<0>(), coeffs.getSize<1>(), pex::exceptions::InvalidParameterError,
96  "Coefficient matrix must be square (%d != %d).");
97  poly::PolynomialBasis2dYX basis(coeffs.getSize<0>() - 1);
98  Eigen::VectorXd packed(basis.size());
99  for (auto const & i : basis.getIndices()) {
100  packed[i.flat] = coeffs[i.nx][i.ny];
101  }
102  return poly::PolynomialFunction2dYX(basis, packed);
103 }
104 
105 } // anonymous
106 
107 // Private implementation object for SipApproximation that manages the grid of points on which
108 // we evaluate the exact transform.
110 
111  // Set up the grid.
112  Grid(lsst::geom::Extent2I const & shape_, SipApproximation const & parent);
113 
114  lsst::geom::Extent2I const shape; // number of grid points in each dimension
115  std::vector<lsst::geom::Point2D> dpix1; // [pixel coords] - CRPIX
116  std::vector<lsst::geom::Point2D> siwc; // CD^{-1}([intermediate world coords])
117  std::vector<lsst::geom::Point2D> dpix2; // round-tripped version of dpix1 if useInverse, or exactly dpix1
118 };
119 
120 // Private implementation object for SipApproximation that manages the solution
122 
123  static std::unique_ptr<Solution> fit(int order_, double svdThreshold, SipApproximation const & parent);
124 
126  poly::PolynomialFunction2dYX const & b_,
127  poly::PolynomialFunction2dYX const & ap_,
128  poly::PolynomialFunction2dYX const & bp_) :
129  a(a_), b(b_), ap(ap_), bp(bp_)
130  {
131  LSST_THROW_IF_NE(a.getBasis().getOrder(), b.getBasis().getOrder(),
133  "A and B polynomials must have the same order (%d != %d).");
134  LSST_THROW_IF_NE(a.getBasis().getOrder(), ap.getBasis().getOrder(),
136  "A and AP polynomials must have the same order (%d != %d).");
137  LSST_THROW_IF_NE(a.getBasis().getOrder(), bp.getBasis().getOrder(),
139  "A and BP polynomials must have the same order (%d != %d).");
140  }
141 
143 
144  Workspace makeWorkspace() const { return a.makeWorkspace(); }
145 
147  return dpix + lsst::geom::Extent2D(a(dpix, ws), b(dpix, ws));
148  }
149 
151  return siwc + lsst::geom::Extent2D(ap(siwc, ws), bp(siwc, ws));
152  }
153 
158 };
159 
161  shape(shape_),
162  dpix1(makeGrid(parent._bbox, shape)),
163  siwc(parent._pixelToIwc->applyForward(dpix1))
164 {
165  // Apply the CRPIX offset to make pix1 into dpix1 (in-place)
166  std::for_each(dpix1.begin(), dpix1.end(), [&parent](lsst::geom::Point2D & p){ p -= parent._crpix; });
167 
168  if (parent._useInverse) {
169  // Set from the given inverse of the given pixels-to-iwc transform
170  // Note that at this point, siwc is still just iwc, because the scaling by cdInv is later.
171  dpix2 = parent._pixelToIwc->applyInverse(siwc);
172  // Apply the CRPIX offset to make pix1 into dpix2 (in-place)
173  std::for_each(dpix2.begin(), dpix2.end(), [&parent](lsst::geom::Point2D & p){ p -= parent._crpix; });
174  } else {
175  // Just make dpix2 = dpix1, and hence fit to the true inverse of pixels-to-iwc.
176  dpix2 = dpix1;
177  }
178 
179  // Apply the CD^{-1} transform to siwc
180  std::for_each(siwc.begin(), siwc.end(), [&parent](lsst::geom::Point2D & p){ p = parent._cdInv(p); });
181 }
182 
184  int order,
185  double svdThreshold,
186  SipApproximation const & parent
187 ) {
189  if (basis.size() > parent._grid->dpix1.size()) {
190  throw LSST_EXCEPT(
192  (boost::format("Number of parameters (%d) is larger than number of data points (%d)")
193  % (2*basis.size()) % (2*parent._grid->dpix1.size())).str()
194  );
195  }
196 
197  lsst::geom::Box2D boxFwd(parent._bbox);
198  boxFwd.shift(-parent._crpix);
199  auto fwd = fitSipOneDirection(order, boxFwd, svdThreshold, parent._grid->dpix1, parent._grid->siwc);
200 
201  lsst::geom::Box2D boxInv;
202  for (auto const & point : parent._grid->siwc) {
203  boxInv.include(point);
204  }
205  auto inv = fitSipOneDirection(order, boxInv, svdThreshold, parent._grid->siwc, parent._grid->dpix2);
206 
207  return std::make_unique<Solution>(fwd.first, fwd.second, inv.first, inv.second);
208 }
209 
212  lsst::geom::Point2D const & crpix,
213  Eigen::Matrix2d const & cd,
214  lsst::geom::Box2D const & bbox,
215  lsst::geom::Extent2I const & gridShape,
216  int order,
217  bool useInverse,
218  double svdThreshold
219 ) :
220  _useInverse(useInverse),
221  _pixelToIwc(std::move(pixelToIwc)),
222  _bbox(bbox),
223  _crpix(crpix),
224  _cdInv(lsst::geom::LinearTransform(cd).inverted()),
225  _grid(new Grid(gridShape, *this)),
226  _solution(Solution::fit(order, svdThreshold, *this))
227 {}
228 
231  lsst::geom::Point2D const & crpix,
232  Eigen::Matrix2d const & cd,
233  lsst::geom::Box2D const & bbox,
234  lsst::geom::Extent2I const & gridShape,
235  ndarray::Array<double const, 2> const & a,
236  ndarray::Array<double const, 2> const & b,
237  ndarray::Array<double const, 2> const & ap,
238  ndarray::Array<double const, 2> const & bp,
239  bool useInverse
240 ) :
241  _useInverse(useInverse),
242  _pixelToIwc(std::move(pixelToIwc)),
243  _bbox(bbox),
244  _crpix(crpix),
245  _cdInv(lsst::geom::LinearTransform(cd).inverted()),
246  _grid(new Grid(gridShape, *this)),
247  _solution(
248  new Solution(
249  makePolynomialFromCoeffMatrix(a),
250  makePolynomialFromCoeffMatrix(b),
251  makePolynomialFromCoeffMatrix(ap),
252  makePolynomialFromCoeffMatrix(bp)
253  )
254  )
255 {}
256 
258 
259 int SipApproximation::getOrder() const noexcept {
260  return _solution->a.getBasis().getOrder();
261 }
262 
263 double SipApproximation::getA(int p, int q) const {
264  return _solution->a[_solution->a.getBasis().index(p, q)];
265 }
266 
267 double SipApproximation::getB(int p, int q) const {
268  return _solution->b[_solution->b.getBasis().index(p, q)];
269 }
270 
271 double SipApproximation::getAP(int p, int q) const {
272  return _solution->ap[_solution->ap.getBasis().index(p, q)];
273 }
274 
275 double SipApproximation::getBP(int p, int q) const {
276  return _solution->bp[_solution->bp.getBasis().index(p, q)];
277 }
278 
279 namespace {
280 
281 template <typename F>
282 Eigen::MatrixXd makeCoefficientMatrix(std::size_t order, F getter) {
283  Eigen::MatrixXd result = Eigen::MatrixXd::Zero(order + 1, order + 1);
284  for (std::size_t p = 0; p <= order; ++p) {
285  for (std::size_t q = 0; q <= order - p; ++q) {
286  result(p, q) = getter(p, q);
287  }
288  }
289  return result;
290 }
291 
292 } // anonymous
293 
294 Eigen::MatrixXd SipApproximation::getA() const noexcept {
295  return makeCoefficientMatrix(
296  getOrder(),
297  [this](int p, int q) { return getA(p, q); }
298  );
299 }
300 
301 Eigen::MatrixXd SipApproximation::getB() const noexcept {
302  return makeCoefficientMatrix(
303  getOrder(),
304  [this](int p, int q) { return getB(p, q); }
305  );
306 }
307 
308 Eigen::MatrixXd SipApproximation::getAP() const noexcept {
309  return makeCoefficientMatrix(
310  getOrder(),
311  [this](int p, int q) { return getAP(p, q); }
312  );
313 }
314 
315 Eigen::MatrixXd SipApproximation::getBP() const noexcept {
316  return makeCoefficientMatrix(
317  getOrder(),
318  [this](int p, int q) { return getBP(p, q); }
319  );
320 }
321 
323  auto cd = _cdInv.inverted();
324  auto ws = _solution->makeWorkspace();
325  return cd(_solution->applyForward(pix - _crpix, ws));
326 }
327 
329  std::vector<lsst::geom::Point2D> const & pix) const {
330  auto ws = _solution->makeWorkspace();
332  iwc.reserve(pix.size());
333  auto cd = _cdInv.inverted();
334  for (auto const & point : pix) {
335  iwc.push_back(cd(_solution->applyForward(point - _crpix, ws)));
336  }
337  return iwc;
338 }
339 
341  auto ws = _solution->makeWorkspace();
342  return _solution->applyInverse(_cdInv(iwc), ws) + _crpix;
343 }
344 
346  std::vector<lsst::geom::Point2D> const & iwc) const {
347  auto ws = _solution->makeWorkspace();
349  pix.reserve(iwc.size());
350  for (auto const & point : iwc) {
351  pix.push_back(_solution->applyInverse(_cdInv(point), ws) + _crpix);
352  }
353  return pix;
354 }
355 
357  return lsst::geom::Extent2D(_bbox.getWidth()/_grid->shape.getX(),
358  _bbox.getHeight()/_grid->shape.getY());
359 }
360 
362  return _grid->shape;
363 }
364 
366  _grid = std::make_unique<Grid>(shape, *this);
367 }
368 
370  // We shrink the grid spacing by the given factor, which is not the same
371  // as increasing the number of grid points by that factor, because there
372  // is one more grid point that step in each dimension.
373  lsst::geom::Extent2I unit(1);
374  updateGrid((_grid->shape - unit)*f + unit);
375 }
376 
377 void SipApproximation::fit(int order, double svdThreshold) {
378  _solution = Solution::fit(order, svdThreshold, *this);
379 }
380 
382  std::pair<double, double> maxDiff(0.0, 0.0);
383  auto ws = _solution->makeWorkspace();
384  for (std::size_t i = 0; i < _grid->dpix1.size(); ++i) {
385  auto siwc2 = _solution->applyForward(_grid->dpix1[i], ws);
386  auto dpix2 = _solution->applyInverse(_grid->siwc[i], ws);
387  maxDiff.first = std::max(maxDiff.first, (_grid->siwc[i] - siwc2).computeNorm());
388  maxDiff.second = std::max(maxDiff.second, (_grid->dpix2[i] - dpix2).computeNorm());
389  }
390  return maxDiff;
391 }
392 
393 }}} // namespace lsst::afw::geom
y
int y
Definition: SpanSet.cc:49
lsst::geom::polynomials::PackedBasis2d
A Basis2d formed from the product of a Basis1d for each of x and y, truncated at the sum of their ord...
Definition: PackedBasis2d.h:33
lsst::geom::polynomials::Function2d::getBasis
Basis const & getBasis() const
Return the associated Basis2d object.
Definition: Function2d.h:101
LSST_THROW_IF_NE
#define LSST_THROW_IF_NE(N1, N2, EXC_CLASS, MSG)
Check whether the given values are equal, and throw an LSST Exception if they are not.
Definition: asserts.h:38
lsst::afw::geom::SipApproximation::getA
Eigen::MatrixXd getA() const noexcept
Return the coefficients of the forward transform polynomial.
Definition: SipApproximation.cc:294
lsst::afw::geom::SipApproximation::refineGrid
void refineGrid(int factor=2)
Update the grid by making it finer by a given integer factor.
Definition: SipApproximation.cc:369
std::for_each
T for_each(T... args)
lsst::afw::geom::SipApproximation::getGridShape
lsst::geom::Extent2I getGridShape() const noexcept
Return the number of grid points in x and y.
Definition: SipApproximation.cc:361
lsst::afw::geom::SipApproximation
A fitter and results class for approximating a general Transform in a form compatible with FITS WCS p...
Definition: SipApproximation.h:94
std::shared_ptr
STL class.
lsst::geom::Box2D::shift
void shift(Extent2D const &offset)
Shift the position of the box by the given offset.
Definition: Box.cc:350
lsst::afw::geom::SipApproximation::Solution::fit
static std::unique_ptr< Solution > fit(int order_, double svdThreshold, SipApproximation const &parent)
Definition: SipApproximation.cc:183
lsst::afw::geom::SipApproximation::applyInverse
lsst::geom::Point2D applyInverse(lsst::geom::Point2D const &iwcs) const
Convert a point from intermediate world coordinates to pixels.
Definition: SipApproximation.cc:340
lsst::afw::geom::SipApproximation::applyForward
lsst::geom::Point2D applyForward(lsst::geom::Point2D const &pix) const
Convert a point from pixels to intermediate world coordinates.
Definition: SipApproximation.cc:322
std::pair
std::vector::reserve
T reserve(T... args)
std::vector
STL class.
std::vector::size
T size(T... args)
lsst::afw::geom::SipApproximation::SipApproximation
SipApproximation(std::shared_ptr< TransformPoint2ToPoint2 > pixelToIwc, lsst::geom::Point2D const &crpix, Eigen::Matrix2d const &cd, lsst::geom::Box2D const &bbox, lsst::geom::Extent2I const &gridShape, int order, bool useInverse=true, double svdThreshold=-1)
Construct a new approximation by fitting on a grid of points.
Definition: SipApproximation.cc:210
lsst::afw::geom::SipApproximation::Grid::shape
lsst::geom::Extent2I const shape
Definition: SipApproximation.cc:114
lsst::geom::polynomials::makeFunction2d
Function2d< Basis > makeFunction2d(Basis const &basis, Eigen::VectorXd const &coefficients)
Create a Function2d of the appropriate type from a Basis2d and an Eigen object containing coefficient...
Definition: Function2d.h:155
lsst::afw
Definition: imageAlgorithm.dox:1
lsst::afw::geom::SipApproximation::updateGrid
void updateGrid(lsst::geom::Extent2I const &shape)
Update the grid to the given number of points in x and y.
Definition: SipApproximation.cc:365
lsst::afw::geom::SipApproximation::Grid::siwc
std::vector< lsst::geom::Point2D > siwc
Definition: SipApproximation.cc:116
lsst::geom::polynomials::Function2d::makeWorkspace
Workspace makeWorkspace() const
Allocate workspace that can be passed to operator() to avoid repeated memory allocations.
Definition: Function2d.h:107
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::afw::geom::SipApproximation::fit
void fit(int order, double svdThreshold=-1)
Obtain a new solution at the given order with the current grid.
Definition: SipApproximation.cc:377
lsst::afw::geom::SipApproximation::Solution::Workspace
poly::PolynomialFunction2dYX::Workspace Workspace
Definition: SipApproximation.cc:142
PolynomialFunction2d.h
lsst::afw::geom::SipApproximation::Solution::a
poly::PolynomialFunction2dYX a
Definition: SipApproximation.cc:154
lsst::afw::geom::SipApproximation::Solution::bp
poly::PolynomialFunction2dYX bp
Definition: SipApproximation.cc:157
SipApproximation.h
lsst::afw::geom::SipApproximation::Solution::ap
poly::PolynomialFunction2dYX ap
Definition: SipApproximation.cc:156
lsst::afw::geom::SipApproximation::Grid::dpix2
std::vector< lsst::geom::Point2D > dpix2
Definition: SipApproximation.cc:117
std::vector::push_back
T push_back(T... args)
lsst::geom::Box2D::getHeight
double getHeight() const noexcept
1-d interval accessors
Definition: Box.h:530
lsst::afw::geom::SipApproximation::getOrder
int getOrder() const noexcept
Return the polynomial order of the current solution (same for forward and reverse).
Definition: SipApproximation.cc:259
lsst::afw::geom::SipApproximation::Solution::applyInverse
lsst::geom::Point2D applyInverse(lsst::geom::Point2D const &siwc, Workspace &ws) const
Definition: SipApproximation.cc:150
lsst::geom::polynomials::simplified
PolynomialFunction1d simplified(ScaledPolynomialFunction1d const &f)
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial functio...
Definition: PolynomialFunction1d.cc:32
lsst::afw::geom::SipApproximation::getAP
Eigen::MatrixXd getAP() const noexcept
Return the coefficients of the reverse transform polynomial.
Definition: SipApproximation.cc:308
crpix
table::PointKey< double > crpix
Definition: OldWcs.cc:131
lsst::geom::Box2D::getWidth
double getWidth() const noexcept
1-d interval accessors
Definition: Box.h:529
lsst.pex::exceptions::LogicError
Reports errors in the logical structure of the program.
Definition: Runtime.h:46
lsst::afw::geom::SipApproximation::getGridStep
lsst::geom::Extent2D getGridStep() const noexcept
Return the distance between grid points in pixels.
Definition: SipApproximation.cc:356
lsst::afw::geom::SipApproximation::Solution::Solution
Solution(poly::PolynomialFunction2dYX const &a_, poly::PolynomialFunction2dYX const &b_, poly::PolynomialFunction2dYX const &ap_, poly::PolynomialFunction2dYX const &bp_)
Definition: SipApproximation.cc:125
lsst::afw::geom::SipApproximation::Solution
Definition: SipApproximation.cc:121
lsst::geom::polynomials::Function2d::Workspace
typename Basis::Workspace Workspace
Type returned by makeWorkspace().
Definition: Function2d.h:52
lsst::geom::LinearTransform::inverted
LinearTransform const inverted() const
Return the inverse transform.
Definition: LinearTransform.cc:45
lsst::afw::geom::SipApproximation::Grid
Definition: SipApproximation.cc:109
cd
table::Key< table::Array< double > > cd
Definition: OldWcs.cc:132
basis
table::Key< table::Array< double > > basis
Definition: PsfexPsf.cc:361
result
py::object result
Definition: _schema.cc:429
b
table::Key< int > b
Definition: TransmissionCurve.cc:467
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::afw::geom::SipApproximation::Grid::Grid
Grid(lsst::geom::Extent2I const &shape_, SipApproximation const &parent)
Definition: SipApproximation.cc:160
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::geom::SipApproximation::getBP
Eigen::MatrixXd getBP() const noexcept
Return the coefficients of the reverse transform polynomial.
Definition: SipApproximation.cc:315
lsst::geom
Definition: AffineTransform.h:36
std::vector::emplace_back
T emplace_back(T... args)
lsst::geom::polynomials
Definition: Basis1d.h:26
lsst.pex::exceptions::InvalidParameterError
Reports invalid arguments.
Definition: Runtime.h:66
lsst::afw::geom::SipApproximation::Solution::applyForward
lsst::geom::Point2D applyForward(lsst::geom::Point2D const &dpix, Workspace &ws) const
Definition: SipApproximation.cc:146
a
table::Key< int > a
Definition: TransmissionCurve.cc:466
std
STL namespace.
lsst::afw::geom::SipApproximation::Solution::makeWorkspace
Workspace makeWorkspace() const
Definition: SipApproximation.cc:144
lsst::geom::Point< double, 2 >
lsst::afw::geom::SipApproximation::computeMaxDeviation
std::pair< double, double > computeMaxDeviation() const noexcept
Return the maximum deviation of the solution from the exact transform on the current grid.
Definition: SipApproximation.cc:381
lsst::geom::Box2D::include
void include(Point2D const &point) noexcept
Expand this to ensure that this->contains(point).
Definition: Box.cc:380
lsst::geom::Extent2D
Extent< double, 2 > Extent2D
Definition: Extent.h:400
lsst::afw::geom::SipApproximation::Grid::dpix1
std::vector< lsst::geom::Point2D > dpix1
Definition: SipApproximation.cc:115
std::size_t
std::make_pair
T make_pair(T... args)
lsst::afw::geom::SipApproximation::getB
Eigen::MatrixXd getB() const noexcept
Return the coefficients of the forward transform polynomial.
Definition: SipApproximation.cc:301
lsst::geom::polynomials::ScaledPolynomialBasis2dYX
ScaledPolynomialBasis2d< PackingOrder::YX > ScaledPolynomialBasis2dYX
A Basis2d for scaled standard polynomials, ordered via PackingOrder::YX.
Definition: PolynomialBasis2d.h:50
std::max
T max(T... args)
lsst::geom::Box2D
A floating-point coordinate rectangle geometry.
Definition: Box.h:413
std::unique_ptr
STL class.
lsst::afw::geom::SipApproximation::~SipApproximation
~SipApproximation() noexcept
Definition: SipApproximation.cc:257
lsst::geom::Extent< int, 2 >
lsst::geom::polynomials::Function2d
A 2-d function defined by a series expansion and its coefficients.
Definition: Function2d.h:42
bbox
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117
lsst::afw::geom::SipApproximation::Solution::b
poly::PolynomialFunction2dYX b
Definition: SipApproximation.cc:155
lsst::geom::polynomials::PolynomialFunction2dYX
PolynomialFunction2d< PackingOrder::YX > PolynomialFunction2dYX
A Function2d for standard polynomials, ordered via PackingOrder::YX.
Definition: PolynomialFunction2d.h:42