Changeset 912 for trunk/MagicSoft/Cosy/catalog
- Timestamp:
- 08/17/01 15:12:57 (23 years ago)
- Location:
- trunk/MagicSoft/Cosy/catalog
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/catalog/Makefile
r911 r912 33 33 SRCFILES = SaoFile.cc \ 34 34 Slalib.cc \ 35 SlaStars.cc \ 36 SlaPlanets.cc \ 35 37 StarCatalog.cc 36 38 -
trunk/MagicSoft/Cosy/catalog/Slalib.cc
r911 r912 6 6 #include "slalib.h" 7 7 8 Slalib::Slalib() 8 Slalib::Slalib() : Timer() 9 9 { 10 10 // p = pointer to MainFrame (not owner) … … 25 25 } 26 26 27 void Slalib::Set(const AltAz &altaz) 28 { 29 fAltAz = altaz * D2PI/360.0; 30 fRaDec = CalcRaDec(fAltAz); 31 } 32 33 void Slalib::Set(const ZdAz &zdaz) 34 { 35 fAltAz = AltAz(DPI/2-zdaz.Zd(), zdaz.Az()) * D2PI/360.0; 36 fRaDec = CalcRaDec(fAltAz); 37 } 38 39 void Slalib::Set(const RaDec &radec) 40 { 41 fRaDec = radec * D2PI/360.0; 42 fAltAz = CalcAltAz(fRaDec); 43 } 44 45 void Slalib::Set(const double mjd) 27 void Slalib::SetMjd(const double mjd) 46 28 { 47 29 fMjd = mjd; 48 30 fAlpha = slaGmst(fMjd) + fElong; 31 } 32 33 void Slalib::SetMjd2Now() 34 { 35 Now(); 36 SetMjd(CalcMjd()); 37 // cout << "GetMjd: "<< (*this)() << " " << GetMjd() << endl; 38 } 39 40 void Slalib::SetMjd(const struct timeval *tm) 41 { 42 SetTimer(tm); 43 SetMjd(CalcMjd()); 44 } 45 46 47 ZdAz Slalib::XYZ2ZdAz(double coord[3]) const 48 { 49 // 50 // -- xyz to spherical coordinates -- 51 // 52 double ra, dec; 53 slaDcc2s(coord, &ra, &dec); 49 54 50 55 // 51 // ----- calculate star independent parameters ----------56 // radec[rad] -> hadec[rad] 52 57 // 53 slaMappa(2000.0, fMjd, fAmprms); 54 slaAoppa(fMjd, 0, // mjd, UT1-UTC 55 fElong, fPhi, 148, // gttingen long, lat, height 56 0, 0, // polar motion x, y-coordinate (radians) 57 273.155, 1013.25, 0.5, // temp, pressure, humidity 58 0.2, 0.0065, // wavelength, tropo lapse rate 59 fAoprms); 60 } 61 62 RaDec Slalib::CalcRaDec(const AltAz &altaz) const 63 { 64 return CalcRaDec(ZdAz(DPI/2-altaz.Alt(), altaz.Az())); 65 } 66 67 RaDec Slalib::CalcRaDec(const ZdAz &zdaz) const 68 { 69 // 70 // -- observed to apparent -- 71 // Workaraound for slalib: discard const 72 // 73 double r=0, d=0; 74 slaOapqk ("A", zdaz.Az(), zdaz.Zd(), (double*)fAoprms, &r, &d); 58 const double ha = fAlpha-ra; 75 59 76 60 // 77 // -- apparent to mean -- 78 // Workaraound for slalib: discard const 61 // hadec[rad] -> altaz[rad] 79 62 // 80 double ra, dec;81 sla Ampqk(r, d, (double*)fAmprms, &ra, &dec);63 double alt, az; 64 slaDe2h(ha, dec, fPhi, &az, &alt); 82 65 83 return RaDec(ra, dec);66 return ZdAz(DPI/2-alt, az); 84 67 } 85 86 ZdAz Slalib::CalcZdAz(const RaDec &radec) const87 {88 //89 // ---- Mean to apparent ----90 //91 92 double r=0, d=0;93 slaMapqkz(radec.Ra(), radec.Dec(), (double*)fAmprms, &r, &d);94 //95 // Doesn't work - don't know why96 //97 // slaMapqk (radec.Ra(), radec.Dec(), rdpm.Ra(), rdpm.Dec(),98 // 0, 0, (double*)fAmprms, &r, &d);99 //100 101 //102 // -- apparent to observed --103 //104 double r1=0; // ra105 double d1=0; // dec106 double h0=0; // ha107 108 double zd;109 double az;110 slaAopqk (r, d, (double*)fAoprms,111 &az, // observed azimuth (radians: N=0,E=90)112 &zd, // observed zenith distance (radians) [-pi/2, pi/2]113 &h0, // observed hour angle (radians)114 &d1, // observed declination (radians)115 &r1); // observed right ascension (radians)116 117 return ZdAz(zd, az);118 }119 AltAz Slalib::CalcAltAz(const RaDec &radec) const120 {121 ZdAz zdaz = CalcZdAz(radec);122 return AltAz(DPI/2-zdaz.Zd(), zdaz.Az());123 }124 -
trunk/MagicSoft/Cosy/catalog/Slalib.h
r911 r912 3 3 4 4 #include "coord.h" 5 #include "base/timer.h" 5 6 6 class Slalib 7 class Slalib : public Timer 7 8 { 8 9 private: 9 double fPhi; // location of observatory10 double fElong;11 12 AltAz fAltAz; // [rad]13 RaDec fRaDec; // [rad]14 15 10 double fAlpha; 16 11 double fMjd; 17 12 18 double f Amprms[21];19 double f Aoprms[14];13 double fPhi; // location of observatory 14 double fElong; 20 15 21 16 public: … … 27 22 // const RaDec GetRaDec() const { return fRaDec*360/D2PI; } 28 23 29 void Set(const double mjd); 24 void SetMjd2Now(); 25 void SetMjd(const struct timeval *tm); 30 26 31 void Set(const AltAz &altaz); 32 void Set(const ZdAz &zdaz); 33 void Set(const RaDec &radec); 27 virtual void SetMjd(const double mjd); 34 28 35 29 double GetAlpha() const { return fAlpha; } 30 double GetMjd() const { return fMjd; } 36 31 37 32 double GetPhi() const { return fPhi; } 38 33 double GetElong() const { return fElong; } 39 34 40 RaDec CalcRaDec(const AltAz &altaz) const; 41 RaDec CalcRaDec(const ZdAz &altaz) const; 42 43 AltAz CalcAltAz(const RaDec &radec) const; 44 ZdAz CalcZdAz (const RaDec &radec) const; 45 35 ZdAz XYZ2ZdAz(double coord[3]) const; 46 36 }; 47 37 -
trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
r808 r912 9 9 #include "slamac.h" 10 10 #include "File.h" 11 #include "timer.h" 12 13 StarCatalog::StarCatalog() : fEntries(0) 11 12 StarCatalog::StarCatalog() : SlaStars(), fEntries(0) 14 13 { 15 14 // p = pointer to MainFrame (not owner) … … 68 67 cout << " Az: " << fAltAz.Az() << endl; 69 68 70 fRaDec = sla.CalcRaDec(fAltAz);69 fRaDec = CalcRaDec(fAltAz); 71 70 72 71 cout << "Ra: " << 360.0/D2PI*fRaDec.Ra(); … … 82 81 fRaDec *= D2PI/360.0; 83 82 84 fAltAz = sla.CalcAltAz(fRaDec);83 fAltAz = CalcAltAz(fRaDec); 85 84 86 85 cout << "Alt: " << 360.0/D2PI*fAltAz.Alt() << " "; … … 215 214 double de0, de1; 216 215 217 const double phi = sla.GetPhi();218 const double alpha = sla.GetAlpha();216 const double phi = GetPhi(); 217 const double alpha = GetAlpha(); 219 218 // 220 219 // scan horizontal border … … 401 400 memset(cimg, 0, 768*576); 402 401 403 sla.Set(utc);402 SetMjd(utc); 404 403 //fAlpha = sla.GetAlpha(); 405 404 SetRaDec(radec); … … 419 418 memset(cimg, 0, 768*576); 420 419 421 sla.Set(utc);420 SetMjd(utc); 422 421 //fAlpha = sla.GetAlpha(); 423 422 SetAltAz(altaz); … … 496 495 // ---- mean to observed --- 497 496 // 498 AltAz altaz= sla.CalcAltAz(sao->GetRaDec()) * 360.0/D2PI;497 AltAz altaz=CalcAltAz(sao->GetRaDec()) * 360.0/D2PI; 499 498 500 499 if (sao->MagV() > fLimitMag) … … 520 519 // radec[rad] -> hadec[rad] 521 520 // 522 const double ha = sla.GetAlpha()-ra;521 const double ha = GetAlpha()-ra; 523 522 524 523 // … … 526 525 // 527 526 double alt, az; 528 slaDe2h(ha, dec, sla.GetPhi(), &az, &alt);527 slaDe2h(ha, dec, GetPhi(), &az, &alt); 529 528 530 529 // -
trunk/MagicSoft/Cosy/catalog/StarCatalog.h
r808 r912 8 8 #include "SaoFile.h" 9 9 #endif 10 #ifndef SLA LIB_H11 #include "Sla lib.h"10 #ifndef SLASTARS_H 11 #include "SlaStars.h" 12 12 #endif 13 13 … … 16 16 typedef unsigned char byte; 17 17 18 class StarCatalog 18 class StarCatalog : public SlaStars 19 19 { 20 20 private: … … 22 22 sort_t *fSrt; 23 23 int fEntries; 24 25 Slalib sla;26 27 // double fPhi; // location of observatory28 // double fElong;29 24 30 25 double fPixSize; // [rad/pix] size of one pixel … … 46 41 int fDecMax; 47 42 48 // double fAlpha;49 // double fMjd;50 // double fAmprms[21];51 // double fAoprms[14];52 53 43 void DrawCross(byte *img, const int x, const int y); 54 44 void DrawCircle(int color, byte *img, int xx, int yy, int size); … … 65 55 void SetRaDec(const RaDec &radec); 66 56 void SetAltAz(const AltAz &altaz); 67 // void SetMjd(const double mjd);68 57 void DrawSCAltAz(byte *img, const int color); 69 58 void DrawSCRaDec(byte *img, const int color);
Note:
See TracChangeset
for help on using the changeset viewer.