Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7725)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7726)
@@ -26,4 +26,30 @@
      - replaced in FindBestSpllit* a sanity check for rld and rrd (do
        not divide by zero) by a check whether the result (crit) is finite
+
+   * mcamera/MCameraRecTemp.[h,cc]:
+     - implemented new data member for validity
+     - increased class version by 1
+
+   * mpointing/MHPointing.[h,cc]:
+     - implemented new TGraph for number of correlated stars
+     - increased class version by 1
+
+   * mpointing/MPointingDevCalc.cc:
+     - if the report is empty assume no pointing deviation and also
+       reset the starguider calibration
+
+   * mpointing/MPointingPos.cc:
+     - slight modifications to comment
+
+   * mreport/MReport.cc:
+     - introduced new fake version to support new starguider format
+
+   * mreport/MReportCC.[h,cc]:
+     - improved handling of receiver boar com-errors and RecTemp section
+
+   * mreport/MReportStarguider.[h,cc]:
+     - implemented changes in the starguider reports around 9th May
+     - added new data member for number of correlated stars
+     - increased class version by 1
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7725)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7726)
@@ -3,16 +3,23 @@
  *** Version  <cvs>
 
-   - merpp: better handling of problems with the TH and TD part of the 
+   - merpp: better handling of problems with the TH, TD part of the 
      CC-REPORT for files older than 200507190 and 200412210 
      respectively
+
+   - merpp: improved handling of RECEIVERS-COM-ERROR in CC-REPORT
+
+   - merpp: implementd latest changes in starguider reports (sinc 9th May)
+
+   - star: Show also the number of stars correlated correctly by the
+     starguider
 
    - ganymed: implemented a new class (MHThetaSqN) which allows to use more
      than one off-source region in wobble-mode. To use it add the following to
      your ganymed_wobble.rc:
-       + MJCut.NameHist: MHThetaSqN             (switch the new feature on)
-       + MHThetaSqN.NumOffSourcePos: 3          (define the number of off-regions)
-       + MHThetaSqN.DoOffCut: Yes,No            (switch on/off the off-cut)
-       + Cut1.ThetaCut: None
-       + MHThetaSqN.SignificanceCutLevel: 2.0   (increase off-cut by 2.0/1.7)
+      + MJCut.NameHist: MHThetaSqN            (switch the new feature on)
+      + MHThetaSqN.NumOffSourcePos: 3         (define number of off-regions)
+      + MHThetaSqN.DoOffCut: Yes,No           (switch on/off the off-cut)
+      + Cut1.ThetaCut: None                 
+      + MHThetaSqN.SignificanceCutLevel: 2.0  (increase off-cut by 2.0/1.7)
 
 
Index: trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc	(revision 7726)
@@ -19,5 +19,5 @@
 !   Author(s): Florian Goebel 11/2005 <mailto:fgoebel@mppmu.mpg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2005
+!   Copyright: MAGIC Software Development, 2000-2006
 !
 !
@@ -27,4 +27,8 @@
 //
 // MCameraRecTemp
+//
+// Class Version 2:
+// ----------------
+//   + Bool_t  fIsValid; // fTD contains valid information
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -45,5 +49,5 @@
 //
 MCameraRecTemp::MCameraRecTemp(Int_t size, const char *name, const char *title)
-    : fRecTemp(size)
+    : fRecTemp(size), fIsValid(kTRUE)
 {
     fName  = name  ? name  : "MCameraRecTemp";
Index: trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h	(revision 7725)
+++ trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h	(revision 7726)
@@ -15,4 +15,5 @@
 private:
     TArrayF fRecTemp; // [deg C] receiver board temperatures
+    Bool_t  fIsValid; // fRecTemp contains valid information
 
 public:
@@ -21,4 +22,9 @@
     Float_t operator[](Int_t i) const { return fRecTemp[i]; }
 
+    void Invalidate() { fRecTemp.Reset(); fIsValid=kFALSE; }
+
+    void SetValid(Bool_t v=kTRUE) { fIsValid=v; }
+    Bool_t IsValid() const { return fIsValid; }
+
     Float_t GetMin() const;
     Float_t GetMax() const;
@@ -26,5 +32,5 @@
     void Print(Option_t *opt=NULL) const;
 
-    ClassDef(MCameraRecTemp, 1) // Storage Container for Receiver Board Temperature
+    ClassDef(MCameraRecTemp, 2) // Storage Container for Receiver Board Temperature
 };
 
