LSST Applications 24.1.5,g02d81e74bb+fa3a7a026e,g180d380827+a53a32eff8,g2079a07aa2+86d27d4dc4,g2305ad1205+c0501b3732,g295015adf3+7d3e92f0ec,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+5dd1654d75,g48712c4677+3bf1020dcb,g487adcacf7+065c13d9cf,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+d7ac436cfb,g5a732f18d5+53520f316c,g64a986408d+fa3a7a026e,g858d7b2824+fa3a7a026e,g8a8a8dda67+585e252eca,g99cad8db69+a5a909b84f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+4cf350ccb2,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+f991a0b59f,gc120e1dc64+9ccbfdb8be,gc28159a63d+0e5473021a,gcf0d15dbbd+5dd1654d75,gd96a1ce819+42fd0ee607,gdaeeff99f8+f9a426f77a,ge6526c86ff+0d71447b4b,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+fa3a7a026e
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: