Index: trunk/MagicSoft/Mars/mastro/MAstro.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 3596)
+++ trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 3666)
@@ -85,5 +85,5 @@
 Double_t MAstro::Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
 {
-    return Hms2Sec(deg, min, sec, sgn)/15.;
+    return Hms2Sec(deg, min, sec, sgn)/54000.;
 }
 
Index: trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCamera.cc	(revision 3596)
+++ trunk/MagicSoft/Mars/mastro/MAstroCamera.cc	(revision 3666)
@@ -148,5 +148,11 @@
 
 // --------------------------------------------------------------------------
-void MAstroCamera::AddPrimitives(Option_t *o)
+//
+// Options:
+//
+//  '*' Draw the mean of the reflections on all mirrors
+//  '.' Draw a dot for the reflection on each mirror
+//
+void MAstroCamera::AddPrimitives(TString o)
 {
     if (!fTime || !fObservatory || !fMirrors)
@@ -156,12 +162,11 @@
     }
 
-    TString opt(o);
-    if (opt.IsNull())
-        opt = "*.";
-
-    const Bool_t hashist = opt.Contains("h", TString::kIgnoreCase);
-    const Bool_t hasmean = opt.Contains("*", TString::kIgnoreCase);
-    const Bool_t hasdot  = opt.Contains(".", TString::kIgnoreCase);
-    const Bool_t usecam  = opt.Contains("c", TString::kIgnoreCase);
+    if (o.IsNull())
+        o = "*.";
+
+    const Bool_t hashist = o.Contains("h", TString::kIgnoreCase);
+    const Bool_t hasmean = o.Contains("*", TString::kIgnoreCase);
+    const Bool_t hasdot  = o.Contains(".", TString::kIgnoreCase);
+    const Bool_t usecam  = o.Contains("c", TString::kIgnoreCase);
 
     // Get camera
Index: trunk/MagicSoft/Mars/mastro/MAstroCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCamera.h	(revision 3596)
+++ trunk/MagicSoft/Mars/mastro/MAstroCamera.h	(revision 3666)
@@ -22,6 +22,6 @@
 
     Int_t  ConvertToPad(const TVector3 &w, TVector2 &v) const;
-    void   AddPrimitives(Option_t *o);
-    void   SetRangePad() { }
+    void   AddPrimitives(TString o);
+    void   SetRangePad(Option_t *o) { }
     void   ExecuteEvent(Int_t event, Int_t mp1, Int_t mp2);
 
Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 3596)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 3666)
@@ -147,14 +147,5 @@
 MAstroCatalog::~MAstroCatalog()
 {
-    if (fTime)
-        delete fTime;
-    if (fObservatory)
-        delete fObservatory;
-
-    fToolTip->Hide();
-    delete fToolTip;
-
-    DeleteMap();
-
+    // First disconnect the EventInfo...
     // FIXME: There must be an easier way!
     TIter Next(gROOT->GetListOfCanvases());
@@ -164,4 +155,14 @@
                       "EventInfo(Int_t,Int_t,Int_t,TObject*)");
 
+    // Now delete the data members
+    if (fTime)
+        delete fTime;
+    if (fObservatory)
+        delete fObservatory;
+
+    fToolTip->Hide();
+    delete fToolTip;
+
+    DeleteMap();
 }
 
@@ -438,8 +439,10 @@
 void MAstroCatalog::Paint(Option_t *o)
 {
-    SetRangePad();
+    SetRangePad(o);
 
     if (TestBit(kHasChanged))
         DrawPrimitives(o);
+
+    PaintMap();
 }
 
@@ -458,5 +461,5 @@
 
     // draw star on the camera display
-    TMarker *tip=new TMarker(x, y, transparent ? kDot : kFullDotLarge);;
+    TMarker *tip=new TMarker(x, y, transparent ? kDot : kFullDotMedium);;
     tip->SetMarkerColor(kBlack);
     AddMap(tip, new TString(str));
@@ -517,12 +520,13 @@
         w *= 1./w(2);
 
-    w *= TMath::RadToDeg();
-    v.Set(w(0), w(1));
+    w *= TMath::RadToDeg(); // FIXME: *conversion factor?
+    v.Set(TestBit(kMirrorX) ? -w(0) : w(0),
+          TestBit(kMirrorY) ? -w(1) : w(1));
 
     if (w(2)<0)
         return kERROR;
 
-    return w(0)>gPad->GetX1() && w(1)>gPad->GetY1() &&
-           w(0)<gPad->GetX2() && w(1)<gPad->GetY2();
+    return v.X()>gPad->GetX1() && v.Y()>gPad->GetY1() &&
+           v.X()<gPad->GetX2() && v.Y()<gPad->GetY2();
 }
 
