LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
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 121 of file SipApproximation.cc.

Member Typedef Documentation

◆ Workspace

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

Definition at line 142 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 125 of file SipApproximation.cc.

128  :
129  a(a_), b(b_), ap(ap_), bp(bp_)
130  {
131  LSST_THROW_IF_NE(a.getBasis().getOrder(), b.getBasis().getOrder(),
132  pex::exceptions::InvalidParameterError,
133  "A and B polynomials must have the same order (%d != %d).");
134  LSST_THROW_IF_NE(a.getBasis().getOrder(), ap.getBasis().getOrder(),
135  pex::exceptions::InvalidParameterError,
136  "A and AP polynomials must have the same order (%d != %d).");
137  LSST_THROW_IF_NE(a.getBasis().getOrder(), bp.getBasis().getOrder(),
138  pex::exceptions::InvalidParameterError,
139  "A and BP polynomials must have the same order (%d != %d).");
140  }
#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 146 of file SipApproximation.cc.

146  {
147  return dpix + lsst::geom::Extent2D(a(dpix, ws), b(dpix, ws));
148  }
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 150 of file SipApproximation.cc.

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

◆ fit()

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

Definition at line 183 of file SipApproximation.cc.

187  {
189  if (basis.size() > parent._grid->dpix1.size()) {
190  throw LSST_EXCEPT(
191  pex::exceptions::LogicError,
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 }
#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

◆ makeWorkspace()

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

Definition at line 144 of file SipApproximation.cc.

144 { 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 154 of file SipApproximation.cc.

◆ ap

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

Definition at line 156 of file SipApproximation.cc.

◆ b

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

Definition at line 155 of file SipApproximation.cc.

◆ bp

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

Definition at line 157 of file SipApproximation.cc.


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