LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
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 (FatPoint point1, 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 ()=default
 
 ~StarMatch ()=default
 

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 55 of file StarMatch.h.

Constructor & Destructor Documentation

◆ StarMatch() [1/2]

lsst::jointcal::StarMatch::StarMatch ( FatPoint  point1,
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 70 of file StarMatch.h.

std::shared_ptr< const BaseStar > s1
Definition: StarMatch.h:63
std::shared_ptr< const BaseStar > s2
Definition: StarMatch.h:63
FatPoint point2
2 points
Definition: StarMatch.h:61
T move(T... args)

◆ StarMatch() [2/2]

lsst::jointcal::StarMatch::StarMatch ( )
explicitdefault

◆ ~StarMatch()

lsst::jointcal::StarMatch::~StarMatch ( )
default

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 43 of file StarMatch.cc.

43 {
44 FatPoint tr;
45 transform.transformPosAndErrors(point1, tr);
46 double vxx = tr.vx + point2.vx;
47 double vyy = tr.vy + point2.vy;
48 double vxy = tr.vxy + point2.vxy;
49 double det = vxx * vyy - vxy * vxy;
50 return (vyy * sq(tr.x - point2.x) + vxx * sq(tr.y - point2.y) -
51 2 * vxy * (tr.x - point2.x) * (tr.y - point2.y)) /
52 det;
53}
table::Key< int > transform
double x
coordinate
Definition: Point.h:42

◆ computeDistance()

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

returns the distance from transform(point1) to point2.

Definition at line 78 of file StarMatch.h.

78 {
79 return point2.Distance(transform.apply(point1));
80 };
double Distance(const Point &other) const
Definition: Point.h:51

◆ getDistance()

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

returns the value computed by the above one.

Definition at line 88 of file StarMatch.h.

88{ return distance; }

◆ setDistance()

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

to be used before sorting on distances.

Definition at line 86 of file StarMatch.h.

double computeDistance(const AstrometryTransform &transform) const
returns the distance from transform(point1) to point2.
Definition: StarMatch.h:78

◆ swap()

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

Definition at line 90 of file StarMatch.h.

90 {
92 std::swap(s1, s2);
93 }
T swap(T... args)

Friends And Related Function Documentation

◆ compareStar1

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

Definition at line 116 of file StarMatch.h.

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

◆ compareStar2

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

Definition at line 122 of file StarMatch.h.

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

◆ operator<<

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

Definition at line 55 of file StarMatch.cc.

55 {
56 stream << match.point1.x << ' ' << match.point1.y << ' ' << match.point2.x << ' ' << match.point2.y << ' '
57 << match.distance << std::endl;
58 return stream;
59}
T endl(T... args)

◆ sameStar1

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

Definition at line 120 of file StarMatch.h.

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

◆ sameStar2

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

Definition at line 126 of file StarMatch.h.

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

◆ StarMatchList

friend class StarMatchList
friend

Definition at line 56 of file StarMatch.h.

Member Data Documentation

◆ chi2

double lsst::jointcal::StarMatch::chi2 {}

Definition at line 65 of file StarMatch.h.

◆ distance

double lsst::jointcal::StarMatch::distance {}

Definition at line 64 of file StarMatch.h.

◆ point1

FatPoint lsst::jointcal::StarMatch::point1

Definition at line 61 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 61 of file StarMatch.h.

◆ s1

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

Definition at line 63 of file StarMatch.h.

◆ s2

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

Definition at line 63 of file StarMatch.h.


The documentation for this class was generated from the following files: