source: tags/Mars-V0.10.3/mastro/MObservatory.h

Last change on this file was 8066, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.5 KB
Line 
1#ifndef MARS_MObservatory
2#define MARS_MObservatory
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class MTime;
9class TArrayD;
10
11class MObservatory : public MParContainer
12{
13public:
14 enum LocationName_t
15 {
16 kMagic1,
17 kWuerzburgCity,
18 kTuorla
19 };
20
21private:
22 LocationName_t fObservatoryKey; //!
23
24 TString fObservatoryName; //! Name of the observatory
25
26 Double_t fLongitude; //! [rad] Longitude of observatory (+ east)
27 Double_t fLatitude; //! [rad] Latitude of observatory (+ north)
28
29 Double_t fSinLatitude; //! Sin component for faster access
30 Double_t fCosLatitude; //! Cos component for faster access
31
32 Double_t fHeight; //! [m] height of observatory
33
34 void Init(const char *name, const char *title);
35
36public:
37 MObservatory(const char *name=NULL, const char *title=NULL);
38 MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL);
39
40 void Copy(TObject &obj) const
41 {
42 MObservatory &obs = (MObservatory&)obj;
43 obs.fObservatoryName = fObservatoryName;
44 obs.fLongitude = fLongitude;
45 obs.fLatitude = fLatitude;
46 obs.fSinLatitude = fSinLatitude;
47 obs.fCosLatitude = fCosLatitude;
48 obs.fHeight = fHeight;
49 }
50
51 void SetLocation(LocationName_t name);
52
53 void Print(Option_t *o=0) const;
54
55 const TString &GetObservatoryName() const { return fObservatoryName; }
56
57 Double_t GetLatitudeDeg() const { return fLatitude*kRad2Deg; } //[deg]
58 Double_t GetLongitudeDeg() const { return fLongitude*kRad2Deg; } //[deg]
59
60 Double_t GetLatitudeRad() const { return fLatitude; } //[rad]
61 Double_t GetLongitudeRad() const { return fLongitude; } //[rad]
62
63 Double_t GetPhi() const { return fLatitude; } //[rad]
64 Double_t GetElong() const { return fLongitude; } //[rad]
65
66 Double_t GetSinPhi() const { return fSinLatitude; }
67 Double_t GetCosPhi() const { return fCosLatitude; }
68
69 Double_t GetHeight() const { return fHeight; }
70
71 TArrayD GetSunRiseSet(Double_t mjd, Double_t alt=0) const;
72
73 void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const;
74 Double_t RotationAngle(Double_t theta, Double_t phi) const;
75
76 LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
77
78 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
79
80 ClassDef(MObservatory, 0) // class storing observatory locations
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.