@@ -610,6 +614,4 @@
             dx[0] = d[0]+dirs[i][0];
             dy[0] = d[1]+dirs[i][1];
-
-            //cout << dx[0] << " " << dy[0] << endl;
 
             // Draw corresponding line and iterate through grid
@@ -756,8 +758,7 @@
 
     txt.Prepend("#splitline{");
-
-    txt += Form("  \\theta=%.1fh ",    fmod(zd+270,180)-90);
-    txt += Form("\\phi=%.1f\\circ ",   fmod(az+720, 360));
-    txt += Form(" / \\rho=%.1f\\circ", rho*TMath::RadToDeg());
+    txt += Form("  \\theta=%.1f\\circ ", fmod(zd+270,180)-90);
+    txt += Form("\\phi=%.1f\\circ ",     fmod(az+720, 360));
+    txt += Form(" / \\rho=%.1f\\circ",   rho*TMath::RadToDeg());
     txt += "}{<";
     txt += fTime->GetSqlDateTime();
@@ -767,9 +768,42 @@
 
 // --------------------------------------------------------------------------
-void MAstroCatalog::AddPrimitives(Option_t *o)
-{
-    const Bool_t local = TString(o).Contains("local", TString::kIgnoreCase);
-
-    cout << "Opt: " << o << endl;
+//
+// To overlay the catalog make sure, that in any case you are using
+// the 'same' option.
+//
+// If you want to overlay this on top of any picture which is created
+// by derotation of the camera plain you have to use the 'mirror' option
+// the compensate the mirroring of the image in the camera plain.
+//
+// If you have already compensated this by x=-x and y=-y when creating
+// the histogram you can simply overlay the catalog.
+//
+// To overlay the catalog on a 2D histogram the histogram must have
+// units of degrees (which are plain, like you directly convert the
+// camera units by multiplication to degrees)
+//
+// To be 100% exact you must use the option 'plain' which assumes a plain
+// screen. This is not necessary for the MAGIC-camera because the
+// difference between both is less than 1e-3.
+//
+// You should always be aware of the fact, that the shown stars and the
+// displayed grid is the ideal case, like a reflection on a virtual
+// perfectly aligned central mirror. In reality the star-positions are
+// smeared to the edge of the camera the more the distance to the center
+// is, such that the center of gravity of the light distribution might
+// be more far away from the center than the display shows.
+//
+//
+void MAstroCatalog::AddPrimitives(TString o)
+{
+    const Bool_t same   = o.Contains("same",    TString::kIgnoreCase);
+    const Bool_t local  = o.Contains("local",   TString::kIgnoreCase);
+    const Bool_t mirx   = o.Contains("mirrorx", TString::kIgnoreCase);
+    const Bool_t miry   = o.Contains("mirrory", TString::kIgnoreCase);
+    const Bool_t mirror = o.Contains("mirror",  TString::kIgnoreCase) && !mirx && !miry;
+
+    // X is vice versa, because ra is defined anti-clockwise
+    mirx || mirror ? ResetBit(kMirrorX) : SetBit(kMirrorX);
+    miry || mirror ? SetBit(kMirrorY) : ResetBit(kMirrorY);
 
     const TRotation rot(GetGrid(local));
@@ -782,10 +816,13 @@
         TVector2 s(v->Phi(), v->Theta());
         if (Convert(rot, s)==kTRUE)
-            DrawStar(s.X(), -(TMath::Pi()/2-s.Y()), *v, kFALSE);
-    }
-
-    TPaveText *pv = new TPaveText(0.01, 0.90, 0.63, 0.99, "brNDC");
-    pv->AddText(GetPadTitle());
-    AddMap(pv);
+            DrawStar(s.X(), s.Y(), *v, kFALSE);
+    }
+
+    if (!same)
+    {
+        TPaveText *pv = new TPaveText(0.01, 0.90, 0.63, 0.99, "brNDC");
+        pv->AddText(GetPadTitle());
+        AddMap(pv);
+    }
 
     TMarker *mk=new TMarker(0, 0, kMultiply);
@@ -796,16 +833,19 @@
 
 // --------------------------------------------------------------------------
