Index: trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 1758)
@@ -7,5 +7,5 @@
 ClassImp(SlaPlanets);
 
-SlaPlanets::SlaPlanets() : Slalib(), fDt(slaDt(2000.0)/60./60./24.)
+SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
 {
 }
@@ -15,7 +15,9 @@
 }
 
-void SlaPlanets::SetMjd(const double mjd)
+void SlaPlanets::SetMjd(double mjd)
 {
     Slalib::SetMjd(mjd);
+
+    fTt = mjd + slaDtt(mjd)/60./60./24.;
 
     //
@@ -29,101 +31,19 @@
 }
 
-#include "SlaStars.h"
-
 void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
 {
-    /*
-    double cp[6] = { 0, 0, 0, 0, 0, 0 };
-
-    double coord[6];
-
-    switch (planet)
-    {
-    case kEMoon:
-        //
-        // -- approximate geocentric pos and vel --
-        //
-        slaDmoon(GetMjd() + fDt, coord);
-        break;
-
-    case kEMercury:
-    case kEVenus:
-    case kEMars:
-    case kEJupiter:
-    case kESaturn:
-    case kEUranus:
-    case kENeptune:
-    case kEPluto:
-    case kESun:
-        {
-        */
     //
-    // coordinates of planet: heliocentric, equatoril, J2000
+    // coordinates of planet: topocentric, equatorial, J2000
     //
-    double ra,dec,diam;
-    // TDB, planet, elong, phi, *ra, *dec, *diam
+    double ra, dec, diam;
 
     // One can use TT instead of TDB for all plenets
     // (except the moon)
-
-    const double tt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
-
-    // FIXME: Shell be UT1
-    const double ut1 = fmod(GetMjd(), 1);
-
-    // tt should be tdb, but tt can be used
-    const double tdb = tt + slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() ))/60./60./24.;
-    /*
-     cout << "Dt: " << slaDtt(GetMjd()) << endl;
-     cout << "Rc: " << slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() )) << endl;
-     */
-    slaRdplan(tt, planet, GetElong(), GetPhi(),
-              &ra, &dec, &diam);
-    /*
-     switch (planet)
-     {
-     case kEMoon: cout << "Moon: "; break;
-     case kEMercury: cout << "Merkur: "; break;
-     case kEVenus: cout << "Venus: "; break;
-     case kEMars: cout << "Mars: "; break;
-     case kEJupiter: cout << "Jupiter: "; break;
-     case kESaturn: cout << "Saturn: "; break;
-     case kEUranus: cout << "Uranus: "; break;
-     case kENeptune: cout << "Neptun: "; break;
-     case kEPluto: cout << "Pluto: "; break;
-     case kESun: cout << "Sonne: "; break;
-     }
-
-     cout << (int)(ra*12/TMath::Pi()) << "h"<< (int)(ra*12/TMath::Pi()*60)%60 <<"min ";
-     cout << (int)(dec*kRad2Deg) << "deg" << (int)(dec*kRad2Deg*60)%60 << "min" << endl;
-     */
-    /*
-     SlaStars sla;
-     sla.SetMjd(GetMjd());
-     ZdAz za = sla.CalcZdAz(RaDec(ra,dec));
-     cout << za.Zd()*kRad2Deg << " " << fmod(za.Az()*kRad2Deg+720,360.) << endl;
-     fZdAz[planet] = za;
-     */
+    // TDB, planet, elong, phi, *ra, *dec, *diam
+    slaRdplan(fTt, planet, GetElong(), GetPhi(), &ra, &dec, &diam);
 
     double az, el;
     slaDe2h(GetAlpha()-ra, dec, GetPhi(), &az, &el);
 
-    cout << 90-el*kRad2Deg << " " << fmod(az*kRad2Deg+720,360.) << endl;
     fZdAz[planet].Set(TMath::Pi()/2-el, az);
-    /*
-     }
-     // !! Fall through!
-     break;
-     case kESun:
-     coord[0] = cp[0] - fEarth[0];
-     coord[1] = cp[1] - fEarth[1];
-     coord[2] = cp[2] - fEarth[2];
-     break;
-     }
-     fZdAz[planet] = XYZ2ZdAz(coord);
-
-     if (planet==kESun)
-     {
-     cout << fZdAz[kESun].Zd()*kRad2Deg << " " <<  fZdAz[kESun].Az()*kRad2Deg << endl;
-     }*/
 }
Index: trunk/MagicSoft/Cosy/catalog/SlaPlanets.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaPlanets.h	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/SlaPlanets.h	(revision 1758)
@@ -23,5 +23,6 @@
 {
 private:
-    double fDt; // const: rootcint/TMemberInspector
+    double fDt;        // [mjd] const: rootcint/TMemberInspector
+    double fTt;        // [mjd] timescale TT
 
     ZdAz fZdAz[10];    // [rad]
@@ -32,12 +33,8 @@
 
 public:
-    SlaPlanets();
+    SlaPlanets(MObservatory::LocationName_t key);
     virtual ~SlaPlanets();
 
-    //    const AltAz GetAltAz() const { return fAltAz*360/D2PI; }
-    //    const ZdAz  GetZdAz()  const { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; }
-    //    const RaDec GetRaDec() const { return fRaDec*360/D2PI; }
-
-    void SetMjd(const double mjd);
+    void SetMjd(double mjd);
 
     void UpdatePlanetPos(ePlanets_t planet);
Index: trunk/MagicSoft/Cosy/catalog/SlaStars.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 1758)
@@ -5,5 +5,5 @@
 ClassImp(SlaStars);
 
