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.){};
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); };
108 std::ostream &
operator<<(std::ostream &stream,
const StarMatch &match);
132 std::shared_ptr<Gtransfo> _transfo;
140 const Gtransfo *posteriorTransfo =
nullptr)
const;
148 std::shared_ptr<const Gtransfo>
getTransfo()
const {
return _transfo; }
174 void setTransfo(std::shared_ptr<Gtransfo> gtransfo) { _transfo = std::move(gtransfo); }
193 void dumpTransfo(std::ostream &stream = std::cout)
const;
203 double computeDist2(
const StarMatchList &S,
const Gtransfo >ransfo);
206 double computeChi2(
const StarMatchList &L,
const Gtransfo >ransfo);
210 #endif // LSST_JOINTCAL_STAR_MATCH_H
double computeChi2(const Gtransfo >ransfo) const
returns the chi2 (using errors in the FatPoint's)
bool compareStar2(const StarMatch &one, const StarMatch &two)
A hanger for star associations.
double computeResidual() const
returns the average 1d Residual (last call to refineTransfo)
bool sameStar1(const StarMatch &one, const StarMatch &two)
void setDistance(const Gtransfo >ransfo)
Sets the distance (residual) field of all std::list elements. Mandatory before sorting on distances...
double getDistance() const
returns the value computed by the above one.
void setTransfo(std::shared_ptr< Gtransfo > gtransfo)
void setTransfoOrder(int order)
set transfo according to the given order.
std::unique_ptr< Gtransfo > inverseTransfo()
returns the inverse transfo (swap, fit(refineTransfo) , and swap).
int recoveredNumber(double mindist) const
count the number of elements for which distance is < mindist
std::ostream & operator<<(std::ostream &stream, const Gtransfo >ransfo)
allows 'stream << Transfo;' (by calling gtransfo.dump(stream)).
A Point with uncertainties.
double computeDistance(const Gtransfo >ransfo) const
returns the distance from gtransfo(point1) to point2.
void setDistance(const Gtransfo >ransfo)
to be used before sorting on distances.
double getChi2() const
access to the chi2 of the last call to refineTransfo.
::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.
unsigned removeAmbiguities(const Gtransfo >ransfo, int which=3)
cleans up the std::list of pairs for pairs that share one of their stars, keeping the closest one...
friend bool sameStar1(const StarMatch &one, const StarMatch &two)
double computeChi2(const StarMatchList &L, const Gtransfo >ransfo)
the actual chi2
::std::list< StarMatch >::iterator StarMatchIterator
void applyTransfo(StarMatchList &transformed, const Gtransfo *priorTransfo, const Gtransfo *posteriorTransfo=nullptr) const
enables to get a transformed StarMatchList.
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...
void refineTransfo(double nSigmas)
removes pairs beyond nSigmas in distance (where the sigma scale is set by the fit) and iterates until...
double getDist2() const
access to the sum of squared residuals of the last call to refineTransfo.
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
int getTransfoOrder() const
returns the order of the used transfo
std::shared_ptr< const BaseStar > s1
bool compareStar1(const StarMatch &one, const StarMatch &two)
friend bool compareStar1(const StarMatch &one, const StarMatch &two)
void setTransfo(const Gtransfo >ransfo)
double Distance(const Point &other) const
void swap()
swaps elements 1 and 2 of each starmatch in std::list.
virtual std::unique_ptr< Gtransfo > clone() const =0
returns a copy (allocated by new) of the transformation.
void dumpTransfo(std::ostream &stream=std::cout) const
print the matching transformation quality (transfo, chi2, residual)
std::shared_ptr< const Gtransfo > getTransfo() const
carries out a fit with outlier rejection
void cutTail(int nKeep)
deletes the tail of the match std::list
virtual void apply(const double xIn, const double yIn, double &xOut, double &yOut) const =0
bool sameStar2(const StarMatch &one, const StarMatch &two)