lsst.jointcal  14.0-25-g01ea59d+2
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 public:
25  x = 0;
26  y = 0;
27  _flux = 0;
28  };
30  BaseStar(double xx, double yy, double flux, double fluxErr)
31  : FatPoint(xx, yy), _flux(flux), _fluxErr(fluxErr){};
32  BaseStar(Point const &point, double flux, double fluxErr)
33  : FatPoint(point), _flux(flux), _fluxErr(fluxErr){};
34 
36  double getX() const { return x; }
38  double getY() const { return y; }
39 
41  friend std::ostream &operator<<(std::ostream &stream, BaseStar const &s) {
42  s.dump(stream);
43  return stream;
44  }
45 
46  virtual void dump(std::ostream &stream = std::cout) const {
47  stream << "x: " << x << " y: " << y << " flux: " << _flux << " fluxErr: " << _fluxErr;
48  }
49 
50  BaseStar &operator=(Point const &point) {
51  x = point.x;
52  y = point.y;
53  return (*this);
54  };
55 
56  static const char *typeName() { return "BaseStar"; }
57 
58  virtual ~BaseStar(){};
59 
60  double getFlux() const { return _flux; }
61  double &getFlux() { return _flux; }
62  void setFlux(double flux) { _flux = flux; }
63 
64  double getFluxErr() const { return _fluxErr; }
65  void setFluxErr(double fluxErr) { _fluxErr = fluxErr; }
66 
67 protected:
68  // on-sky flux, in Maggies
69  double _flux;
70  double _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:36
virtual void dump(std::ostream &stream=std::cout) const
utility
Definition: BaseStar.h:46
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:64
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.
BaseStar & operator=(Point const &point)
Definition: BaseStar.h:50
static const char * typeName()
Definition: BaseStar.h:56
double getFlux() const
Definition: BaseStar.h:60
void setFluxErr(double fluxErr)
Definition: BaseStar.h:65
double getY() const
Definition: BaseStar.h:38
void setFlux(double flux)
Definition: BaseStar.h:62
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:32
friend std::ostream & operator<<(std::ostream &stream, BaseStar const &s)
allows std::cout << aBaseStar;
Definition: BaseStar.h:41
STL class.
BaseStar(double xx, double yy, double flux, double fluxErr)
constructor
Definition: BaseStar.h:30