LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst::afw::geom::SipApproximation::Solution Struct Reference

Public Types

using Workspace = poly::PolynomialFunction2dYX::Workspace
 

Public Member Functions

 Solution (poly::PolynomialFunction2dYX const &a_, poly::PolynomialFunction2dYX const &b_, poly::PolynomialFunction2dYX const &ap_, poly::PolynomialFunction2dYX const &bp_)
 
Workspace makeWorkspace () const
 
lsst::geom::Point2D applyForward (lsst::geom::Point2D const &dpix, Workspace &ws) const
 
lsst::geom::Point2D applyInverse (lsst::geom::Point2D const &siwc, Workspace &ws) const
 

Static Public Member Functions

static std::unique_ptr< Solutionfit (int order_, double svdThreshold, SipApproximation const &parent)
 

Public Attributes

poly::PolynomialFunction2dYX a
 
poly::PolynomialFunction2dYX b
 
poly::PolynomialFunction2dYX ap
 
poly::PolynomialFunction2dYX bp
 

Detailed Description

Definition at line 120 of file SipApproximation.cc.

Member Typedef Documentation

◆ Workspace

using lsst::afw::geom::SipApproximation::Solution::Workspace = poly::PolynomialFunction2dYX::Workspace

Definition at line 141 of file SipApproximation.cc.

Constructor & Destructor Documentation

◆ Solution()

lsst::afw::geom::SipApproximation::Solution::Solution ( poly::PolynomialFunction2dYX const &  a_,
poly::PolynomialFunction2dYX const &  b_,
poly::PolynomialFunction2dYX const &  ap_,
poly::PolynomialFunction2dYX const &  bp_ 
)
inline

Definition at line 124 of file SipApproximation.cc.

127  :
128  a(a_), b(b_), ap(ap_), bp(bp_)
129  {
130  LSST_THROW_IF_NE(a.getBasis().getOrder(), b.getBasis().getOrder(),
131  pex::exceptions::InvalidParameterError,
132  "A and B polynomials must have the same order (%d != %d).");
133  LSST_THROW_IF_NE(a.getBasis().getOrder(), ap.getBasis().getOrder(),
134  pex::exceptions::InvalidParameterError,
135  "A and AP polynomials must have the same order (%d != %d).");
136  LSST_THROW_IF_NE(a.getBasis().getOrder(), bp.getBasis().getOrder(),
137  pex::exceptions::InvalidParameterError,
138  "A and BP polynomials must have the same order (%d != %d).");
139  }
#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
Basis const & getBasis() const
Return the associated Basis2d object.
Definition: Function2d.h:101

Member Function Documentation

◆ applyForward()

lsst::geom::Point2D lsst::afw::geom::SipApproximation::Solution::applyForward ( lsst::geom::Point2D const &  dpix,
Workspace ws 
) const
inline

Definition at line 145 of file SipApproximation.cc.

145  {
146  return dpix + lsst::geom::Extent2D(a(dpix, ws), b(dpix, ws));
147  }
Extent< double, 2 > Extent2D
Definition: Extent.h:400

◆ applyInverse()

lsst::geom::Point2D lsst::afw::geom::SipApproximation::Solution::applyInverse ( lsst::geom::Point2D const &  siwc,
Workspace ws 
) const
inline

Definition at line 149 of file SipApproximation.cc.

149  {
150  return siwc + lsst::geom::Extent2D(ap(siwc, ws), bp(siwc, ws));
151  }

◆ fit()

std::unique_ptr< SipApproximation::Solution > lsst::afw::geom::SipApproximation::Solution::fit ( int  order_,
double  svdThreshold,
SipApproximation const &  parent 
)
static

Definition at line 182 of file SipApproximation.cc.

186  {
188  if (basis.size() > parent._grid->dpix1.size()) {
189  throw LSST_EXCEPT(
190  pex::exceptions::LogicError,
191  (boost::format("Number of parameters (%d) is larger than number of data points (%d)")
192  % (2*basis.size()) % (2*parent._grid->dpix1.size())).str()
193  );
194  }
195 
196  lsst::geom::Box2D boxFwd(parent._bbox);
197  boxFwd.shift(-parent._crpix);
198  auto fwd = fitSipOneDirection(order, boxFwd, svdThreshold, parent._grid->dpix1, parent._grid->siwc);
199 
200  lsst::geom::Box2D boxInv;
201  for (auto const & point : parent._grid->siwc) {
202  boxInv.include(point);
203  }
204  auto inv = fitSipOneDirection(order, boxInv, svdThreshold, parent._grid->siwc, parent._grid->dpix2);
205 
206  return std::make_unique<Solution>(fwd.first, fwd.second, inv.first, inv.second);
207 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
A floating-point coordinate rectangle geometry.
Definition: Box.h:413
void include(Point2D const &point) noexcept
Expand this to ensure that this->contains(point).
Definition: Box.cc:380
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:75
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
table::Key< table::Array< double > > basis
Definition: PsfexPsf.cc:361
table::Key< int > order

◆ makeWorkspace()

Workspace lsst::afw::geom::SipApproximation::Solution::makeWorkspace ( ) const
inline

Definition at line 143 of file SipApproximation.cc.

143 { return a.makeWorkspace(); }
Workspace makeWorkspace() const
Allocate workspace that can be passed to operator() to avoid repeated memory allocations.
Definition: Function2d.h:107

Member Data Documentation

◆ a

poly::PolynomialFunction2dYX lsst::afw::geom::SipApproximation::Solution::a

Definition at line 153 of file SipApproximation.cc.

◆ ap

poly::PolynomialFunction2dYX lsst::afw::geom::SipApproximation::Solution::ap

Definition at line 155 of file SipApproximation.cc.

◆ b

poly::PolynomialFunction2dYX lsst::afw::geom::SipApproximation::Solution::b

Definition at line 154 of file SipApproximation.cc.

◆ bp

poly::PolynomialFunction2dYX lsst::afw::geom::SipApproximation::Solution::bp

Definition at line 156 of file SipApproximation.cc.


The documentation for this struct was generated from the following file: