Class AstrometryTransform¶
Defined in File AstrometryTransform.h
Inheritance Relationships¶
Derived Types¶
public lsst::jointcal::AstrometryTransformIdentity
(Class AstrometryTransformIdentity)public lsst::jointcal::AstrometryTransformPolynomial
(Class AstrometryTransformPolynomial)public lsst::jointcal::AstrometryTransformSkyWcs
(Class AstrometryTransformSkyWcs)public lsst::jointcal::BaseTanWcs
(Class BaseTanWcs)public lsst::jointcal::TanRaDecToPixel
(Class TanRaDecToPixel)public lsst::jointcal::UserTransform
(Class UserTransform)
Class Documentation¶
-
class
AstrometryTransform
¶ a virtual (interface) class for geometric transformations.
We implement here One AstrometryTransform interface class, and actual derived classes. Composition in the usual (mathematical) sense is provided using compose(), and some classes (e.g. AstrometryTransformLinear
) handle a * operator. Generic inversion by iteration exists, but it is at least 10 times slower than the corresponding “direct
transformation”. If a transform has an analytical inverse, then providing inverseTransform is obviously a very good idea. Before resorting to inverseTransform, consider using
StarMatchList::inverseTransform(). AstrometryTransformLinear::inverted() and TanPixelToRaDec::inverted() exist. The classes also provide derivation and linear approximation.Subclassed by lsst::jointcal::AstrometryTransformIdentity, lsst::jointcal::AstrometryTransformPolynomial, lsst::jointcal::AstrometryTransformSkyWcs, lsst::jointcal::BaseTanWcs, lsst::jointcal::TanRaDecToPixel, lsst::jointcal::UserTransform
Public Functions
-
virtual void
apply
(const double xIn, const double yIn, double &xOut, double &yOut) const = 0¶
-
void
apply
(Point const &in, Point &out) const¶ applies the tranfo to in and writes into out. Is indeed virtual.
-
Point
apply
(Point const &in) const¶ All these apply(..) shadow the virtual one in derived classes, unless one writes “using
AstrometryTransform::apply”.
-
Frame
apply
(Frame const &inputframe, bool inscribed) const¶ Transform a bounding box, taking either the inscribed or circumscribed box.
- Return
The transformed frame.
- Parameters
[in] inputframe
: The frame to be transformed.[in] inscribed
: Return the inscribed (true) or circumscribed (false) box.
-
virtual void
dump
(std::ostream &stream = std::cout) const = 0¶ dumps the transform coefficients to stream.
-
std::string
__str__
()¶
-
virtual double
fit
(StarMatchList const &starMatchList) = 0¶ fits a transform to a std::list of Point pairs (p1,p2, the Point fields in StarMatch).
After the fit this(p1) yields approximately p2. The returned value is the sum of squared residuals. If you want to fit a partial transform (e.g. such that this(T1(p1)) = T2(p2), use StarMatchList::applyTransform beforehand.
-
virtual std::unique_ptr<AstrometryTransform>
clone
() const = 0¶ returns a copy (allocated by new) of the transformation.
-
virtual std::unique_ptr<AstrometryTransform>
composeAndReduce
(AstrometryTransform const &right) const¶ Return a reduced composition of newTransform = this(right()), or nullptr if it cannot be reduced.
“Reduced” in this context means that they are capable of being merged into a single transform, for example, for two polynomials:
\[ f(x) = 1 + x^2, g(x) = -1 + 3x \]we would haveh = f.composeAndReduce(g) == 2 - 6x + 9x^2
.To be overloaded by derived classes if they can properly reduce the composition.
- Return
The new reduced and composed AstrometryTransform, or nullptr if no such reduction is possible.
- Parameters
right
: The transform to apply first.
-
virtual double
getJacobian
(const double x, const double y) const¶ returns the local jacobian.
-
virtual void
computeDerivative
(Point const &where, AstrometryTransformLinear &derivative, const double step = 0.01) const¶ Computes the local Derivative of a transform, w.r.t. position.
Step is used for numerical derivation.
-
virtual AstrometryTransformLinear
linearApproximation
(Point const &where, const double step = 0.01) const¶ linear (local) approximation.
-
virtual void
transformErrors
(Point const &where, const double *vIn, double *vOut) const¶ transform errors (represented as double[3] in order V(xx),V(yy),Cov(xy))
-
virtual std::unique_ptr<AstrometryTransform>
inverseTransform
(const double precision, const Frame ®ion) const¶ returns an inverse transform. Numerical if not overloaded.
precision and region refer to the “input” side of this, and hence to the output side of the returned AstrometryTransform.
-
void
getParams
(double *params) const¶ params should be at least Npar() long
-
void
offsetParams
(Eigen::VectorXd const &delta)¶
-
virtual double
paramRef
(Eigen::Index const i) const¶
-
virtual double &
paramRef
(Eigen::Index const i)¶
-
virtual void
paramDerivatives
(Point const &where, double *dx, double *dy) const¶ Derivative w.r.t parameters. Derivatives should be al least 2*NPar long. first Npar, for x, last Npar for y.
-
virtual std::unique_ptr<AstrometryTransform>
roughInverse
(const Frame ®ion) const¶ Rough inverse.
Stored by the numerical inverter to guess starting point for the trials. Just here to enable overloading.
-
virtual std::size_t
getNpar
() const¶ returns the number of parameters (to compute chi2’s)
-
virtual std::shared_ptr<ast::Mapping>
toAstMap
(jointcal::Frame const &domain) const¶ Create an equivalent AST mapping for this transformation, including an analytic inverse if possible.
- Return
An AST Mapping that represents this transformation.
- Parameters
domain
: The domain of the transform, to help find an inverse.
-
void
write
(const std::string &fileName) const¶
-
virtual void
write
(std::ostream &stream) const¶
-
virtual
~AstrometryTransform
()¶
-
virtual void