Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 4867)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 4888)
@@ -20,23 +20,25 @@
      - Acquisition of sky brightness (average CCD pixel content in Starfield)
        and comparison to last sky brightness
-     - MStarguider::TrackingError(): Modified histogram binning to enhance excess
+     - MStarguider::TrackingError(): Modified histogram binning to enhance 
+       excess
      - MStarguider::FindStar(): Now returns position of found star as ZdAz
-     - MStarguider::FindStar(): Cut and ROI box can now handed over as parameters
+     - MStarguider::FindStar(): Cut and ROI box can now handed over as i
+       parameters
      - MStarguider::FindStar(): Scale factor to compensate for different FOV
        (TPoint camera vs. Starfield camera)
      - MStarguider::ProcessFrame(): Modified structure to accomodate Starguider
-       algorithm and tools: 1) Find Center of PMT camera, find Star (if activated)
+       algorithm and tools: 1) Find Center of PMT camera, find Star (if 
+       activated)
        to obtain misspointing found from PMT camera.
      - Set ROI for starfield in space not occupied by the PMT camera in the 
        starfield camera FOV
      - Calculate star positions and draw stars only in that ROI
-     - fStatus variable contains status of starguider (Error, Monitoring, Standby)
+     - fStatus variable contains status of starguider (Error, Monitoring, 
+       Standby)
      - Draw representation of MAGIC's FOV on starfield
      - Send STARG-REPORTS unconditionally by using MDriveCom::SendStargReport 
-
-
- Finalized
-       details of all changes follow after some additional testing
-       on 2004/09/06 (this evening).
+     - Add Ra/Dec in filename when writing pictures
+     - Introduced #define EXPERT to allow for debug output
+     - tracking_*.txt is only produced in case of EXPERT mode
 
    * tcpip/MTcpIpIO.[h,cc], tcpip/MCeCoCom.[h,cc]
@@ -95,5 +97,8 @@
        chosen FOV
 
+   * videodev/Writer.[cc,h]
+     - Ra/Dec in filename when writing pictures
   
+
 
  2004/08/23 - Thomas Bretz
Index: trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4867)
+++ trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4888)
@@ -658,5 +658,4 @@
                 return kTRUE;
 
-
             case IDM_kStargHistograms:
                 Toggle(fDisplay, IDM_kStargHistograms);
@@ -942,7 +941,7 @@
     TH2F h("Hist", "dX/dY", 49, -768/2-8, 768/2+8, 37, -576/2-8, 576/2+8); // 3
 
-    TH1F hmag("HistMag", "Mag", 19, 0, 100);
-    for (int i=0; i<mag.GetSize(); i++)
-        hmag.Fill(mag[i]);
+//     TH1F hmag("HistMag", "Mag", 19, 0, 100);
+//     for (int i=0; i<mag.GetSize(); i++)
+//         hmag.Fill(mag[i]);
     
     //
@@ -1040,4 +1039,5 @@
     stars.Sort(); // Sort by magnitude
 
+#ifdef EXPERT
     TString str = "data/tracking_";
     str += fSao->GetMjd();
@@ -1045,4 +1045,5 @@
 
     ofstream fout(str);
+#endif
 
     TArrayF x, y, mag;
@@ -1071,5 +1072,5 @@
             y.AddAt(dpos.Y(), idx);
             mag.AddAt(spot->GetMag()/star->GetMag(), idx);
-
+#ifdef EXPERT
             if (fout) {
 		fout << spot->GetX() << " " 
@@ -1081,4 +1082,5 @@
                 fout << x[idx] << " " << y[idx] << " " << mag[idx] << endl;
 	    }
+#endif
         }
     }  
@@ -1292,10 +1294,11 @@
     if (!fWritePictures->IsEntryEnabled(IDM_kStart) &&
         (!(n%fWrtRate) || fWriteType->IsEntryChecked(IDM_kOnce)))
-    {
+    {     
+ 
         if (fFileType->IsEntryChecked(IDM_kPNG))
-            Writer::Png("pix/file", img, tm);
+            Writer::Png("pix/file", img, tm, fCRaDec->GetCoordinates());
 	
         if (fFileType->IsEntryChecked(IDM_kPPM))
-            Writer::Ppm("pix/file", img, tm);
+            Writer::Ppm("pix/file", img, tm, fCRaDec->GetCoordinates());
 	
         if (fWriteType->IsEntryChecked(IDM_kOnce))
Index: trunk/MagicSoft/Cosy/videodev/Writer.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 4867)
+++ trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 4888)
@@ -6,4 +6,5 @@
 #include <stdio.h>    // FILE
 #include <png.h>
+#include <coord.h>
 
 #include "MTime.h"
@@ -12,5 +13,5 @@
 
 void Writer::Png(const char *fname, const byte *buf,
-                 struct timeval *date)
+                 struct timeval *date, const XY xy)
 {
     MTime t(*date);
@@ -21,7 +22,18 @@
         mjd.Append('0', 10-mjd.Length());
 
+    TString pos;
+    pos += xy.X();
+    pos = pos.Strip(TString::kBoth);
+    pos +="_";
+    TString posy;
+    posy += xy.Y();
+    posy = posy.Strip(TString::kBoth);
+    pos +=posy;
+
     TString name = fname;
     name += "_";
     name += mjd;
+    name += "_";
+    name += pos;
     name += ".png";
 
@@ -125,5 +137,5 @@
 }
 
-void Writer::Ppm(const char *fname, const byte *img, struct timeval *date)
+void Writer::Ppm(const char *fname, const byte *img, struct timeval *date, const XY xy)
 {
     TString name = fname;
@@ -131,6 +143,17 @@
     MTime t(*date);
 
+    TString pos;
+    pos += xy.X();
+    pos = pos.Strip(TString::kBoth);
+    pos +="_";
+    TString posy;
+    posy += xy.Y();
+    posy = posy.Strip(TString::kBoth);
+    pos +=posy;
+
     name += "_";
     name += t.GetMjd()-52000;
+    name += "_";
+    name += pos;  
     name += ".ppm";
 
Index: trunk/MagicSoft/Cosy/videodev/Writer.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 4867)
+++ trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 4888)
@@ -9,4 +9,8 @@
 #endif
 
+#ifndef COORD_H
+#include <coord.h>
+#endif
+
 typedef unsigned char byte;
 
@@ -17,6 +21,6 @@
 public:
 
-    static void Ppm(const char *fname, const byte *img, struct timeval *date);
-    static void Png(const char *fname, const byte *buf, struct timeval *date);
+    static void Ppm(const char *fname, const byte *img, struct timeval *date, const XY xy);
+    static void Png(const char *fname, const byte *buf, struct timeval *date, const XY xy);
 
     ClassDef(Writer, 0)
