lsst.jointcal  master-gc935ebf72c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FittedStar.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 
4 #include "lsst/log/Log.h"
10 
11 namespace {
12 LOG_LOGGER _log = LOG_GET("jointcal.FastFinder");
13 }
14 
15 namespace lsst {
16 namespace jointcal {
17 
18 // cannot be in fittedstar.h, because of "crossed includes"
20  : BaseStar(measuredStar),
21  _mag(measuredStar.getMag()),
22  _emag(-1),
23  _col(0.),
24  _gen(-1),
25  _wmag(measuredStar.getMagWeight()),
26  _indexInMatrix(-1),
27  _measurementCount(0),
28  _refStar(nullptr),
29  _flux2(-1),
30  _fluxErr2(-1) {
31  _fluxErr = measuredStar.eflux;
32 }
33 
34 void FittedStar::setRefStar(const RefStar *refStar) {
35  if ((_refStar != nullptr) && (refStar != nullptr)) {
36  // TODO: should we raise an Exception in this case?
37  LOGLS_WARN(_log,
38  "FittedStar: " << *this << " is already matched to another RefStar. Clean up your lists.");
39  LOGLS_WARN(_log, "old refStar: " << *_refStar);
40  LOGLS_WARN(_log, "new refStar: " << *refStar);
41  } else
42  _refStar = refStar;
43 }
44 
45 void FittedStar::addMagMeasurement(double magValue, double magWeight) {
46  _mag = (_mag * _wmag + magValue * magWeight) / (_wmag + magWeight);
47  _wmag += magWeight;
48 }
49 
50 /************* FittedStarList ************************/
51 
53 
55 
56 const BaseStarList &Fitted2Base(const FittedStarList &This) { return (const BaseStarList &)This; }
57 
58 const BaseStarList *Fitted2Base(const FittedStarList *This) { return (BaseStarList *)This; }
59 } // namespace jointcal
60 } // namespace lsst
Objects used as position anchors, typically USNO stars.
Definition: RefStar.h:16
void addMagMeasurement(double magValue, double magWeight)
this routine will hopefully soon disappear.
Definition: FittedStar.cc:45
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:26
std::lists of Stars.
Definition: StarList.h:35
void setRefStar(const RefStar *_refStar)
Set the astrometric reference star associated with this star.
Definition: FittedStar.cc:34
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:134
objects measured on actual images.
Definition: MeasuredStar.h:18
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:52