LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst::meas::astrom::SipTransformBase Class Reference

Base class for SIP transform objects. More...

#include <SipTransform.h>

Inheritance diagram for lsst::meas::astrom::SipTransformBase:
lsst::meas::astrom::SipForwardTransform lsst::meas::astrom::SipReverseTransform

Public Member Functions

geom::Point2D const & getPixelOrigin () const
 Return the pixel origin (CRPIX, but zero-indexed) of the transform. More...
 
geom::LinearTransform const & getCdMatrix () const
 Return the CD matrix of the transform. More...
 
PolynomialTransform const & getPoly () const
 Return the polynomial component of the transform (A,B) or (AP,BP). More...
 

Protected Member Functions

 SipTransformBase (geom::Point2D const &pixelOrigin, geom::LinearTransform const &cdMatrix, PolynomialTransform const &poly)
 Construct a SipTransformBase from its components. More...
 
 SipTransformBase (SipTransformBase const &other)=default
 
 SipTransformBase (SipTransformBase &&other)=default
 
SipTransformBaseoperator= (SipTransformBase const &other)=default
 
SipTransformBaseoperator= (SipTransformBase &&other)=default
 
void swap (SipTransformBase &other)
 
void transformPixelsInPlace (geom::AffineTransform const &s)
 

Protected Attributes

geom::Point2D _pixelOrigin
 
geom::LinearTransform _cdMatrix
 
PolynomialTransform _poly
 

Detailed Description

Base class for SIP transform objects.

This class simply provides some getters for its derived classes. It should not be used directly, and does not define a polymorphic interface.

Definition at line 46 of file SipTransform.h.

Constructor & Destructor Documentation

◆ SipTransformBase() [1/3]

lsst::meas::astrom::SipTransformBase::SipTransformBase ( geom::Point2D const &  pixelOrigin,
geom::LinearTransform const &  cdMatrix,
PolynomialTransform const &  poly 
)
inlineprotected

Construct a SipTransformBase from its components.

See SipForwardTransform and SipReverseTransform for more extensive definitions.

Parameters
[in]pixelOriginCRPIX \((u_0,v_0)\) (zero-indexed)
[in]cdMatrixCD matrix \(Z\)
[in]polyEither the forward or reverse SIP polynomial (depending on the derived class).

Definition at line 76 of file SipTransform.h.

78  : _pixelOrigin(pixelOrigin), _cdMatrix(cdMatrix), _poly(poly) {}

◆ SipTransformBase() [2/3]

lsst::meas::astrom::SipTransformBase::SipTransformBase ( SipTransformBase const &  other)
protecteddefault

◆ SipTransformBase() [3/3]

lsst::meas::astrom::SipTransformBase::SipTransformBase ( SipTransformBase &&  other)
protecteddefault

Member Function Documentation

◆ getCdMatrix()

geom::LinearTransform const& lsst::meas::astrom::SipTransformBase::getCdMatrix ( ) const
inline

Return the CD matrix of the transform.

Definition at line 56 of file SipTransform.h.

56 { return _cdMatrix; }

◆ getPixelOrigin()

geom::Point2D const& lsst::meas::astrom::SipTransformBase::getPixelOrigin ( ) const
inline

Return the pixel origin (CRPIX, but zero-indexed) of the transform.

Definition at line 51 of file SipTransform.h.

51 { return _pixelOrigin; }

◆ getPoly()

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

Return the polynomial component of the transform (A,B) or (AP,BP).

Definition at line 61 of file SipTransform.h.

61 { return _poly; }

◆ operator=() [1/2]

SipTransformBase& lsst::meas::astrom::SipTransformBase::operator= ( SipTransformBase &&  other)
protecteddefault

◆ operator=() [2/2]

SipTransformBase& lsst::meas::astrom::SipTransformBase::operator= ( SipTransformBase const &  other)
protecteddefault

◆ swap()

void lsst::meas::astrom::SipTransformBase::swap ( SipTransformBase other)
inlineprotected

Definition at line 85 of file SipTransform.h.

85  {
86  std::swap(_pixelOrigin, other._pixelOrigin);
87  std::swap(_cdMatrix, other._cdMatrix);
88  _poly.swap(other._poly);
89  }

◆ transformPixelsInPlace()

void lsst::meas::astrom::SipTransformBase::transformPixelsInPlace ( geom::AffineTransform const &  s)
protected

Definition at line 40 of file SipTransform.cc.

40  {
41  // The implementation for transformPixels is identical for
42  // SipForwardTransform and SipReverseTransform. That's pretty obvious for
43  // the pixel origin and CD matrix, which are the same in both cases, but
44  // it wasn't obvious to me until I did the math that the polynomial
45  // transforms are composed with the affine transform the same way.
46  auto sInv = s.inverted();
47  _pixelOrigin = s.getLinear()(_pixelOrigin - sInv.getTranslation());
48  _cdMatrix = _cdMatrix * sInv.getLinear();
49  _poly = compose(s.getLinear(), compose(getPoly(), sInv.getLinear()));
50 }

Member Data Documentation

◆ _cdMatrix

geom::LinearTransform lsst::meas::astrom::SipTransformBase::_cdMatrix
protected

Definition at line 94 of file SipTransform.h.

◆ _pixelOrigin

geom::Point2D lsst::meas::astrom::SipTransformBase::_pixelOrigin
protected

Definition at line 93 of file SipTransform.h.

◆ _poly

PolynomialTransform lsst::meas::astrom::SipTransformBase::_poly
protected

Definition at line 95 of file SipTransform.h.


The documentation for this class was generated from the following files:
lsst::meas::astrom::SipTransformBase::getPoly
PolynomialTransform const & getPoly() const
Return the polynomial component of the transform (A,B) or (AP,BP).
Definition: SipTransform.h:61
lsst::meas::astrom::SipTransformBase::_pixelOrigin
geom::Point2D _pixelOrigin
Definition: SipTransform.h:93
lsst::meas::astrom::SipTransformBase::_poly
PolynomialTransform _poly
Definition: SipTransform.h:95
other
ItemVariant const * other
Definition: Schema.cc:56
std::swap
T swap(T... args)
lsst::geom::polynomials
Definition: Basis1d.h:26
lsst::meas::astrom::SipTransformBase::_cdMatrix
geom::LinearTransform _cdMatrix
Definition: SipTransform.h:94
lsst::meas::astrom::PolynomialTransform::swap
void swap(PolynomialTransform &other)
Lightweight swap.
Definition: PolynomialTransform.cc:122
lsst::meas::astrom::compose
PolynomialTransform compose(geom::AffineTransform const &t1, PolynomialTransform const &t2)
Return a PolynomialTransform that is equivalent to the composition t1(t2())
Definition: PolynomialTransform.cc:214