| 1 | #ifndef MARS_MAstro
|
|---|
| 2 | #define MARS_MAstro
|
|---|
| 3 |
|
|---|
| 4 | #ifndef ROOT_TROOT
|
|---|
| 5 | #include <TROOT.h>
|
|---|
| 6 | #endif
|
|---|
| 7 | #ifndef ROOT_TVector2
|
|---|
| 8 | #include <TVector2.h>
|
|---|
| 9 | #endif
|
|---|
| 10 |
|
|---|
| 11 | class TVector3;
|
|---|
| 12 | class MTime;
|
|---|
| 13 |
|
|---|
| 14 | class MAstro
|
|---|
| 15 | {
|
|---|
| 16 | private:
|
|---|
| 17 | static Double_t Round(Double_t val);
|
|---|
| 18 | static Double_t Trunc(Double_t val);
|
|---|
| 19 |
|
|---|
| 20 | static Double_t Kepler(Double_t m, Double_t ecc);
|
|---|
| 21 |
|
|---|
| 22 | public:
|
|---|
| 23 | virtual ~MAstro() { }
|
|---|
| 24 |
|
|---|
| 25 | // Unit conversion
|
|---|
| 26 | static Double_t Parsec2Meter() { return 3.0856776e+16; }
|
|---|
| 27 | static Double_t Parsec2Lighyear() { return 3.2615644; }
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | // Angle/Time conversion functions
|
|---|
| 31 | static Double_t Hms2Sec(Int_t deg, UInt_t min, Double_t sec, char sgn='+');
|
|---|
| 32 | static Double_t Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 33 | static Double_t Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 34 | static Double_t Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 35 | static Double_t Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 36 | static Double_t Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 37 | static Double_t Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');
|
|---|
| 38 |
|
|---|
| 39 | static void Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec);
|
|---|
| 40 | static void Rad2Dms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);
|
|---|
| 41 | static void Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec);
|
|---|
| 42 | static void Deg2Dms(Double_t deg, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);
|
|---|
| 43 | static void Deg2Hms(Double_t deg, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec);
|
|---|
| 44 | static void Hor2Dms(Double_t hor, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);
|
|---|
| 45 | static void Hor2Hms(Double_t hor, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec);
|
|---|
| 46 |
|
|---|
| 47 | static void Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min);
|
|---|
| 48 | static void Rad2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);
|
|---|
| 49 | static void Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &hor, Double_t &min);
|
|---|
| 50 | static void Deg2Dm(Double_t deg, Char_t &sgn, UShort_t °, Double_t &min);
|
|---|
| 51 | static void Deg2Hm(Double_t deg, Char_t &sgn, UShort_t &hor, Double_t &min);
|
|---|
| 52 | static void Hor2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);
|
|---|
| 53 | static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t &hor, Double_t &min);
|
|---|
| 54 |
|
|---|
| 55 | // Print funtions
|
|---|
| 56 | static TString GetStringDeg(Double_t deg, const char *fmt="%c%d:%02d:%02d");
|
|---|
| 57 | static TString GetStringHor(Double_t deg, const char *fmt="%c%d:%02d:%02d");
|
|---|
| 58 |
|
|---|
| 59 | // Angle treatment functions
|
|---|
| 60 | static Bool_t String2Angle(TString &str, Double_t &ret);
|
|---|
| 61 | static Bool_t Coordinate2Angle(const TString &str, Double_t &ret);
|
|---|
| 62 | static TString Angle2Coordinate(Double_t val);
|
|---|
| 63 |
|
|---|
| 64 | static Double_t AngularDistance(Double_t theta0, Double_t phi0, Double_t theta1, Double_t phi1);
|
|---|
| 65 |
|
|---|
| 66 | // Time treatment functions
|
|---|
| 67 | static void Mjd2Ymd(UInt_t mjd, UShort_t &y, Byte_t &m, Byte_t &d);
|
|---|
| 68 | static Int_t Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d);
|
|---|
| 69 |
|
|---|
| 70 | static Double_t UT2GMST(Double_t ut1);
|
|---|
| 71 |
|
|---|
| 72 | // Rotation angle between local and sky coordinate system
|
|---|
| 73 | static void RotationAngle(Double_t sinl, Double_t cosl, Double_t theta, Double_t phi, Double_t &sin, Double_t &cos);
|
|---|
| 74 | static Double_t RotationAngle(Double_t sinl, Double_t cosl, Double_t theta, Double_t phi);
|
|---|
| 75 |
|
|---|
| 76 | static Double_t GetMoonPhase(Double_t mjd);
|
|---|
| 77 | static Double_t GetMoonPeriod(Double_t mjd);
|
|---|
| 78 | static Int_t GetMagicPeriod(Double_t mjd);
|
|---|
| 79 |
|
|---|
| 80 | // Get distance between v1 and v0 in a plain perpendicular to v0 in distance dist
|
|---|
| 81 | static TVector2 GetDistOnPlain(const TVector3 &v0, TVector3 v1, Double_t dist=1);
|
|---|
| 82 |
|
|---|
| 83 | // Calculate absolute misspointing from error in zd and error in az
|
|---|
| 84 | static Double_t GetDevAbs(Double_t nomzd, Double_t devzd, Double_t devaz);
|
|---|
| 85 |
|
|---|
| 86 | static Int_t GetEasterOffset(UShort_t year);
|
|---|
| 87 |
|
|---|
| 88 | ClassDef(MAstro, 0)
|
|---|
| 89 | };
|
|---|
| 90 |
|
|---|
| 91 | #endif
|
|---|