Index: trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 1691)
+++ trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 1757)
@@ -29,6 +29,9 @@
 }
 
+#include "SlaStars.h"
+
 void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
 {
+    /*
     double cp[6] = { 0, 0, 0, 0, 0, 0 };
 
@@ -52,24 +55,75 @@
     case kENeptune:
     case kEPluto:
+    case kESun:
         {
-            //
-            // coordinates of planet: heliocentric, equatoril, J2000
-            //
+        */
+    //
+    // coordinates of planet: heliocentric, equatoril, J2000
+    //
+    double ra,dec,diam;
+    // TDB, planet, elong, phi, *ra, *dec, *diam
 
-            int rc;
-            slaPlanet(GetMjd(), planet, cp, &rc);
+    // One can use TT instead of TDB for all plenets
+    // (except the moon)
 
-            if (rc)
-                return;
-        }
-        // !! Fall through!
+    const double tt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
 
-    case kESun:
-        coord[0] = cp[0] - fEarth[0];
-        coord[1] = cp[1] - fEarth[1];
-        coord[2] = cp[2] - fEarth[2];
-        break;
-    }
+    // FIXME: Shell be UT1
+    const double ut1 = fmod(GetMjd(), 1);
 
-    fZdAz[planet] = XYZ2ZdAz(coord);
+    // 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;
+     */
+
+    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/SlaStars.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 1691)
+++ trunk/MagicSoft/Cosy/catalog/SlaStars.cc	(revision 1757)
@@ -38,13 +38,17 @@
     // ----- calculate star independent parameters ----------
     //
-    slaMappa(2000.0, mjd, fAmprms);
-    slaAoppa(mjd, 0,                    // mjd, UT1-UTC
+
+    // prepare calculation: Mean Place to geocentric apperent
+    slaMappa(2000.0, mjd, fAmprms);        // Epoche, TDB
+
+    // prepare: Apperent to observed place
+    slaAoppa(mjd, 0,                       // mjd, Delta UT=UT1-UTC
              // GetElong(), GetPhi(), 148, // göttingen long, lat, height
-             GetElong(), GetPhi(), 300, // göttingen long, lat, height
-             0, 0,                      // polar motion x, y-coordinate (radians)
+             GetElong(), GetPhi(), GetHeight(), // göttingen long, lat, height
+             0, 0,                         // polar motion x, y-coordinate (radians)
              // 273.155, 1013.25, 0.5,     // temp, pressure, humidity
              273.155+20, 1013.25, 0.5,     // temp, pressure, humidity
              // 0.2, 0.0065,               // wavelength, tropo lapse rate
-             0.55, 0.0065,               // wavelength, tropo lapse rate
+             0.55, 0.0065,                 // wavelength, tropo lapse rate
              fAoprms);
 }
Index: trunk/MagicSoft/Cosy/catalog/Slalib.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 1691)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 1757)
@@ -18,6 +18,13 @@
     //
     int status;
-    slaDaf2r(51, 38, 48.0, &fPhi,   &status);
-    slaDaf2r( 9, 56, 36.0, &fElong, &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 << "   ";
Index: trunk/MagicSoft/Cosy/catalog/Slalib.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 1691)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.h	(revision 1757)
@@ -16,4 +16,6 @@
     double   fElong;
 
+    double   fHeight;
+
 public:
     Slalib();
@@ -29,9 +31,11 @@
     virtual void SetMjd(const double mjd);
 
-    double GetAlpha() const { return fAlpha; }
-    double GetMjd() const   { return fMjd; }
+    double GetAlpha() const  { return fAlpha; }
+    double GetMjd() const    { return fMjd; }
 
-    double GetPhi() const   { return fPhi; }
-    double GetElong() const { return fElong; }
+    double GetPhi() const    { return fPhi; }
+    double GetElong() const  { return fElong; }
+
+    double GetHeight() const { return fHeight; }
 
     ZdAz   XYZ2ZdAz(double coord[3]) const;