Index: trunk/MagicSoft/Mars/mpointing/MHPointing.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MHPointing.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mpointing/MHPointing.cc	(revision 7726)
@@ -29,4 +29,9 @@
 // Display drive information
 //
+// Class Version 2:
+// ----------------
+//
+//  + TGraph fNumStarsCor; // Number of correlated stars identified by starguider
+//
 ////////////////////////////////////////////////////////////////////////////
 #include "MHPointing.h"
@@ -86,11 +91,12 @@
 
     // Init Graphs
-    fDevTimeSG.SetNameTitle("DevSG",       "Absolute deviation of drive (black) and starguider (blue)");
-    fDevTimeCosy.SetNameTitle("DevCosy",   "Cosy deviation");
-    fBrightness.SetNameTitle("Brightness", "Arbitrary Sky Brightness (black), No. of stars identified by starguider (blue)");
-    fNumStars.SetNameTitle("NumStars",     "Number of stars identified by starguider");
-    fDevZd.SetNameTitle("DevZd",           "Starguider deviation Zd (blue), Az (black)");
-    fDevAz.SetNameTitle("DevAz",           "Starguider Deviation Az");
-    fPosZd.SetNameTitle("PosZd",           "Nominal position Zd");
+    fDevTimeSG.SetNameTitle("DevSG",         "Absolute deviation of drive (black) and starguider (blue)");
+    fDevTimeCosy.SetNameTitle("DevCosy",     "Cosy deviation");
+    fBrightness.SetNameTitle("Brightness",   "Arbitrary Sky Brightness (black), No. of stars identified by starguider (blue)");
+    fNumStars.SetNameTitle("NumStars",       "Number of stars identified by starguider");
+    fNumStarsCor.SetNameTitle("NumStarsCor", "Number of stars correlated by starguider");
+    fDevZd.SetNameTitle("DevZd",             "Starguider deviation Zd (blue), Az (black)");
+    fDevAz.SetNameTitle("DevAz",             "Starguider Deviation Az");
+    fPosZd.SetNameTitle("PosZd",             "Nominal position Zd");
     //fPosAz.SetNameTitle("PosZd",          "Position Az");
 
@@ -99,4 +105,5 @@
     InitGraph(fBrightness);
     InitGraph(fNumStars);
+    InitGraph(fNumStarsCor);
     InitGraph(fDevZd);
     InitGraph(fDevAz);
@@ -108,8 +115,10 @@
     fBrightness.SetMinimum(0);
     fNumStars.SetMinimum(0);
+    fNumStarsCor.SetMinimum(0);
 
     fDevTimeSG.SetMarkerColor(kBlue);
     fDevZd.SetMarkerColor(kBlue);
     fNumStars.SetMarkerColor(kBlue);
+    fNumStarsCor.SetMarkerColor(kMagenta);
     //fPosAz.SetMarkerColor(kBlue);
 }
@@ -170,6 +179,7 @@
         if (fReportSG->GetSkyBrightness()>0)
         {
-            AddPoint(fBrightness, tm, fReportSG->GetSkyBrightness());
-            AddPoint(fNumStars,   tm, fReportSG->GetNumIdentifiedStars());
+            AddPoint(fBrightness,  tm, fReportSG->GetSkyBrightness());
+            AddPoint(fNumStars,    tm, fReportSG->GetNumIdentifiedStars());
+            AddPoint(fNumStarsCor, tm, fReportSG->GetNumCorrelatedStars());
         }
 
@@ -227,9 +237,10 @@
 // Update position of an axis on the right side of the histogram
 //
