Changeset 18820 for trunk/Mars/mcore
- Timestamp:
- 04/14/17 12:18:40 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/nova.h
r17952 r18820 1 1 #ifndef MARS_Nova 2 2 #define MARS_Nova 3 4 #include <map> 5 #include <string> 3 6 4 7 #include <libnova/solar.h> … … 10 13 namespace Nova 11 14 { 12 typedef ln_lnlat_posn LnLatPosn; 13 typedef ln_rst_time RstTime; // Note that times are in JD not Mjd 14 //typedef ln_hrz_posn HrzPosn; 15 //typedef ln_equ_posn EquPosn; 15 typedef ln_rst_time RstTime; // Note that times are in JD not Mjd 16 16 17 17 struct ZdAzPosn; 18 18 struct RaDecPosn; 19 19 20 const static ln_lnlat_posn kORM 21 #ifndef __CINT__ 22 = { -(17.+53./60+26.525/3600), 28.+45./60+42.462/3600 } // 2200m 23 #endif 24 ; 25 const static ln_lnlat_posn kHAWC 26 #ifndef __CINT__ 27 = { -97.3084, 18.9947 } // 4100m; 28 #endif 29 ; 30 const static ln_lnlat_posn kSPM 31 #ifndef __CINT__ 32 = { -115.4637, 31.0439 } // 2800m; 33 #endif 34 ; 35 36 struct LnLatPosn : public ln_lnlat_posn 37 { 38 LnLatPosn() { } 39 LnLatPosn(const ln_lnlat_posn &pos) : ln_lnlat_posn(pos) { } 40 LnLatPosn(const std::string &obs) 41 { 42 #ifndef __CINT__ 43 static const std::map<std::string, ln_lnlat_posn> lut = 44 { 45 { "orm", kORM }, 46 { "hawc", kHAWC }, 47 { "spm", kSPM }, 48 }; 49 50 const auto it = lut.find(obs); 51 *this = it==lut.end() ? ln_lnlat_posn({0,0}) : it->second; 52 #endif 53 } 54 }; 20 55 21 56 // Warning: 0deg=South, 90deg=W … … 61 96 62 97 EquPosn::EquPosn(const RaDecPosn &rd) { ra = rd.ra*15; dec = rd.dec; } 63 64 65 66 const LnLatPosn &ORM()67 {68 //static LnLatPosn obs;69 //obs.lng = -(17.+53./60+26.525/3600);70 //obs.lat = 28.+45./60+42.462/3600;71 const static LnLatPosn obs = { -(17.+53./60+26.525/3600), 28.+45./60+42.462/3600 };72 return obs;73 }74 98 75 99 HrzPosn GetHrzFromEqu(const EquPosn &equ, const LnLatPosn &obs, double jd) … … 81 105 HrzPosn GetHrzFromEqu(const EquPosn &equ, double jd) 82 106 { 83 return GetHrzFromEqu(equ, ORM(), jd);107 return GetHrzFromEqu(equ, kORM, jd); 84 108 } 85 109 … … 92 116 EquPosn GetEquFromHrz(const HrzPosn &hrz, double jd) 93 117 { 94 return GetEquFromHrz(hrz, ORM(), jd);118 return GetEquFromHrz(hrz, kORM, jd); 95 119 } 96 120 … … 103 127 RstTime GetSolarRst(double jd, double hrz=LN_SOLAR_STANDART_HORIZON) 104 128 { 105 return GetSolarRst(jd, ORM(), hrz);106 } 107 108 RstTime GetLunarRst(double jd, const LnLatPosn &obs= ORM())129 return GetSolarRst(jd, kORM, hrz); 130 } 131 132 RstTime GetLunarRst(double jd, const LnLatPosn &obs=kORM) 109 133 { 110 134 RstTime rst; … … 171 195 double fEarthDist; 172 196 173 SolarObjects(const double &jd, const LnLatPosn &obs=Nova:: ORM())197 SolarObjects(const double &jd, const LnLatPosn &obs=Nova::kORM) 174 198 { 175 199 fJD = jd;
Note:
See TracChangeset
for help on using the changeset viewer.