lsst.jointcal  14.0-19-g0e46020+6
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  _gen(-1),
23  _wmag(measuredStar.getMagWeight()),
24  _indexInMatrix(-1),
25  _measurementCount(0),
26  _refStar(nullptr) {
27  _fluxErr = measuredStar.getInstFluxErr();
28 }
29 
30 void FittedStar::setRefStar(const RefStar *refStar) {
31  if ((_refStar != nullptr) && (refStar != nullptr)) {
32  // TODO: should we raise an Exception in this case?
33  LOGLS_WARN(_log,
34  "FittedStar: " << *this << " is already matched to another RefStar. Clean up your lists.");
35  LOGLS_WARN(_log, "old refStar: " << *_refStar);
36  LOGLS_WARN(_log, "new refStar: " << *refStar);
37  } else
38  _refStar = refStar;
39 }
40 
41 void FittedStar::addMagMeasurement(double magValue, double magWeight) {
42  _mag = (_mag * _wmag + magValue * magWeight) / (_wmag + magWeight);
43  _wmag += magWeight;
44 }
45 
46 /************* FittedStarList ************************/
47 
49 
51 
52 const BaseStarList &Fitted2Base(const FittedStarList &This) { return (const BaseStarList &)This; }
53 
54 const BaseStarList *Fitted2Base(const FittedStarList *This) { return (BaseStarList *)This; }
55 } // namespace jointcal
56 } // namespace lsst
#define LOGLS_WARN(logger, message)
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:41
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:22
std::lists of Stars.
Definition: StarList.h:35
Class for a simple mapping implementing a generic Gtransfo.
void setRefStar(const RefStar *_refStar)
Set the astrometric reference star associated with this star.
Definition: FittedStar.cc:30
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:121
double getInstFluxErr() const
Definition: MeasuredStar.h:69
objects measured on actual images.
Definition: MeasuredStar.h:18
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:48
#define LOG_GET(logger)