Changeset 9516 for trunk/MagicSoft/Cosy/catalog
- Timestamp:
- 10/21/09 10:49:36 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy/catalog
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc
r9439 r9516 9 9 using namespace std; 10 10 11 SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.) 12 { 13 } 14 15 SlaPlanets::~SlaPlanets() 11 SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : SlaStars(key), fDt(slaDt(2000.0)/60./60./24.) 16 12 { 17 13 } … … 19 15 void SlaPlanets::SetMjd(double mjd) 20 16 { 21 Sla lib::SetMjd(mjd);17 SlaStars::SetMjd(mjd); 22 18 23 19 fTt = GetMjd() + slaDtt(GetMjd())/60./60./24.; … … 33 29 } 34 30 35 void SlaPlanets::UpdatePlanetPos(ePlanets_t planet) 31 // -------------------------------------------------------------------------- 32 // 33 // coordinates of planet: topocentric, equatorial, J2000 34 // 35 RaDec SlaPlanets::CalcPlanetRaDec(ePlanets_t planet) 36 36 { 37 //38 37 // coordinates of planet: topocentric, equatorial, J2000 39 //40 38 double ra, dec, diam; 41 39 42 // One can use TT instead of TDB for all planets 43 // (except the moon) 40 // One can use TT instead of TDB for all planets (except the moon?) 44 41 // TDB, planet, elong, phi, *ra, *dec, *diam 45 42 slaRdplan(fTt, planet, GetElong(), GetPhi(), &ra, &dec, &diam); 46 43 44 return RaDec(ra, dec); 45 } 46 47 void SlaPlanets::UpdatePlanetPos(ePlanets_t planet) 48 { 49 // coordinates of planet: topocentric, equatorial, J2000 50 const RaDec rd = CalcPlanetRaDec(planet); 51 47 52 double az, el; 48 slaDe2h(GetAlpha()-r a, dec, GetPhi(), &az, &el);53 slaDe2h(GetAlpha()-rd.Ra(), rd.Dec(), GetPhi(), &az, &el); 49 54 50 55 fZdAz[planet].Set(TMath::Pi()/2-el, az); 51 56 } 57 -
trunk/MagicSoft/Cosy/catalog/SlaPlanets.h
r8847 r9516 2 2 #define COSY_SlaPlanets 3 3 4 #ifndef COSY_Sla lib5 #include "Sla lib.h"4 #ifndef COSY_SlaStars 5 #include "SlaStars.h" 6 6 #endif 7 7 … … 24 24 } ePlanets_t; 25 25 26 class SlaPlanets : public Sla lib26 class SlaPlanets : public SlaStars 27 27 { 28 28 private: … … 38 38 public: 39 39 SlaPlanets(MObservatory::LocationName_t key); 40 virtual ~SlaPlanets();41 40 42 41 void SetMjd(double mjd); 43 42 44 void UpdatePlanetPos(ePlanets_t planet); 45 ZdAz GetPlanetPos(ePlanets_t planet) const { return fZdAz[planet]; } 43 RaDec CalcPlanetRaDec(ePlanets_t planet); 44 void UpdatePlanetPos(ePlanets_t planet); 45 ZdAz GetPlanetPos(ePlanets_t planet) const { return fZdAz[planet]; } 46 47 void SetPlanet(ePlanets_t planet) { Set(CalcPlanetRaDec(planet)/TMath::DegToRad()); } 46 48 47 49 ClassDef(SlaPlanets, 0) -
trunk/MagicSoft/Cosy/catalog/SlaStars.cc
r9439 r9516 3 3 #include "slalib.h" 4 4 5 #include "MAstro.h" 5 6 #include "MPointing.h" 6 7 … … 29 30 void SlaStars::Set(const RaDec &radec) 30 31 { 32 double ha; 33 31 34 fRaDec = radec * TMath::DegToRad(); 32 fAltAz = CalcAltAz(fRaDec); 35 fAltAz = CalcAltAz(fRaDec, &ha); 36 37 fHourAngle = ha; 33 38 } 34 39 … … 136 141 } 137 142 138 ZdAz SlaStars::CalcZdAz(const RaDec &radec ) const143 ZdAz SlaStars::CalcZdAz(const RaDec &radec, double *ha) const 139 144 { 140 145 // … … 167 172 &r1); // observed right ascension (radians) 168 173 174 if (ha) 175 *ha = h0*MAstro::RadToHor(); 176 169 177 return ZdAz(zd, az); 170 178 } 171 AltAz SlaStars::CalcAltAz(const RaDec &radec ) const179 AltAz SlaStars::CalcAltAz(const RaDec &radec, double *ha) const 172 180 { 173 ZdAz zdaz = CalcZdAz(radec );181 ZdAz zdaz = CalcZdAz(radec, ha); 174 182 return AltAz(TMath::Pi()/2-zdaz.Zd(), zdaz.Az()); 175 183 } -
trunk/MagicSoft/Cosy/catalog/SlaStars.h
r8847 r9516 13 13 { 14 14 private: 15 AltAz fAltAz; // [rad] 16 RaDec fRaDec; // [rad] 15 AltAz fAltAz; // [rad] 16 RaDec fRaDec; // [rad] 17 18 Double_t fHourAngle; // [h] 17 19 18 20 double fAmprms[21]; … … 24 26 25 27 // const AltAz GetAltAz() const { return fAltAz*360/D2PI; } 26 // const ZdAz GetZdAz() const { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; } 27 // const RaDec GetRaDec() const { return fRaDec*360/D2PI; } 28 const ZdAz GetZdAz() const { return ZdAz(TMath::Pi()/2-fAltAz.Alt(), fAltAz.Az())*TMath::DegToRad(); } 29 const RaDec GetRaDec() const { return fRaDec/TMath::DegToRad(); } 30 const double GetHourAngle() const { return fHourAngle; } 28 31 29 32 virtual void SetMjd(double mjd); … … 41 44 RaDec CalcRaDecFast(const ZdAz &altaz) const; 42 45 43 AltAz CalcAltAz(const RaDec &radec ) const;44 ZdAz CalcZdAz (const RaDec &radec ) const;46 AltAz CalcAltAz(const RaDec &radec, double *ha=0) const; 47 ZdAz CalcZdAz (const RaDec &radec, double *ha=0) const; 45 48 46 AltAz CalcAltAz(const RaDec &radec, double mjd )47 { SetMjd(mjd); return CalcAltAz(radec ); }48 ZdAz CalcZdAz (const RaDec &radec, double mjd )49 { SetMjd(mjd); return CalcZdAz(radec ); }49 AltAz CalcAltAz(const RaDec &radec, double mjd, double *ha=0) 50 { SetMjd(mjd); return CalcAltAz(radec, ha); } 51 ZdAz CalcZdAz (const RaDec &radec, double mjd, double *ha=0) 52 { SetMjd(mjd); return CalcZdAz(radec, ha); } 50 53 51 54 AltAz CalcAltAzFast(const RaDec &radec) const;
Note:
See TracChangeset
for help on using the changeset viewer.