LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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: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(); }

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: