source: releases/Mars.2014.05.26/mastro/MObservatory.h@ 19594

Last change on this file since 19594 was 8337, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.8 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=NULL, const char *title=NULL);
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 MObservatory(Double_t lon, Double_t lat, const char *name="<n/a>");
40 MObservatory(Double_t lon, Double_t lat, Double_t h, const char *name="<n/a>");
41
42 void Copy(TObject &obj) const
43 {
44 MObservatory &obs = (MObservatory&)obj;
45 obs.fObservatoryName = fObservatoryName;
46 obs.fLongitude = fLongitude;
47 obs.fLatitude = fLatitude;
48 obs.fSinLatitude = fSinLatitude;
49 obs.fCosLatitude = fCosLatitude;
50 obs.fHeight = fHeight;
51 }
52
53 void SetLocation(LocationName_t name);
54 void SetLocation(Double_t lon, Double_t lat, Double_t h=0, const char *name=NULL);
55
56 void Print(Option_t *o=0) const;
57
58 const TString &GetObservatoryName() const { return fObservatoryName; }
59
60 Double_t GetLatitudeDeg() const { return fLatitude*kRad2Deg; } //[deg]
61 Double_t GetLongitudeDeg() const { return fLongitude*kRad2Deg; } //[deg]
62
63 Double_t GetLatitudeRad() const { return fLatitude; } //[rad]
64 Double_t GetLongitudeRad() const { return fLongitude; } //[rad]
65
66 Double_t GetPhi() const { return fLatitude; } //[rad]
67 Double_t GetElong() const { return fLongitude; } //[rad]
68
69 Double_t GetSinPhi() const { return fSinLatitude; }
70 Double_t GetCosPhi() const { return fCosLatitude; }
71
72 Double_t GetHeight() const { return fHeight; }
73
74 TArrayD GetSunRiseSet(Double_t mjd, Double_t alt=0) const;
75
76 void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const;
77 Double_t RotationAngle(Double_t theta, Double_t phi) const;
78
79 LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
80
81 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
82
83 ClassDef(MObservatory, 0) // class storing observatory locations
84};
85
86#endif
Note: See TracBrowser for help on using the repository browser.