LSST Applications g0d97872fb5+4fd969bb9d,g1653933729+34a971ddd9,g28da252d5a+072f89fe25,g2bbee38e9b+a99b0ab4cd,g2bc492864f+a99b0ab4cd,g2ca4be77d2+c0e3b27cd8,g2cdde0e794+704103fe75,g3156d2b45e+6e87dc994a,g347aa1857d+a99b0ab4cd,g35bb328faa+34a971ddd9,g3a166c0a6a+a99b0ab4cd,g3e281a1b8c+8ec26ec694,g4005a62e65+ba0306790b,g414038480c+9ed5ed841a,g569e0e2b34+cb4faa46ad,g5a97de2502+520531a62c,g717e5f8c0f+29153700a5,g7ede599f99+367733290c,g80478fca09+17051a22cc,g82479be7b0+f2f1ea0a87,g858d7b2824+29153700a5,g8b782ad322+29153700a5,g8cd86fa7b1+05420e7f7d,g9125e01d80+34a971ddd9,ga5288a1d22+e7f674aaf3,gae0086650b+34a971ddd9,gae74b0b5c6+45ef5cdc51,gb58c049af0+ace264a4f2,gc28159a63d+a99b0ab4cd,gcf0d15dbbd+8051a81198,gda6a2b7d83+8051a81198,gdaeeff99f8+7774323b41,gdf4d240d4a+34a971ddd9,ge2409df99d+cb167bac99,ge33fd446bb+29153700a5,ge79ae78c31+a99b0ab4cd,gf0baf85859+890af219f9,gf5289d68f6+9faa5c5784,w.2024.36
LSST Data Management Base Package
Loading...
Searching...
No Matches
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...
table::Key< table::Array< double > > basis
Definition PsfexPsf.cc:365
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(); }

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: