2 #ifndef LSST_JOINTCAL_STAR_MATCH_H 3 #define LSST_JOINTCAL_STAR_MATCH_H 38 std::shared_ptr<const BaseStar>
s1,
s2;
48 std::shared_ptr<const BaseStar> star2)
49 : point1(point1), point2(point2), s1(
std::move(star1)), s2(
std::move(star2)), distance(0.){};
68 std::swap(point1, point2);
84 bool operator==(
const StarMatch &other)
const {
return (s1 == other.
s1 && s2 == other.
s2); };
85 bool operator!=(
const StarMatch &other)
const {
return (s1 != other.
s1 || s2 != other.
s2); };
132 std::shared_ptr<Gtransfo> _transfo;
135 void refineTransfo(
double nSigmas);
140 const Gtransfo *posteriorTransfo =
nullptr)
const;
148 std::shared_ptr<const Gtransfo>
getTransfo()
const {
return _transfo; }
163 double computeResidual()
const;
174 void setTransfo(std::shared_ptr<Gtransfo> gtransfo) { _transfo = std::move(gtransfo); }
177 void setTransfoOrder(
int order);
181 std::unique_ptr<Gtransfo> inverseTransfo();
187 void cutTail(
int nKeep);
190 int recoveredNumber(
double mindist)
const;
193 void dumpTransfo(std::ostream &stream = std::cout)
const;
210 #endif // LSST_JOINTCAL_STAR_MATCH_H
A hanger for star associations.
friend class StarMatchList
double computeChi2(const Gtransfo >ransfo) const
returns the chi2 (using errors in the FatPoint's)
void setTransfo(std::shared_ptr< Gtransfo > gtransfo)
double computeDistance(const Gtransfo >ransfo) const
returns the distance from gtransfo(point1) to point2.
double Distance(const Point &other) const
A Point with uncertainties.
void setDistance(const Gtransfo >ransfo)
to be used before sorting on distances.
double getDist2() const
access to the sum of squared residuals of the last call to refineTransfo.
double getChi2() const
access to the chi2 of the last call to refineTransfo.
std::shared_ptr< const Gtransfo > getTransfo() const
carries out a fit with outlier rejection
Class for a simple mapping implementing a generic Gtransfo.
int getTransfoOrder() const
returns the order of the used transfo
::std::list< StarMatch >::const_iterator StarMatchCIterator
friend bool sameStar2(const StarMatch &one, const StarMatch &two)
StarMatch(const FatPoint &point1, const FatPoint &point2, std::shared_ptr< const BaseStar > star1, std::shared_ptr< const BaseStar > star2)
constructor.
friend bool sameStar1(const StarMatch &one, const StarMatch &two)
::std::list< StarMatch >::iterator StarMatchIterator
friend bool compareStar2(const StarMatch &one, const StarMatch &two)
void setTransfo(const Gtransfo *gtransfo)
sets a transfo between the 2 std::lists and deletes the previous or default one. No fit...
friend std::ostream & operator<<(std::ostream &stream, const StarMatch &Match)
double computeDist2(const StarMatchList &S, const Gtransfo >ransfo)
sum of distance squared
a virtual (interface) class for geometric transformations.
std::shared_ptr< const BaseStar > s2
std::shared_ptr< const BaseStar > s1
Frame applyTransfo(const Frame &inputframe, const Gtransfo >ransfo, const WhichTransformed which)
Transform a Frame through a Transfo.
friend bool compareStar1(const StarMatch &one, const StarMatch &two)
void setTransfo(const Gtransfo >ransfo)
virtual std::unique_ptr< Gtransfo > clone() const =0
returns a copy (allocated by new) of the transformation.
virtual void apply(const double xIn, const double yIn, double &xOut, double &yOut) const =0
double getDistance() const
returns the value computed by the above one.