LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Friends | List of all members
lsst::jointcal::StarMatch Class Reference

A hanger for star associations. More...

#include <StarMatch.h>

Public Member Functions

 StarMatch (const FatPoint &point1, const FatPoint &point2, std::shared_ptr< const BaseStar > star1, std::shared_ptr< const BaseStar > star2)
 constructor. More...
 
double computeDistance (const AstrometryTransform &transform) const
 returns the distance from transform(point1) to point2. More...
 
double computeChi2 (const AstrometryTransform &transform) const
 returns the chi2 (using errors in the FatPoint's) More...
 
void setDistance (const AstrometryTransform &transform)
 to be used before sorting on distances. More...
 
double getDistance () const
 returns the value computed by the above one. More...
 
void swap ()
 
 StarMatch ()
 
 ~StarMatch ()
 

Public Attributes

FatPoint point1
 
FatPoint point2
 2 points More...
 
std::shared_ptr< const BaseStars1
 
std::shared_ptr< const BaseStars2
 
double distance
 
double chi2
 

Friends

class StarMatchList
 
std::ostreamoperator<< (std::ostream &stream, const StarMatch &Match)
 
bool compareStar1 (const StarMatch &one, const StarMatch &two)
 
bool sameStar1 (const StarMatch &one, const StarMatch &two)
 
bool compareStar2 (const StarMatch &one, const StarMatch &two)
 
bool sameStar2 (const StarMatch &one, const StarMatch &two)
 

Detailed Description

A hanger for star associations.

Definition at line 54 of file StarMatch.h.

Constructor & Destructor Documentation

◆ StarMatch() [1/2]

lsst::jointcal::StarMatch::StarMatch ( const FatPoint point1,
const FatPoint point2,
std::shared_ptr< const BaseStar star1,
std::shared_ptr< const BaseStar star2 
)
inline

constructor.

gives 2 points (that contain the geometry), plus pointers to the Star objects (which are there for user convenience).

Definition at line 69 of file StarMatch.h.

71  : point1(point1), point2(point2), s1(std::move(star1)), s2(std::move(star2)), distance(0.){};

◆ StarMatch() [2/2]

lsst::jointcal::StarMatch::StarMatch ( )
inlineexplicit

Definition at line 95 of file StarMatch.h.

95 {};

◆ ~StarMatch()

lsst::jointcal::StarMatch::~StarMatch ( )
inline

Definition at line 99 of file StarMatch.h.

99 {}

Member Function Documentation

◆ computeChi2()

double lsst::jointcal::StarMatch::computeChi2 ( const AstrometryTransform transform) const

returns the chi2 (using errors in the FatPoint's)

Definition at line 44 of file StarMatch.cc.

44  {
45  FatPoint tr;
46  transform.transformPosAndErrors(point1, tr);
47  double vxx = tr.vx + point2.vx;
48  double vyy = tr.vy + point2.vy;
49  double vxy = tr.vxy + point2.vxy;
50  double det = vxx * vyy - vxy * vxy;
51  return (vyy * sq(tr.x - point2.x) + vxx * sq(tr.y - point2.y) -
52  2 * vxy * (tr.x - point2.x) * (tr.y - point2.y)) /
53  det;
54 }

◆ computeDistance()

double lsst::jointcal::StarMatch::computeDistance ( const AstrometryTransform transform) const
inline

returns the distance from transform(point1) to point2.

Definition at line 77 of file StarMatch.h.

77  {
78  return point2.Distance(transform.apply(point1));
79  };

◆ getDistance()

double lsst::jointcal::StarMatch::getDistance ( ) const
inline

returns the value computed by the above one.

Definition at line 87 of file StarMatch.h.

87 { return distance; }

◆ setDistance()

void lsst::jointcal::StarMatch::setDistance ( const AstrometryTransform transform)
inline

to be used before sorting on distances.

Definition at line 85 of file StarMatch.h.

◆ swap()

void lsst::jointcal::StarMatch::swap ( )
inline

Definition at line 89 of file StarMatch.h.

89  {
91  std::swap(s1, s2);
92  }

Friends And Related Function Documentation

◆ compareStar1

bool compareStar1 ( const StarMatch one,
const StarMatch two 
)
friend

Definition at line 115 of file StarMatch.h.

115  {
116  return ((one.s1 == two.s1) ? (one.distance < two.distance) : (&(*one.s1) > &(*two.s1)));
117 }

◆ compareStar2

bool compareStar2 ( const StarMatch one,
const StarMatch two 
)
friend

Definition at line 121 of file StarMatch.h.

121  {
122  return ((one.s2 == two.s2) ? (one.distance < two.distance) : (&(*one.s2) > &(*two.s2)));
123 }

◆ operator<<

std::ostream& operator<< ( std::ostream stream,
const StarMatch Match 
)
friend

Definition at line 56 of file StarMatch.cc.

56  {
57  stream << match.point1.x << ' ' << match.point1.y << ' ' << match.point2.x << ' ' << match.point2.y << ' '
58  << match.distance << std::endl;
59  return stream;
60 }

◆ sameStar1

bool sameStar1 ( const StarMatch one,
const StarMatch two 
)
friend

Definition at line 119 of file StarMatch.h.

119 { return (one.s1 == two.s1); }

◆ sameStar2

bool sameStar2 ( const StarMatch one,
const StarMatch two 
)
friend

Definition at line 125 of file StarMatch.h.

125 { return (one.s2 == two.s2); }

◆ StarMatchList

friend class StarMatchList
friend

Definition at line 55 of file StarMatch.h.

Member Data Documentation

◆ chi2

double lsst::jointcal::StarMatch::chi2

Definition at line 64 of file StarMatch.h.

◆ distance

double lsst::jointcal::StarMatch::distance

Definition at line 63 of file StarMatch.h.

◆ point1

FatPoint lsst::jointcal::StarMatch::point1

Definition at line 60 of file StarMatch.h.

◆ point2

FatPoint lsst::jointcal::StarMatch::point2

2 points

the Star pointers (the pointer is in fact generic, pointed data is never used).

Definition at line 60 of file StarMatch.h.

◆ s1

std::shared_ptr<const BaseStar> lsst::jointcal::StarMatch::s1

Definition at line 62 of file StarMatch.h.

◆ s2

std::shared_ptr<const BaseStar> lsst::jointcal::StarMatch::s2

Definition at line 62 of file StarMatch.h.


The documentation for this class was generated from the following files:
lsst::jointcal::StarMatch::point2
FatPoint point2
2 points
Definition: StarMatch.h:60
lsst::jointcal::FatPoint::vxy
double vxy
Definition: FatPoint.h:36
std::move
T move(T... args)
lsst::jointcal::StarMatch::s1
std::shared_ptr< const BaseStar > s1
Definition: StarMatch.h:62
lsst::jointcal::Point::y
double y
Definition: Point.h:41
lsst::jointcal::StarMatch::computeDistance
double computeDistance(const AstrometryTransform &transform) const
returns the distance from transform(point1) to point2.
Definition: StarMatch.h:77
lsst::jointcal::StarMatch::s2
std::shared_ptr< const BaseStar > s2
Definition: StarMatch.h:62
lsst::jointcal::Point::Distance
double Distance(const Point &other) const
Definition: Point.h:50
lsst::jointcal::FatPoint::vx
double vx
Definition: FatPoint.h:36
std::swap
T swap(T... args)
lsst::afw::detection
Definition: Footprint.h:50
std::endl
T endl(T... args)
lsst::jointcal::FatPoint::vy
double vy
Definition: FatPoint.h:36
transform
table::Key< int > transform
Definition: TransformMap.cc:299
lsst::jointcal::StarMatch::distance
double distance
Definition: StarMatch.h:63
lsst::jointcal::StarMatch::point1
FatPoint point1
Definition: StarMatch.h:60
lsst::jointcal::Point::x
double x
coordinate
Definition: Point.h:41