-void MHPointing::UpdateRightAxis(TGraph &g) const
-{
-    TH1 &h = *g.GetHistogram();
-
-    const Double_t max = h.GetMaximum();
+void MHPointing::UpdateRightAxis(TGraph &g1, TGraph &g2) const
+{
+    TH1 &h1 = *g1.GetHistogram();
+    TH1 &h2 = *g2.GetHistogram();
+
+    const Double_t max = TMath::Max(h1.GetMaximum(), h2.GetMaximum());
     if (max==0)
         return;
@@ -239,6 +250,6 @@
         return;
 
-    axis->SetX1(g.GetXaxis()->GetXmax());
-    axis->SetX2(g.GetXaxis()->GetXmax());
+    axis->SetX1(g1.GetXaxis()->GetXmax());
+    axis->SetX2(g1.GetXaxis()->GetXmax());
     axis->SetY1(gPad->GetUymin());
     axis->SetY2(gPad->GetUymax());
@@ -292,4 +303,5 @@
     fBrightness.Draw("AP");
     fNumStars.Draw("P");
+    fNumStarsCor.Draw("P");
     DrawRightAxis("N");
 
@@ -327,5 +339,5 @@
     {
         fNumStars.GetHistogram()->GetYaxis()->SetTitleColor(kBlue);
-        UpdateRightAxis(fNumStars);
+        UpdateRightAxis(fNumStars, fNumStarsCor);
     }
 /*
Index: trunk/MagicSoft/Mars/mpointing/MHPointing.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MHPointing.h	(revision 7725)
+++ trunk/MagicSoft/Mars/mpointing/MHPointing.h	(revision 7726)
@@ -25,4 +25,5 @@
 
     TGraph             fNumStars;    // Number of stars identified by starguider
+    TGraph             fNumStarsCor; // Number of correlated stars identified by starguider
 
     TGraph             fDevZd;       // Starguider deviation Zd
@@ -36,5 +37,5 @@
     void AddPoint(TGraph &g, Double_t x, Double_t y) const;
     void DrawGraph(TGraph &g, const char *y=0) const;
-    void UpdateRightAxis(TGraph &g) const;
+    void UpdateRightAxis(TGraph &g1, TGraph &g2) const;
     void DrawRightAxis(const char *title) const;
 
@@ -48,5 +49,5 @@
     void Paint(Option_t *opt="");
 
-    ClassDef(MHPointing, 1) // Histogram to display tracking/pointing information
+    ClassDef(MHPointing, 2) // Histogram to display tracking/pointing information
 };
 
Index: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 7726)
@@ -140,4 +140,5 @@
     {
         fDeviation->SetDevZdAz(0, 0);
+        fDeviation->SetDevXY(0, 0);   //?!?
         fSkip[1]++;
         return kTRUE;
Index: trunk/MagicSoft/Mars/mpointing/MPointingPos.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingPos.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mpointing/MPointingPos.cc	(revision 7726)
@@ -64,4 +64,6 @@
 // (Zd/Az) coordinates.
 //
+// Return angle [rad] in the range -pi, pi
+//
 // For more information see MAstro::RotationAngle
 //
@@ -76,4 +78,6 @@
 // seen with an Alt/Az telescope calculated from the stored sky
 // (Ra/Dec) coordinates.
+//
+// Return angle [rad] in the range -pi, pi
 //
 // For more information see MAstro::RotationAngle
Index: trunk/MagicSoft/Mars/mreport/MReport.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 7726)
@@ -123,4 +123,5 @@
 //    200510250  | 53801.5 | 53813.5 |  200603080
 //    200510250  | 53813.5 |         |  200603190
+//    200604010  | 53863.5 |         |  200605080
 //
 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
@@ -153,4 +154,7 @@
         ver=200603190;
 
+    if (ver==200604010 && GetMjd()>53864.5)
+        ver=200605080;
+
     // Interprete body (contents) of report
     const Int_t rc = InterpreteBody(str, ver);
Index: trunk/MagicSoft/Mars/mreport/MReportCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 7726)
@@ -261,4 +261,11 @@
             continue;
 
+        if (n==0 && i==0)
+        {
+            *fLog << inf << "Receiver Board Temperatures empty." << endl;
+            fRecTemp->Invalidate();
+            break;
+        }
+
         *fLog << warn << "WARNING - Reading Receiver Board Temperature information." << endl;
         return kFALSE;
@@ -286,6 +293,8 @@
     if (str.BeginsWith("RECEIVERS-COM-ERROR"))
     {
+        *fLog << inf << "Receiver Com-error... threshold setting and receiver board temp. invalid." << endl;
         fTD->Invalidate();
         fTH->Invalidate();
+        fRecTemp->Invalidate();
         str.Remove(0, 19);
     }
@@ -297,9 +306,9 @@
         if (!InterpreteTD(str, ver))
             return kCONTINUE;
-    }
-
-    if (ver>=200510250)
-        if (!InterpreteRecTemp(str))
-            return kCONTINUE;
+
+        if (ver>=200510250)
+            if (!InterpreteRecTemp(str))
+                return kCONTINUE;
+    }
 
     if (str.Strip(TString::kBoth)!=(TString)"OVER")
Index: trunk/MagicSoft/Mars/mreport/MReportStarguider.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportStarguider.cc	(revision 7725)
+++ trunk/MagicSoft/Mars/mreport/MReportStarguider.cc	(revision 7726)
@@ -58,4 +58,9 @@
 //  + Double_t fMjd;                // Modified Julian Date matching the nominal position
 //
+//
+// Class Version 3:
+// ----------------
+//  + UInt_t   fNumCorrelatedStars; // Number of correlated stars identified by starguider algorithm
+//
 //////////////////////////////////////////////////////////////////////////////
 #include "MReportStarguider.h"
@@ -73,11 +78,34 @@
 // Default constructor. Initialize identifier to "STARG-REPORT"
 //
-MReportStarguider::MReportStarguider() : MReport("STARG-REPORT"),
+MReportStarguider::MReportStarguider() : MReport("STARG-REPORT")/*,
     fDevAz(0), fDevZd(0), fNominalZd(0), fNominalAz(0),
     fCameraCenterX(0), fCameraCenterY(0), fNumIdentifiedStars(0),
-    fSkyBrightness(0)
+    fNumCorrelatedStars(0), fSkyBrightness(0)*/
 {
     fName  = "MReportStarguider";
     fTitle = "Class for STARG-REPORT information (telescope mispointing)";
+
+    Clear();
+}
+
+// --------------------------------------------------------------------------
+//
+// Interprete the body of the STARG-REPORT string
+//
+void MReportStarguider::Clear(Option_t *o)
+{
+    fDevAz              = 0;
+    fDevZd              = 0;
+
+    fNominalZd          = 0;
+    fNominalAz          = 0;
+
+    fCameraCenterX      = 0;
+    fCameraCenterY      = 0;
+
+    fNumIdentifiedStars = 0;
+    fNumCorrelatedStars = 0;
+
+    fSkyBrightness      = 0;
 }
 
@@ -146,4 +174,20 @@
     }
 
+    if (ver>=200605080)
+    {
+        // For the momment this are only placeholders....
+        fNumCorrelatedStars = fNumIdentifiedStars;
+        n=sscanf(str.Data(), "%df %n", &fNumIdentifiedStars, &len);
+        if (n!=1)
+        {
+            *fLog << warn << "WARNING - Not enough arguments." << endl;
+            *fLog << str << endl;
+            return kCONTINUE;
+        }
+
+        str.Remove(0, len);
+        str = str.Strip(TString::kBoth);
+    }
+
     return str.IsNull() ? kTRUE : kCONTINUE;
 }
