Ignore:
Timestamp:
02/14/03 23:18:37 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/catalog
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc

    r1757 r1758  
    77ClassImp(SlaPlanets);
    88
    9 SlaPlanets::SlaPlanets() : Slalib(), fDt(slaDt(2000.0)/60./60./24.)
     9SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
    1010{
    1111}
     
    1515}
    1616
    17 void SlaPlanets::SetMjd(const double mjd)
     17void SlaPlanets::SetMjd(double mjd)
    1818{
    1919    Slalib::SetMjd(mjd);
     20
     21    fTt = mjd + slaDtt(mjd)/60./60./24.;
    2022
    2123    //
     
    2931}
    3032
    31 #include "SlaStars.h"
    32 
    3333void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
    3434{
    35     /*
    36     double cp[6] = { 0, 0, 0, 0, 0, 0 };
    37 
    38     double coord[6];
    39 
    40     switch (planet)
    41     {
    42     case kEMoon:
    43         //
    44         // -- approximate geocentric pos and vel --
    45         //
    46         slaDmoon(GetMjd() + fDt, coord);
    47         break;
    48 
    49     case kEMercury:
    50     case kEVenus:
    51     case kEMars:
    52     case kEJupiter:
    53     case kESaturn:
    54     case kEUranus:
    55     case kENeptune:
    56     case kEPluto:
    57     case kESun:
    58         {
    59         */
    6035    //
    61     // coordinates of planet: heliocentric, equatoril, J2000
     36    // coordinates of planet: topocentric, equatorial, J2000
    6237    //
    63     double ra,dec,diam;
    64     // TDB, planet, elong, phi, *ra, *dec, *diam
     38    double ra, dec, diam;
    6539
    6640    // One can use TT instead of TDB for all plenets
    6741    // (except the moon)
    68 
    69     const double tt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
    70 
    71     // FIXME: Shell be UT1
    72     const double ut1 = fmod(GetMjd(), 1);
    73 
    74     // tt should be tdb, but tt can be used
    75     const double tdb = tt + slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() ))/60./60./24.;
    76     /*
    77      cout << "Dt: " << slaDtt(GetMjd()) << endl;
    78      cout << "Rc: " << slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() )) << endl;
    79      */
    80     slaRdplan(tt, planet, GetElong(), GetPhi(),
    81               &ra, &dec, &diam);
    82     /*
    83      switch (planet)
    84      {
    85      case kEMoon: cout << "Moon: "; break;
    86      case kEMercury: cout << "Merkur: "; break;
    87      case kEVenus: cout << "Venus: "; break;
    88      case kEMars: cout << "Mars: "; break;
    89      case kEJupiter: cout << "Jupiter: "; break;
    90      case kESaturn: cout << "Saturn: "; break;
    91      case kEUranus: cout << "Uranus: "; break;
    92      case kENeptune: cout << "Neptun: "; break;
    93      case kEPluto: cout << "Pluto: "; break;
    94      case kESun: cout << "Sonne: "; break;
    95      }
    96 
    97      cout << (int)(ra*12/TMath::Pi()) << "h"<< (int)(ra*12/TMath::Pi()*60)%60 <<"min ";
    98      cout << (int)(dec*kRad2Deg) << "deg" << (int)(dec*kRad2Deg*60)%60 << "min" << endl;
    99      */
    100     /*
    101      SlaStars sla;
    102      sla.SetMjd(GetMjd());
    103      ZdAz za = sla.CalcZdAz(RaDec(ra,dec));
    104      cout << za.Zd()*kRad2Deg << " " << fmod(za.Az()*kRad2Deg+720,360.) << endl;
    105      fZdAz[planet] = za;
    106      */
     42    // TDB, planet, elong, phi, *ra, *dec, *diam
     43    slaRdplan(fTt, planet, GetElong(), GetPhi(), &ra, &dec, &diam);
    10744
    10845    double az, el;
    10946    slaDe2h(GetAlpha()-ra, dec, GetPhi(), &az, &el);
    11047
    111     cout << 90-el*kRad2Deg << " " << fmod(az*kRad2Deg+720,360.) << endl;
    11248    fZdAz[planet].Set(TMath::Pi()/2-el, az);
    113     /*
    114      }
    115      // !! Fall through!
    116      break;
    117      case kESun:
    118      coord[0] = cp[0] - fEarth[0];
    119      coord[1] = cp[1] - fEarth[1];
    120      coord[2] = cp[2] - fEarth[2];
    121      break;
    122      }
    123      fZdAz[planet] = XYZ2ZdAz(coord);
    124 
    125      if (planet==kESun)
    126      {
    127      cout << fZdAz[kESun].Zd()*kRad2Deg << " " <<  fZdAz[kESun].Az()*kRad2Deg << endl;
    128      }*/
    12949}
  • trunk/MagicSoft/Cosy/catalog/SlaPlanets.h

    r1109 r1758  
    2323{
    2424private:
    25     double fDt; // const: rootcint/TMemberInspector
     25    double fDt;        // [mjd] const: rootcint/TMemberInspector
     26    double fTt;        // [mjd] timescale TT
    2627
    2728    ZdAz fZdAz[10];    // [rad]
     
    3233
    3334public:
    34     SlaPlanets();
     35    SlaPlanets(MObservatory::LocationName_t key);
    3536    virtual ~SlaPlanets();
    3637
    37     //    const AltAz GetAltAz() const { return fAltAz*360/D2PI; }
    38     //    const ZdAz  GetZdAz()  const { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; }
    39     //    const RaDec GetRaDec() const { return fRaDec*360/D2PI; }
    40 
    41     void SetMjd(const double mjd);
     38    void SetMjd(double mjd);
    4239
    4340    void UpdatePlanetPos(ePlanets_t planet);
  • trunk/MagicSoft/Cosy/catalog/SlaStars.cc

    r1757 r1758  
    55ClassImp(SlaStars);
    66
    7 SlaStars::SlaStars() : Slalib()
     7SlaStars::SlaStars(MObservatory::LocationName_t key) : Slalib(key)
    88{
    99}
  • trunk/MagicSoft/Cosy/catalog/SlaStars.h

    r1274 r1758  
    1616
    1717public:
    18     SlaStars();
     18    SlaStars(MObservatory::LocationName_t key);
    1919    virtual ~SlaStars();
    2020
  • trunk/MagicSoft/Cosy/catalog/Slalib.cc

    r1757 r1758  
    1010ClassImp(Slalib);
    1111
    12 Slalib::Slalib() : Timer()
     12Slalib::Slalib(MObservatory::LocationName_t key) : Timer(), MObservatory(key)
    1313{
    14     // p = pointer to MainFrame (not owner)
    15 
    16     //
    17     // calculate observers location (goe)
    18     //
    19     int status;
    20     //slaDaf2r(51, 38, 48.0, &fPhi,   &status);
    21     //slaDaf2r( 9, 56, 36.0, &fElong, &status);
    22     //fHeight = 300;
    23 
    24     slaDaf2r(28, 45, 30.0, &fPhi,   &status);
    25     slaDaf2r(17, 52, 48.0, &fElong, &status);
    26 
    27     fElong *= -1;
    28     fHeight = 2326;
    29 
    30     cout << "Latitude: 51\x9c 38'48.0\" = " <<  kRad2Deg*fPhi << "   ";
    31     cout << "Longitude: 9\x9c 56'36.0\" = " <<  kRad2Deg*fElong << endl;
    3214}
    3315
     
    3618}
    3719
    38 void Slalib::SetMjd(const double mjd)
     20void Slalib::SetMjd(double mjd)
    3921{
    40     fMjd   = mjd;
    41     fAlpha = slaGmst(fMjd) + fElong;
     22    Timer::SetMjd(mjd);
     23    fAlpha = slaGmst(mjd) + GetElong();
    4224}
    43 
    44 void Slalib::SetMjd2Now()
    45 {
    46     Now();
    47     SetMjd(CalcMjd());
    48 //    cout << "GetMjd: "<< (*this)() << " " << GetMjd() << endl;
    49 }
    50 
    51 void Slalib::SetMjd(const struct timeval *tm)
    52 {
    53     SetTimer(tm);
    54     SetMjd(CalcMjd());
    55 }
    56 
    5725
    5826ZdAz Slalib::XYZ2ZdAz(double coord[3]) const
     
    7341    //
    7442    double alt, az;
    75     slaDe2h(ha, dec, fPhi, &az, &alt);
     43    slaDe2h(ha, dec, GetPhi(), &az, &alt);
    7644
    7745    return ZdAz(kPiDiv2-alt, az);
  • trunk/MagicSoft/Cosy/catalog/Slalib.h

    r1757 r1758  
    55
    66#include "coord.h"
    7 #include "base/timer.h"
     7#include "timer.h"
     8#include "MObservatory.h"
    89
    9 class Slalib : public Timer
     10class Slalib : public Timer, public MObservatory
    1011{
    1112private:
    12     double   fAlpha;
    13     double   fMjd;
    14 
    15     double   fPhi;      // location of observatory
    16     double   fElong;
    17 
    18     double   fHeight;
     13    double fAlpha;
    1914
    2015public:
    21     Slalib();
     16    Slalib(MObservatory::LocationName_t key);
    2217    virtual ~Slalib();
    2318
    24     //    const AltAz GetAltAz() const { return fAltAz*360/D2PI; }
    25     //    const ZdAz  GetZdAz()  const { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; }
    26     //    const RaDec GetRaDec() const { return fRaDec*360/D2PI; }
    27 
    28     void SetMjd2Now();
    29     void SetMjd(const struct timeval *tm);
    30 
    31     virtual void SetMjd(const double mjd);
     19    virtual void SetMjd(double mjd);
    3220
    3321    double GetAlpha() const  { return fAlpha; }
    34     double GetMjd() const    { return fMjd; }
    35 
    36     double GetPhi() const    { return fPhi; }
    37     double GetElong() const  { return fElong; }
    38 
    39     double GetHeight() const { return fHeight; }
    4022
    4123    ZdAz   XYZ2ZdAz(double coord[3]) const;
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.cc

    r1531 r1758  
    1414ClassImp(StarCatalog);
    1515
    16 StarCatalog::StarCatalog() : SlaStars(), fEntries(0)
     16StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fEntries(0)
    1717{
    1818    // p = pointer to MainFrame (not owner)
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.h

    r1531 r1758  
    7171
    7272public:
    73     StarCatalog();
     73    StarCatalog(MObservatory::LocationName_t key);
    7474    virtual ~StarCatalog();
    7575
Note: See TracChangeset for help on using the changeset viewer.