Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7743)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7744)
@@ -36,8 +36,13 @@
        the status display
 
-   * mpointing/MPointingDevCalc.cc:
+   * mpointing/MPointingDevCalc.[h,cc]:
      - if the mispointing is set to 0 due to missing mispointing
        information also the starguider calibration is reset.
-
+     - in the case the latest report is older than a default (currently
+       one minute) and the current report will be skip the starguider
+       correction and calibration will be reset.
+
+   * ganymed.rc, ganymed_onoff.rc, ganymed_wobble.rc:
+     - updated 
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7743)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7744)
@@ -50,4 +50,10 @@
       + Cut1.ThetaCut: None                 
       + MHThetaSqN.SignificanceCutLevel: 2.0  (increase off-cut by 2.0/1.7)
+
+   - ganymed: in the case the latest report is older than a default (currently
+       one minute) and the current report will be skip the starguider
+       correction and calibration will be reset. The maximum age can be
+       setup from ganymed.rc by (minutes):
+         MPointingDevCalc.MaxAge: 1.5
 
    - ganymed: A first implementation showing all size-bins for the theta-sq
Index: trunk/MagicSoft/Mars/ganymed_wobble.rc
===================================================================
--- trunk/MagicSoft/Mars/ganymed_wobble.rc	(revision 7743)
+++ trunk/MagicSoft/Mars/ganymed_wobble.rc	(revision 7744)
@@ -52,4 +52,5 @@
 #MPointingDevCalc.Dx           -7
 #MPointingDevCalc.Dy           16
+#MPointingDevCalc.MaxAge       1.0
 
 # -------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 7743)
+++ trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 7744)
@@ -84,7 +84,7 @@
     }
 
-    fNsbSum   = 0;
-    fNsbSq    = 0;
-    fNsbCount = 0;
+    fNsbSum   =  0;
+    fNsbSq    =  0;
+    fNsbCount =  0;
 
     fRunType = run->GetRunType();
@@ -127,8 +127,28 @@
     // We use kRTNone here as a placeholder for data runs.
     fRunType  = MRawRunHeader::kRTNone;
+    fLastMjd  = -1;
 
     fSkip.Reset();
 
     return fDeviation ? kTRUE : kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Increase fSkip[i] by one. If the data in fDeviation is outdated (older
+// than fMaxAge) and the current report should be skipped reset DevZdAz and
+// DevXY and fSkip[5] is increased by one.
+//
+void MPointingDevCalc::Skip(Int_t i)
+{
+    fSkip[i]++;
+
+    const Double_t diff = (fReport->GetMjd()-fLastMjd)*1440; // [min] 1440=24*60
+    if (diff<fMaxAge && fLastMjd>0)
+        return;
+
+    fDeviation->SetDevZdAz(0, 0);
+    fDeviation->SetDevXY(0, 0);
+    fSkip[5]++;
 }
 
@@ -142,4 +162,5 @@
         fDeviation->SetDevXY(0, 0);   //?!?
         fSkip[1]++;
+        fLastMjd = fReport->GetMjd();
         return kTRUE;
     }
@@ -167,5 +188,5 @@
             if (nsb<sum-rms || nsb>sum+rms)
             {
-                fSkip[2]++;
+                Skip(2);
                 return kTRUE;
             }
@@ -174,5 +195,5 @@
         if (fReport->GetNumIdentifiedStars()<fNumMinStars)
         {
-            fSkip[3]++;
+            Skip(3);
             return kTRUE;
         }
@@ -185,5 +206,5 @@
     if (dev*60>fMaxAbsDev)
     {
-        fSkip[4]++;
+        Skip(4);
         return kTRUE;
     }
@@ -198,4 +219,5 @@
 
     fSkip[0]++;
+    fLastMjd = fReport->GetMjd();
 
     return kTRUE;
@@ -238,4 +260,5 @@
     PrintSkipped(fSkip[3], Form("Number of identified stars < %d", fNumMinStars));
     PrintSkipped(fSkip[4], Form("Absolute deviation > %.1farcmin", fMaxAbsDev));
+    PrintSkipped(fSkip[5], Form("Events set to 0 because older than %.1fmin", fMaxAge));
     *fLog << " " << (int)fSkip[0] << " (" << Form("%5.1f", 100.*fSkip[0]/GetNumExecutions()) << "%) Evts survived calculation!" << endl;
     *fLog << endl;
@@ -251,4 +274,5 @@
 // MPointingDevCalc.NsbMax:      60
 // MPointingDevCalc.MaxAbsDev:   15
+// MPointingDevCalc.MaxAge:      1.0
 //
 Int_t MPointingDevCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
@@ -290,4 +314,9 @@
         rc = kTRUE;
     }
+    if (IsEnvDefined(env, prefix, "MaxAge", print))
+    {
+        fMaxAge = GetEnvValue(env, prefix, "MaxAge", fMaxAge);
+        rc = kTRUE;
+    }
 
     return rc;
Index: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h	(revision 7743)
+++ trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h	(revision 7744)
@@ -26,4 +26,5 @@
 
     TArrayI  fSkip;                //! Counter for execution statistics
+    Double_t fLastMjd;             //! Time of last processed report
 
     UInt_t  fNumMinStars;          // Minimum number of identified stars
@@ -32,4 +33,5 @@
     Float_t fNsbMax;               // Maximum NSB to calc mean and rms
     Float_t fMaxAbsDev;            // [arcmin] Maximum considered absolute deviation
+    Float_t fMaxAge;               // [min] Maximum age of reports to be used without an update
 
     Float_t fDx;                   // Starguider calibration dx
@@ -38,4 +40,5 @@
     // MPointingDevCalc
     Int_t ProcessStarguiderReport();
+    void  Skip(Int_t i);
 
     // MParContainer
@@ -49,6 +52,6 @@
 
 public:
-    MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(5), fNumMinStars(8),
-        fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fDx(-7), fDy(16)
+    MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(6), fNumMinStars(8),
+        fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fMaxAge(1), fDx(-7), fDy(16)
     {
         fName  = "MPointingDevCalc";
@@ -65,4 +68,5 @@
     void SetDx(Float_t dx)         { fDx=dx; }
     void SetDy(Float_t dy)         { fDy=dy; }
+    void SetMaxAge(Float_t age)    { fMaxAge=age; }
 
     ClassDef(MPointingDevCalc, 0) //Task calculating the pointing deviation
