25#ifndef LSST_JOINTCAL_STAR_MATCH_H
26#define LSST_JOINTCAL_STAR_MATCH_H
107 bool operator==(
const StarMatch &other)
const {
return (
s1 == other.
s1 &&
s2 == other.
s2); };
108 bool operator!=(
const StarMatch &other)
const {
return (
s1 != other.
s1 ||
s2 != other.
s2); };
224double computeDist2(
const StarMatchList &S,
const AstrometryTransform &transform);
227double computeChi2(
const StarMatchList &L,
const AstrometryTransform &transform);
A Point with uncertainties.
double Distance(const Point &other) const
A hanger for star associations.
double computeChi2(const AstrometryTransform &transform) const
returns the chi2 (using errors in the FatPoint's)
std::shared_ptr< const BaseStar > s1
std::shared_ptr< const BaseStar > s2
StarMatch(FatPoint point1, FatPoint point2, std::shared_ptr< const BaseStar > star1, std::shared_ptr< const BaseStar > star2)
constructor.
friend std::ostream & operator<<(std::ostream &stream, const StarMatch &Match)
void setDistance(const AstrometryTransform &transform)
to be used before sorting on distances.
friend bool sameStar2(const StarMatch &one, const StarMatch &two)
double computeDistance(const AstrometryTransform &transform) const
returns the distance from transform(point1) to point2.
double getDistance() const
returns the value computed by the above one.
friend bool compareStar2(const StarMatch &one, const StarMatch &two)
friend bool sameStar1(const StarMatch &one, const StarMatch &two)
friend bool compareStar1(const StarMatch &one, const StarMatch &two)
void operator=(const StarMatchList &)=delete
std::unique_ptr< AstrometryTransform > inverseTransform()
returns the inverse transform (swap, fit(refineTransform) , and swap).
void setDistance(const AstrometryTransform &transform)
Sets the distance (residual) field of all std::list elements. Mandatory before sorting on distances.
void setTransform(const AstrometryTransform &transform)
void printTransform(std::ostream &stream=std::cout) const
print the matching transformation quality (transform, chi2, residual)
void swap()
swaps elements 1 and 2 of each starmatch in std::list.
double getChi2() const
access to the chi2 of the last call to refineTransform.
void setTransform(std::shared_ptr< AstrometryTransform > transform)
int getTransformOrder() const
returns the order of the used transform
std::shared_ptr< const AstrometryTransform > getTransform() const
carries out a fit with outlier rejection
StarMatchList(const StarMatchList &)=delete
void setTransform(const AstrometryTransform *transform)
sets a transform between the 2 std::lists and deletes the previous or default one....
int recoveredNumber(double mindist) const
count the number of elements for which distance is < mindist
void setTransformOrder(int order)
set transform according to the given order.
double computeResidual() const
returns the average 1d Residual (last call to refineTransform)
unsigned removeAmbiguities(const AstrometryTransform &transform, int which=3)
cleans up the std::list of pairs for pairs that share one of their stars, keeping the closest one.
double getDist2() const
access to the sum of squared residuals of the last call to refineTransform.
void cutTail(int nKeep)
deletes the tail of the match std::list
void applyTransform(StarMatchList &transformed, const AstrometryTransform *priorTransform, const AstrometryTransform *posteriorTransform=nullptr) const
enables to get a transformed StarMatchList.
void refineTransform(double nSigmas)
removes pairs beyond nSigmas in distance (where the sigma scale is set by the fit) and iterates until...
bool compareStar1(const StarMatch &one, const StarMatch &two)
bool sameStar2(const StarMatch &one, const StarMatch &two)
bool sameStar1(const StarMatch &one, const StarMatch &two)
bool compareStar2(const StarMatch &one, const StarMatch &two)
double computeDist2(const StarMatchList &S, const AstrometryTransform &transform)
sum of distance squared
double computeChi2(const StarMatchList &L, const AstrometryTransform &transform)
the actual chi2
::std::list< StarMatch >::iterator StarMatchIterator
std::ostream & operator<<(std::ostream &stream, AstrometryMapping const &mapping)
::std::list< StarMatch >::const_iterator StarMatchCIterator