2 #ifndef LSST_JOINTCAL_GTRANSFO_H 3 #define LSST_JOINTCAL_GTRANSFO_H 42 virtual void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const = 0;
52 return Point(xout, yout);
85 virtual double getJacobian(
const double x,
const double y)
const;
93 const double step = 0.01)
const;
115 virtual double paramRef(
const int i)
const;
118 virtual double &
paramRef(
const int i);
156 void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const {
163 "GtransfoIdentity is the identity transformation: it cannot be fit to anything.");
203 void setDegree(
const unsigned degree);
207 void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const;
241 double coeff(
const unsigned powX,
const unsigned powY,
const unsigned whichCoord)
const;
244 double &coeff(
const unsigned powX,
const unsigned powY,
const unsigned whichCoord);
247 double coeffOrZero(
const unsigned powX,
const unsigned powY,
const unsigned whichCoord)
const;
249 double determinant()
const;
265 double computeFit(
const StarMatchList &starMatchList,
const Gtransfo &InTransfo,
const bool UseErrors);
281 void computeMonomials(
double xIn,
double yIn,
double *monomial)
const;
320 GtransfoLin(
const double ox,
const double oy,
const double aa11,
const double aa12,
const double aa21,
330 double A11()
const {
return coeff(1, 0, 0); }
331 double A12()
const {
return coeff(0, 1, 0); }
332 double A21()
const {
return coeff(1, 0, 1); }
333 double A22()
const {
return coeff(0, 1, 1); }
334 double Dx()
const {
return coeff(0, 0, 0); }
335 double Dy()
const {
return coeff(0, 0, 1); }
338 double &
a11() {
return coeff(1, 0, 0); }
339 double &
a12() {
return coeff(0, 1, 0); }
340 double &
a21() {
return coeff(1, 0, 1); }
341 double &
a22() {
return coeff(0, 1, 1); }
342 double &
dx() {
return coeff(0, 0, 0); }
343 double &
dy() {
return coeff(0, 0, 1); }
350 void setDegree(
const unsigned degree);
374 GtransfoLinRot(
const double angleRad,
const Point *center =
nullptr,
const double scaleFactor = 1.0);
408 void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const;
411 Point getTangentPoint()
const;
423 Point getCrPix()
const;
429 virtual void pix2TP(
double xPixel,
double yPixel,
double &xTangentPlane,
double &yTangentPlane)
const = 0;
455 virtual void pix2TP(
double xPixel,
double yPixel,
double &xTangentPlane,
double &yTangentPlane)
const;
494 virtual void pix2TP(
double xPixel,
double yPixel,
double &xTangentPlane,
double &yTangentPlane)
const;
531 void setTangentPoint(
const Point &tangentPoint);
534 Point getTangentPoint()
const;
537 void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const;
564 typedef void(
GtransfoFun)(
const double,
const double,
double &,
double &,
const void *);
574 void apply(
const double xIn,
const double yIn,
double &xOut,
double &yOut)
const;
584 const void *_userData;
594 #endif // LSST_JOINTCAL_GTRANSFO_H virtual std::unique_ptr< Gtransfo > roughInverse(const Frame ®ion) const
Rough inverse.
Implements the (forward) SIP distorsion scheme.
implements the linear transformations (6 real coefficients).
void getParams(double *params) const
params should be at least Npar() long
std::unique_ptr< Gtransfo > gtransfoCompose(const Gtransfo *left, const Gtransfo *right)
Returns a pointer to a composition.
void apply(const double xIn, const double yIn, double &xOut, double &yOut) const
std::ostream & operator<<(std::ostream &out, CcdImageKey const &key)
void transformStar(FatPoint &in) const
allows to write MyTransfo(MyStar)
GtransfoLin(const GtransfoIdentity &)
Handy converter:
void offsetParams(Eigen::VectorXd const &delta)
void() GtransfoFun(const double, const double, double &, double &, const void *)
signature of the user-provided routine that actually does the coordinate transfo for UserTransfo...
the transformation that handles pix to sideral transfos (Gnomonic, possibly with polynomial distortio...
GtransfoLinShift(double ox=0., double oy=0.)
Add ox and oy.
virtual int getNpar() const
returns the number of parameters (to compute chi2's)
std::unique_ptr< Gtransfo > clone() const
returns a copy (allocated by new) of the transformation.
void apply(const double xIn, const double yIn, double &xOut, double &yOut) const
xOut = xIn; yOut = yIn !
GtransfoLinScale(const double scale=1)
def scale(algorithm, min, max=None, frame=None)
GtransfoLinShift(const Point &point)
bool isIdentity(const Gtransfo *gtransfo)
Shorthand test to tell if a transfo belongs to the GtransfoIdentity class.
virtual double fit(const StarMatchList &starMatchList)=0
fits a transfo to a std::list of Point pairs (p1,p2, the Point fields in StarMatch).
void write(const std::string &fileName) const
constexpr Angle operator+(Angle a, Angle d) noexcept
Polynomial transformation class.
GtransfoLin normalizeCoordinatesTransfo(const Frame &frame)
Returns the transformation that maps the input frame along both axes to [-1,1].
A Point with uncertainties.
int getNpar() const
returns the number of parameters (to compute chi2's)
virtual void paramDerivatives(const Point &where, double *dx, double *dy) const
Derivative w.r.t parameters.
GtransfoLin()
the default constructor constructs the do-nothing transformation.
bool isIntegerShift(const Gtransfo *gtransfo)
Shorthand test to tell if a transfo is a simple integer shift.
std::unique_ptr< GtransfoPoly > inversePolyTransfo(const Gtransfo &Direct, const Frame &frame, const double Prec)
approximates the inverse by a polynomial, up to required precision.
virtual void transformErrors(const Point &where, const double *vIn, double *vOut) const
transform errors (represented as double[3] in order V(xx),V(yy),Cov(xy))
std::unique_ptr< Gtransfo > clone() const
returns a copy (allocated by new) of the transformation.
just here to provide a specialized constructor, and fit.
GtransfoLinScale(const double scaleX, const double scaleY)
virtual void computeDerivative(const Point &where, GtransfoLin &derivative, const double step=0.01) const
Computes the local Derivative of a transfo, w.r.t.
rectangle with sides parallel to axes.
Class for a simple mapping implementing a generic Gtransfo.
virtual double getJacobian(const Point &point) const
returns the local jacobian.
int getNpar() const
total number of parameters
GtransfoIdentity()
constructor.
std::unique_ptr< Gtransfo > reduceCompo(const Gtransfo *right) const
to be overloaded by derived classes if they can really "reduce" the composition (e.g.
virtual double paramRef(const int i) const
virtual void transformPosAndErrors(const FatPoint &in, FatPoint &out) const
const GtransfoPoly * getCorr() const
the "correction" (non-owning pointer)
unsigned getDegree() const
returns degree
Point apply(const Point &in) const
All these apply(..) shadow the virtual one in derived classes, unless one writes "using Gtransfo::app...
A do-nothing transformation. It anyway has dummy routines to mimick a Gtransfo.
void dump(std::ostream &stream=std::cout) const
dumps the transfo coefficients to stream.
virtual GtransfoLin linearApproximation(const Point &where, const double step=0.01) const
linear (local) approximation.
just here to provide a specialized constructor, and fit.
virtual std::unique_ptr< Gtransfo > reduceCompo(const Gtransfo *right) const
to be overloaded by derived classes if they can really "reduce" the composition (e.g.
void apply(const Point &in, Point &out) const
applies the tranfo to in and writes into out. Is indeed virtual.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
double fit(const StarMatchList &starMatchList)
fits a transfo to a std::list of Point pairs (p1,p2, the Point fields in StarMatch).
constexpr Angle operator*(Angle a, Angle d) noexcept
std::unique_ptr< Gtransfo > clone() const
returns a copy (allocated by new) of the transformation.
constexpr Angle operator-(Angle a, Angle d) noexcept
just here to provide specialized constructors. GtransfoLin fit routine.
a virtual (interface) class for geometric transformations.
std::unique_ptr< GtransfoPoly > corr
a run-time transfo that allows users to define a Gtransfo with minimal coding (just the transfo routi...
std::unique_ptr< Gtransfo > gtransfoRead(const std::string &fileName)
The virtual constructor from a file.
virtual std::unique_ptr< Gtransfo > clone() const =0
returns a copy (allocated by new) of the transformation.
virtual void dump(std::ostream &stream=std::cout) const =0
dumps the transfo coefficients to stream.
int getNpar() const
total number of parameters
int getNpar() const
total number of parameters
virtual std::unique_ptr< Gtransfo > inverseTransfo(const double precision, const Frame ®ion) const
returns an inverse transfo. Numerical if not overloaded.
virtual void apply(const double xIn, const double yIn, double &xOut, double &yOut) const =0
int getNpar() const
total number of parameters