lsst.jointcal  master-ga8493ae4fe+5
BaseStar.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_BASE_STAR_H
3 #define LSST_JOINTCAL_BASE_STAR_H
4 
5 #include <iostream>
6 #include <cstdio>
7 #include <string>
8 #include <sstream>
9 
10 #include "lsst/jointcal/FatPoint.h"
11 #include "lsst/jointcal/StarList.h"
12 
13 namespace lsst {
14 namespace jointcal {
15 
16 #define MEMPIX2DISK 1
17 
18 #define DECALAGE_IJ_XY 0.
19 #define DECALAGE_XY_IJ 0.
20 
22 class BaseStar : public FatPoint {
23 protected:
24  // on-sky flux, in Maggies
25  double _flux;
26  double _fluxErr;
27 
28 public:
30  x = 0;
31  y = 0;
32  _flux = 0;
33  };
35  BaseStar(double xx, double yy, double flux, double fluxErr)
36  : FatPoint(xx, yy), _flux(flux), _fluxErr(fluxErr){};
37  BaseStar(Point const &point, double flux, double fluxErr)
38  : FatPoint(point), _flux(flux), _fluxErr(fluxErr){};
39 
41  double getX() const { return x; }
43  double getY() const { return y; }
44 
46  friend std::ostream &operator<<(std::ostream &stream, BaseStar const &s) {
47  s.dump(stream);
48  return stream;
49  }
50 
51  virtual std::string __str__() const {
52  std::stringstream s;
53  dump(s);
54  return s.str();
55  }
56 
57  virtual void dump(std::ostream &stream = std::cout) const {
58  stream << "x: " << x << " y: " << y << " flux: " << _flux << " fluxErr: " << _fluxErr;
59  }
60 
61  BaseStar &operator=(Point const &point) {
62  this->x = point.x;
63  this->y = point.y;
64  return (*this);
65  };
66 
67  static const char *typeName() { return "BaseStar"; }
68 
69  virtual ~BaseStar(){};
70 
71  double getFlux() const { return _flux; }
72  double &getFlux() { return _flux; }
73  void setFlux(double flux) { _flux = flux; }
74 
75  double getFluxErr() const { return _fluxErr; }
76  void setFluxErr(double fluxErr) { _fluxErr = fluxErr; }
77 };
78 
80 bool decreasingFlux(BaseStar const *star1, BaseStar const *star2);
81 
82 int decodeFormat(char const *formatLine, char const *starName);
83 
85 
86 typedef BaseStarList::const_iterator BaseStarCIterator;
87 typedef BaseStarList::iterator BaseStarIterator;
88 }
89 } // namespace lsst
90 
91 #endif // LSST_JOINTCAL_BASE_STAR_H
virtual std::string __str__() const
Definition: BaseStar.h:51
BaseStarList::const_iterator BaseStarCIterator
Definition: BaseStar.h:86
double getX() const
access stuff.
Definition: BaseStar.h:41
virtual void dump(std::ostream &stream=std::cout) const
utility
Definition: BaseStar.h:57
A point in a plane.
Definition: Point.h:13
StarList< BaseStar > BaseStarList
Definition: BaseStar.h:84
int decodeFormat(char const *formatLine, char const *starName)
Definition: BaseStar.cc:24
BaseStarList::iterator BaseStarIterator
Definition: BaseStar.h:87
double getFluxErr() const
Definition: BaseStar.h:75
A Point with uncertainties.
Definition: FatPoint.h:11
double x
coordinate
Definition: Point.h:18
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.
Definition: Associations.h:24
BaseStar & operator=(Point const &point)
Definition: BaseStar.h:61
static const char * typeName()
Definition: BaseStar.h:67
double getFlux() const
Definition: BaseStar.h:71
void setFluxErr(double fluxErr)
Definition: BaseStar.h:76
double getY() const
Definition: BaseStar.h:43
void setFlux(double flux)
Definition: BaseStar.h:73
bool decreasingFlux(BaseStar const *star1, BaseStar const *star2)
enables to sort easily a starList (of anything that derives from BaseStar)
Definition: BaseStar.cc:14
BaseStar(Point const &point, double flux, double fluxErr)
Definition: BaseStar.h:37
friend std::ostream & operator<<(std::ostream &stream, BaseStar const &s)
allows std::cout << aBaseStar;
Definition: BaseStar.h:46
BaseStar(double xx, double yy, double flux, double fluxErr)
constructor
Definition: BaseStar.h:35