Index: trunk/MagicSoft/Mars/mreport/MReportStarguider.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportStarguider.h	(revision 7725)
+++ trunk/MagicSoft/Mars/mreport/MReportStarguider.h	(revision 7726)
@@ -23,4 +23,5 @@
 
     UInt_t   fNumIdentifiedStars; // Number of stars identified by starguider algorithm
+    UInt_t   fNumCorrelatedStars; // Number of correlated stars identified by starguider algorithm
 
     Double_t fSkyBrightness;      // [au] Sky Brightness as calcualted from the CCD image
@@ -31,4 +32,6 @@
 public:
     MReportStarguider();
+
+    void Clear(Option_t *o="");
 
     Double_t GetDevAz() const { return fDevAz; }
@@ -46,4 +49,5 @@
 
     UInt_t   GetNumIdentifiedStars() const { return fNumIdentifiedStars; }
+    UInt_t   GetNumCorrelatedStars() const { return fNumCorrelatedStars; }
 
     Double_t GetSkyBrightness() const { return fSkyBrightness; }
@@ -52,5 +56,5 @@
     void Print(Option_t *o="") const;
 
-    ClassDef(MReportStarguider, 2) // Class for STARG-REPORT information
+    ClassDef(MReportStarguider, 3) // Class for STARG-REPORT information
 };
 
