lsst.jointcal  16.0-18-gdf247dd+5
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), _indexInMatrix(-1), _measurementCount(0), _refStar(nullptr) {}
21 
22 void FittedStar::setRefStar(const RefStar *refStar) {
23  if ((_refStar != nullptr) && (refStar != nullptr)) {
24  // TODO: should we raise an Exception in this case?
25  LOGLS_WARN(_log,
26  "FittedStar: " << *this << " is already matched to another RefStar. Clean up your lists.");
27  LOGLS_WARN(_log, "old refStar: " << *_refStar);
28  LOGLS_WARN(_log, "new refStar: " << *refStar);
29  } else
30  _refStar = refStar;
31 }
32 
33 void FittedStar::addMagMeasurement(double magValue, double magWeight) {
34  _mag = (_mag * _magErr + magValue * magWeight) / (_magErr + magWeight);
35  _magErr += magWeight;
36 }
37 
38 /************* FittedStarList ************************/
39 
41 
43 
44 const BaseStarList &Fitted2Base(const FittedStarList &This) { return (const BaseStarList &)This; }
45 
46 const BaseStarList *Fitted2Base(const FittedStarList *This) { return (BaseStarList *)This; }
47 } // namespace jointcal
48 } // 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)
Add a measuredStar on-sky magnitude.
Definition: FittedStar.cc:33
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:27
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:22
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:99
objects measured on actual images.
Definition: MeasuredStar.h:19
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:40
#define LOG_GET(logger)