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 Member Functions | Static Public Member Functions | Friends | List of all members
lsst::meas::astrom::ScaledPolynomialTransform Class Reference

A 2-d coordinate transform represented by a lazy composition of an AffineTransform, a PolynomialTransform, and another AffineTransform. More...

#include <PolynomialTransform.h>

Public Member Functions

 ScaledPolynomialTransform (PolynomialTransform const &poly, geom::AffineTransform const &inputScaling, geom::AffineTransform const &outputScalingInverse)
 Construct a new ScaledPolynomialTransform from its constituents. More...
 
 ScaledPolynomialTransform (ScaledPolynomialTransform const &other)=default
 
 ScaledPolynomialTransform (ScaledPolynomialTransform &&other)=default
 
ScaledPolynomialTransformoperator= (ScaledPolynomialTransform const &other)=default
 
ScaledPolynomialTransformoperator= (ScaledPolynomialTransform &&other)=default
 
void swap (ScaledPolynomialTransform &other)
 
PolynomialTransform const & getPoly () const
 Return the polynomial transform applied after the input scaling. More...
 
geom::AffineTransform const & getInputScaling () const
 Return the first affine transform applied to input points. More...
 
geom::AffineTransform const & getOutputScalingInverse () const
 Return the affine transform applied to points after the polynomial transform. More...
 
geom::AffineTransform linearize (geom::Point2D const &in) const
 Return an approximate affine transform at the given point. More...
 
geom::Point2D operator() (geom::Point2D const &in) const
 Apply the transform to a point. More...
 

Static Public Member Functions

static ScaledPolynomialTransform convert (PolynomialTransform const &poly)
 Convert a PolynomialTransform to an equivalent ScaledPolynomialTransform. More...
 
static ScaledPolynomialTransform convert (SipForwardTransform const &sipForward)
 Convert a SipForwardTransform to an equivalent ScaledPolynomialTransform. More...
 
static ScaledPolynomialTransform convert (SipReverseTransform const &sipReverse)
 Convert a SipForwardTransform to an equivalent ScaledPolynomialTransform. More...
 

Friends

class ScaledPolynomialTransformFitter
 

Detailed Description

A 2-d coordinate transform represented by a lazy composition of an AffineTransform, a PolynomialTransform, and another AffineTransform.

ScaledPolynomialTransform instances should be confined to a single thread.

Definition at line 157 of file PolynomialTransform.h.

Constructor & Destructor Documentation

◆ ScaledPolynomialTransform() [1/3]

lsst::meas::astrom::ScaledPolynomialTransform::ScaledPolynomialTransform ( PolynomialTransform const &  poly,
geom::AffineTransform const &  inputScaling,
geom::AffineTransform const &  outputScalingInverse 
)

Construct a new ScaledPolynomialTransform from its constituents.

Parameters
[in]polyA PolynomialTransform to be applied to points. after the inputScaling transform.
[in]inputScalingAn AffineTransform to be applied immediately to input points.
[in]outputScalingInverseAn AffineTransform to be applied to points after the PolynomialTransform.

Definition at line 195 of file PolynomialTransform.cc.

198  : _poly(poly), _inputScaling(inputScaling), _outputScalingInverse(outputScalingInverse) {}
Low-level polynomials (including special polynomials) in C++.
Definition: Basis1d.h:26

◆ ScaledPolynomialTransform() [2/3]

lsst::meas::astrom::ScaledPolynomialTransform::ScaledPolynomialTransform ( ScaledPolynomialTransform const &  other)
default

◆ ScaledPolynomialTransform() [3/3]

lsst::meas::astrom::ScaledPolynomialTransform::ScaledPolynomialTransform ( ScaledPolynomialTransform &&  other)
default

Member Function Documentation

◆ convert() [1/3]

ScaledPolynomialTransform lsst::meas::astrom::ScaledPolynomialTransform::convert ( PolynomialTransform const &  poly)
static

Convert a PolynomialTransform to an equivalent ScaledPolynomialTransform.

This simply inserts identity AffineTransforms before and after applying the given PolynomialTransform.

Definition at line 172 of file PolynomialTransform.cc.

172  {
174 }
An affine coordinate transformation consisting of a linear transformation and an offset.
ScaledPolynomialTransform(PolynomialTransform const &poly, geom::AffineTransform const &inputScaling, geom::AffineTransform const &outputScalingInverse)
Construct a new ScaledPolynomialTransform from its constituents.

◆ convert() [2/3]