-SlaStars::SlaStars() : Slalib()
+SlaStars::SlaStars(MObservatory::LocationName_t key) : Slalib(key)
 {
 }
Index: trunk/MagicSoft/Cosy/catalog/SlaStars.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaStars.h	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/SlaStars.h	(revision 1758)
@@ -16,5 +16,5 @@
 
 public:
-    SlaStars();
+    SlaStars(MObservatory::LocationName_t key);
     virtual ~SlaStars();
 
Index: trunk/MagicSoft/Cosy/catalog/Slalib.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 1758)
@@ -10,24 +10,6 @@
 ClassImp(Slalib);
 
-Slalib::Slalib() : Timer()
+Slalib::Slalib(MObservatory::LocationName_t key) : Timer(), MObservatory(key)
 {
-    // p = pointer to MainFrame (not owner)
-
-    //
-    // calculate observers location (goe)
-    //
-    int status;
-    //slaDaf2r(51, 38, 48.0, &fPhi,   &status);
-    //slaDaf2r( 9, 56, 36.0, &fElong, &status);
-    //fHeight = 300;
-
-    slaDaf2r(28, 45, 30.0, &fPhi,   &status);
-    slaDaf2r(17, 52, 48.0, &fElong, &status);
-
-    fElong *= -1;
-    fHeight = 2326;
-
-    cout << "Latitude: 51\x9c 38'48.0\" = " <<  kRad2Deg*fPhi << "   ";
-    cout << "Longitude: 9\x9c 56'36.0\" = " <<  kRad2Deg*fElong << endl;
 }
 
@@ -36,23 +18,9 @@
 }
 
-void Slalib::SetMjd(const double mjd)
+void Slalib::SetMjd(double mjd)
 {
-    fMjd   = mjd;
-    fAlpha = slaGmst(fMjd) + fElong;
+    Timer::SetMjd(mjd);
+    fAlpha = slaGmst(mjd) + GetElong();
 }
-
-void Slalib::SetMjd2Now()
-{
-    Now();
-    SetMjd(CalcMjd());
-//    cout << "GetMjd: "<< (*this)() << " " << GetMjd() << endl;
-}
-
-void Slalib::SetMjd(const struct timeval *tm)
-{
-    SetTimer(tm);
-    SetMjd(CalcMjd());
-}
-
 
 ZdAz Slalib::XYZ2ZdAz(double coord[3]) const
@@ -73,5 +41,5 @@
     //
     double alt, az;
-    slaDe2h(ha, dec, fPhi, &az, &alt);
+    slaDe2h(ha, dec, GetPhi(), &az, &alt);
 
     return ZdAz(kPiDiv2-alt, az);
Index: trunk/MagicSoft/Cosy/catalog/Slalib.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 1758)
@@ -5,37 +5,19 @@
 
 #include "coord.h"
-#include "base/timer.h"
+#include "timer.h"
+#include "MObservatory.h"
 
-class Slalib : public Timer
+class Slalib : public Timer, public MObservatory
 {
 private:
-    double   fAlpha;
-    double   fMjd;
-
-    double   fPhi;      // location of observatory
-    double   fElong;
-
-    double   fHeight;
+    double fAlpha;
 
 public:
-    Slalib();
+    Slalib(MObservatory::LocationName_t key);
     virtual ~Slalib();
 
-    //    const AltAz GetAltAz() const { return fAltAz*360/D2PI; }
-    //    const ZdAz  GetZdAz()  const { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; }
-    //    const RaDec GetRaDec() const { return fRaDec*360/D2PI; }
-
-    void SetMjd2Now();
-    void SetMjd(const struct timeval *tm);
-
-    virtual void SetMjd(const double mjd);
+    virtual void SetMjd(double mjd);
 
     double GetAlpha() const  { return fAlpha; }
-    double GetMjd() const    { return fMjd; }
-
-    double GetPhi() const    { return fPhi; }
-    double GetElong() const  { return fElong; }
-
-    double GetHeight() const { return fHeight; }
 
     ZdAz   XYZ2ZdAz(double coord[3]) const;
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 1758)
@@ -14,5 +14,5 @@
 ClassImp(StarCatalog);
 
-StarCatalog::StarCatalog() : SlaStars(), fEntries(0)
+StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fEntries(0)
 {
     // p = pointer to MainFrame (not owner)
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 1757)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 1758)
@@ -71,5 +71,5 @@
 
 public:
-    StarCatalog();
+    StarCatalog(MObservatory::LocationName_t key);
     virtual ~StarCatalog();
 
