source: trunk/Mars/mpointing/MPointingPos.h@ 19630

Last change on this file since 19630 was 18560, checked in by tbretz, 8 years ago
Added some unit infomration for the fits file, added the function to setup reading from the fits file.
File size: 2.4 KB
Line 
1#ifndef MARS_MPointingPos
2#define MARS_MPointingPos
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8// FIXME: Should not be here... (ZdAz)
9#ifndef MARS_MPointing
10#include "MPointing.h"
11#endif
12
13class fits;
14class MTime;
15class MObservatory;
16class MPointingDev;
17
18class MPointingPos : public MParContainer
19{
20private:
21 static const TString gsDefName;
22 static const TString gsDefTitle;
23
24 Double_t fZd; // [deg] Zenith distance (ZA) {fits: unit=deg}
25 Double_t fAz; // [deg] Azimuth {fits: unit=deg}
26
27 Double_t fRa; // [h] Right ascension {fits: unit=h}
28 Double_t fHa; // [h] Hour angle {fits: unit=h}
29 Double_t fDec; // [deg] Declination {fits: unit=deg}
30
31 // Hour angle!
32 // Angle to magnetic field!
33
34public:
35 MPointingPos(const char *name=0, const char *title=0) : fZd(0), fAz(0), fRa(0), fHa(0), fDec(0)
36 {
37 fName = name ? (TString)name : gsDefName;
38 fTitle = title ? (TString)title : gsDefTitle;
39 }
40 MPointingPos(const MPointingPos &p) : MParContainer(p),
41 fZd(p.fZd), fAz(p.fAz), fRa(p.fRa), fHa(p.fHa), fDec(p.fDec)
42 {
43 }
44
45 Bool_t IsInitialized() const { return !(fZd==0 && fAz==0 && fRa==0 && fHa==0 && fDec==0); }
46
47 void Print(Option_t *o="") const;
48
49 TString GetString(Option_t *o="") const;
50
51 void SetLocalPosition(Double_t zd, Double_t az) { fZd=zd; fAz=az; }
52 void SetSkyPosition(Double_t ra, Double_t dec, Double_t ha=0) { fRa=ra; fDec=dec; fHa=ha; }
53
54 Double_t GetZd() const { return fZd; }
55 Double_t GetAz() const { return fAz; }
56
57 Double_t GetZdRad() const;// { return fZd*TMath::DegToRad(); }
58 Double_t GetAzRad() const;// { return fAz*TMath::DegToRad(); }
59
60 ZdAz GetZdAz() const { return ZdAz(fZd, fAz); }
61
62 Double_t GetRa() const { return fRa; }
63 Double_t GetHa() const { return fHa; }
64 Double_t GetDec() const { return fDec; }
65
66 Double_t GetRaRad() const;// { return fRa*TMath::DegToRad()*15; }
67 Double_t GetDecRad() const;// { return fDec*TMath::DegToRad(); }
68
69 Double_t RotationAngle(const MObservatory &o) const;
70 Double_t RotationAngle(const MObservatory &o, const MTime &t, const MPointingDev *dev=0) const;
71 Double_t RotationAngle(const MObservatory &o, const MTime *t) const
72 {
73 return t ? RotationAngle(o, *t) : RotationAngle(o);
74 }
75
76 Bool_t SetupFits(fits &fin);
77
78 ClassDef(MPointingPos, 1) //Container storing the (corrected) telescope pointing position
79};
80
81#endif
Note: See TracBrowser for help on using the repository browser.