-void MAstroCatalog::SetRangePad()
-{
-     const Double_t edge = fRadiusFOV/TMath::Sqrt(2.);
-     gPad->Range(-edge, -edge, edge, edge);
-
-     const Float_t w = gPad->GetWw();
-     const Float_t h = gPad->GetWh();
-
-     if (w<h)
-         gPad->Range(-edge, -edge*h/w, edge, edge*h/w);
-     else
-         gPad->Range(-edge*w/h, -edge, edge*w/h, edge);
+void MAstroCatalog::SetRangePad(Option_t *o)
+{
+    if (TString(o).Contains("same", TString::kIgnoreCase))
+        return;
+
+    const Double_t edge = fRadiusFOV/TMath::Sqrt(2.);
+    gPad->Range(-edge, -edge, edge, edge);
+
+    const Float_t w = gPad->GetWw();
+    const Float_t h = gPad->GetWh();
+
+    if (w<h)
+        gPad->Range(-edge, -edge*h/w, edge, edge*h/w);
+    else
+        gPad->Range(-edge*w/h, -edge, edge*w/h, edge);
 }
 
@@ -815,5 +855,5 @@
     DeleteMap();
 
-    SetRangePad();
+    SetRangePad(o);
 
     TStopwatch clk;
@@ -827,17 +867,14 @@
         AppendPad(o);
 
-    // Append all objects to pad
-    DrawMap();
-
     ResetBit(kHasChanged);
 }
 
 // --------------------------------------------------------------------------
-void MAstroCatalog::DrawMap()
+void MAstroCatalog::PaintMap()
 {
     Long_t key, val;
     TExMapIter map(&fMapG);
     while (map.Next(key, val))
-        ((TObject*)key)->Draw();
+        ((TObject*)key)->Paint();
 }
 
@@ -1016,2 +1053,22 @@
     fToolTip->Show(x+4, y+4);
 }
+/*
+void MAstroCatalog::RecursiveRemove(TObject *obj)
+{
+    ULong_t hash;
+    Long_t key, val;
+
+    TExMapIter map(&fMapG);
+    while (map.Next(hash, key, val))
+    {
+        if (key != (Long_t)obj)
+            continue;
+
+        fMapG.Remove(hash, key);
+        delete (TObject*)(key);
+        if (val)
+            delete (TString*)(val);
+        break;
+    }
+}
+*/
Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 3596)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 3666)
@@ -94,6 +94,6 @@
 
     virtual Int_t ConvertToPad(const TVector3 &w, TVector2 &v) const;
-    virtual void  AddPrimitives(Option_t *o);
-    virtual void  SetRangePad();
+    virtual void  AddPrimitives(TString o);
+    virtual void  SetRangePad(Option_t *o);
 
     Int_t     Convert(const TRotation &rot, TVector2 &v) const;
@@ -105,5 +105,6 @@
     void      Paint(Option_t *o="");
     Int_t     DistancetoPrimitive(Int_t px, Int_t py);
-    void      DrawMap();
+    //void      RecursiveRemove(TObject *obj);
+    void      PaintMap();
     void      DeleteMap()
     {
@@ -117,13 +118,14 @@
 
             delete (TString*)(val);
-         /*
-            Long_t key2, val2;
-            TExMapIter map2(&fMapG);
-            while (map2.Next(key2, val2))
-                if (val==val2)
-                {
-                    delete (TObject*)key;
-                    fMapG.Remove(key);
-                }*/
+            /*
+              Long_t key2, val2;
+              TExMapIter map2(&fMapG);
+              while (map2.Next(key2, val2))
+                  if (val==val2)
+                  {
+                      delete (TObject*)key;
+                      fMapG.Remove(key);
+                  }
+             */
         }
         fMapG.Delete();
@@ -134,5 +136,7 @@
         kHasChanged  = BIT(15),
         kGuiActive   = BIT(16),
-        kPlainScreen = BIT(17)
+        kPlainScreen = BIT(17),
+        kMirrorX     = BIT(18),
+        kMirrorY     = BIT(19)
     };
 
@@ -140,5 +144,5 @@
     MVector3 fRaDec;     // pointing position
 
-    MObservatory *fObservatory; // Possible obervatora location
+    MObservatory *fObservatory; // Possible obervatory location
     MTime        *fTime;        // Possible observation time
 
@@ -153,6 +157,6 @@
     void AddMap(TObject *k, void *v=0)
     {
-        k->SetBit(kCanDelete);
-        k->SetBit(kCannotPick);
+        //k->SetBit(kCanDelete);
+        //k->SetBit(kCannotPick);
         fMapG.Add(fMapG.GetSize(), (Long_t)k, (Long_t)v);
     }
@@ -164,5 +168,5 @@
     void SetTime(const MTime &time);
     void SetObservatory(const MObservatory &obs);
-    void SetLimMag(Double_t mag) { fLimMag=mag;    Update(); } // *MENU* *ARGS={mag=>fLimMag}
+    void SetLimMag(Double_t mag) { fLimMag=mag; Update(); } // *MENU* *ARGS={mag=>fLimMag}
     void SetRadiusFOV(Double_t deg)
     {
