lsst.jointcal  master-gc5b79683b0+1
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 void dump(std::ostream &stream = std::cout) const {
52  stream << "x: " << x << " y: " << y << " flux: " << _flux << " fluxErr: " << _fluxErr;
53  }
54 
55  BaseStar &operator=(Point const &point) {
56  x = point.x;
57  y = point.y;
58  return (*this);
59  };
60 
61  static const char *typeName() { return "BaseStar"; }
62 
63  virtual ~BaseStar(){};
64 
65  double getFlux() const { return _flux; }
66  double &getFlux() { return _flux; }
67  void setFlux(double flux) { _flux = flux; }
68 
69  double getFluxErr() const { return _fluxErr; }
70  void setFluxErr(double fluxErr) { _fluxErr = fluxErr; }
71 };
72 
74 bool decreasingFlux(BaseStar const *star1, BaseStar const *star2);
75 
76 int decodeFormat(char const *formatLine, char const *starName);
77 
79 
80 typedef BaseStarList::const_iterator BaseStarCIterator;
81 typedef BaseStarList::iterator BaseStarIterator;
82 }
83 } // namespace lsst
84 
85 #endif // LSST_JOINTCAL_BASE_STAR_H
BaseStarList::const_iterator BaseStarCIterator
Definition: BaseStar.h:80
double getX() const
access stuff.
Definition: BaseStar.h:41
virtual void dump(std::ostream &stream=std::cout) const
utility
Definition: BaseStar.h:51
A point in a plane.
Definition: Point.h:13
StarList< BaseStar > BaseStarList
Definition: BaseStar.h:78
int decodeFormat(char const *formatLine, char const *starName)
Definition: BaseStar.cc:24
BaseStarList::iterator BaseStarIterator
Definition: BaseStar.h:81
double getFluxErr() const
Definition: BaseStar.h:69
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:55
static const char * typeName()
Definition: BaseStar.h:61
double getFlux() const
Definition: BaseStar.h:65
void setFluxErr(double fluxErr)
Definition: BaseStar.h:70
double getY() const
Definition: BaseStar.h:43
void setFlux(double flux)
Definition: BaseStar.h:67
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