ScaledPolynomialTransform lsst::meas::astrom::ScaledPolynomialTransform::convert ( SipForwardTransform const &  sipForward)
static

Convert a SipForwardTransform to an equivalent ScaledPolynomialTransform.

The input transform's CRPIX offset and CD matrix scaling are used to define the input and output affine transforms, respectively, leaving the polynomial coefficients unmodified.

Definition at line 176 of file PolynomialTransform.cc.

176  {
177  ScaledPolynomialTransform result(sipForward.getPoly(),
178  geom::AffineTransform(geom::Point2D(0, 0) - sipForward.getPixelOrigin()),
179  geom::AffineTransform(sipForward.getCdMatrix()));
180  // Account for the terms outside the sum in the SIP definition (see comment
181  // earlier in the file for more explanation).
182  result._poly._xCoeffs(1, 0) += 1;
183  result._poly._yCoeffs(0, 1) += 1;
184  return result;
185 }
py::object result
Definition: _schema.cc:429

◆ convert() [3/3]

ScaledPolynomialTransform lsst::meas::astrom::ScaledPolynomialTransform::convert ( SipReverseTransform const &  sipReverse)
static

Convert a SipForwardTransform to an equivalent ScaledPolynomialTransform.

The input transform's CD matrix scaling and CRPIX offset are used to define the input and output affine transforms, respectively, leaving the polynomial coefficients unmodified.

Definition at line 187 of file PolynomialTransform.cc.

187  {
188  ScaledPolynomialTransform result(sipReverse.getPoly(), geom::AffineTransform(sipReverse._cdInverse),
189  geom::AffineTransform(geom::Extent2D(sipReverse.getPixelOrigin())));
190  result._poly._xCoeffs(1, 0) += 1;
191  result._poly._yCoeffs(0, 1) += 1;
192  return result;
193 }

◆ getInputScaling()

geom::AffineTransform const& lsst::meas::astrom::ScaledPolynomialTransform::getInputScaling ( ) const
inline

Return the first affine transform applied to input points.

Definition at line 212 of file PolynomialTransform.h.

212 { return _inputScaling; }

◆ getOutputScalingInverse()

geom::AffineTransform const& lsst::meas::astrom::ScaledPolynomialTransform::getOutputScalingInverse ( ) const
inline

Return the affine transform applied to points after the polynomial transform.

Definition at line 215 of file PolynomialTransform.h.

215 { return _outputScalingInverse; }

◆ getPoly()

PolynomialTransform const& lsst::meas::astrom::ScaledPolynomialTransform::getPoly ( ) const
inline

Return the polynomial transform applied after the input scaling.

Definition at line 209 of file PolynomialTransform.h.

209 { return _poly; }

◆ linearize()

geom::AffineTransform lsst::meas::astrom::ScaledPolynomialTransform::linearize ( geom::Point2D const &  in) const

Return an approximate affine transform at the given point.

Definition at line 206 of file PolynomialTransform.cc.

206  {
207  return _outputScalingInverse * _poly.linearize(_inputScaling(in)) * _inputScaling;
208 }
geom::AffineTransform linearize(geom::Point2D const &in) const
Return an approximate affine transform at the given point.

◆ operator()()

geom::Point2D lsst::meas::astrom::ScaledPolynomialTransform::operator() ( geom::Point2D const &  in) const

Apply the transform to a point.

Definition at line 210 of file PolynomialTransform.cc.

210  {
211  return _outputScalingInverse(_poly(_inputScaling(in)));
212 }

◆ operator=() [1/2]

ScaledPolynomialTransform& lsst::meas::astrom::ScaledPolynomialTransform::operator= ( ScaledPolynomialTransform &&  other)
default

◆ operator=() [2/2]

ScaledPolynomialTransform& lsst::meas::astrom::ScaledPolynomialTransform::operator= ( ScaledPolynomialTransform const &  other)
default

◆ swap()

void lsst::meas::astrom::ScaledPolynomialTransform::swap ( ScaledPolynomialTransform other)

Definition at line 200 of file PolynomialTransform.cc.

200  {
201  _poly.swap(other._poly);
202  std::swap(_inputScaling, other._inputScaling);
203  std::swap(_outputScalingInverse, other._outputScalingInverse);
204 }
void swap(PolynomialTransform &other)
Lightweight swap.
T swap(T... args)

Friends And Related Function Documentation

◆ ScaledPolynomialTransformFitter

friend class ScaledPolynomialTransformFitter
friend

Definition at line 228 of file PolynomialTransform.h.


The documentation for this class was generated from the following files: