Index: /trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.rc	(revision 6507)
+++ /trunk/MagicSoft/Mars/callisto.rc	(revision 6508)
@@ -1,3 +1,4 @@
-# ==========================================================================
+# 
+==========================================================================
 #############################################################################
 # ==========================================================================
@@ -316,4 +317,9 @@
 
 # -------------------------------------------------------------------------
+# Use this if you want to change to time from run headers instead of event time
+# -------------------------------------------------------------------------
+#MJCalibrateSignal.MPointingPosInterpolate.TimeMode: eventtime, runtime
+
+# -------------------------------------------------------------------------
 # Use this if you want to change the signal extractor
 # -------------------------------------------------------------------------
Index: /trunk/MagicSoft/Mars/mpointing/MPointingPosInterpolate.cc
===================================================================
--- /trunk/MagicSoft/Mars/mpointing/MPointingPosInterpolate.cc	(revision 6507)
+++ /trunk/MagicSoft/Mars/mpointing/MPointingPosInterpolate.cc	(revision 6508)
@@ -177,10 +177,11 @@
 	// Sometimes there are two reports with the same time
 	//
-	if (reporttime->GetTime() == reportTime[n-2])
-	{ 
-	    *fLog << warn <<"["<< GetName() 
-                << "]: Warning: this report has the same time that the previous one...skipping it " << endl;
-	    continue;
-	}
+	if (n>1)
+	  if (reporttime->GetTime() == reportTime[n-2])
+	    { 
+	      *fLog << warn <<"["<< GetName() 
+		    << "]: Warning: this report has the same time that the previous one...skipping it " << endl;
+	      continue;
+	    }
 
 	reportTime[n-1] = reporttime->GetTime();
@@ -294,4 +295,5 @@
     //const Int_t run = fRunHeader->GetRunNumber();
   const MTime &StartRunTime = fRunHeader->GetRunStart();
+  const MTime &EndRunTime   = fRunHeader->GetRunEnd();
   Int_t time = StartRunTime.GetTime();
 
@@ -302,4 +304,7 @@
          // Check that we have drive report for this time
          //
+
+         time = (EndRunTime.GetTime() + StartRunTime.GetTime())/2;
+
          if( StartRunTime<fFirstDriveTime || StartRunTime>fLastDriveTime)
          {
@@ -317,12 +322,7 @@
 
     case kEventTime:
+      
         time = fEvtTime->GetTime();       
 
-	if (fDebug)
-	  {
-	    *fLog << " real time : " << time 
-		 << " first time: " << fFirstDriveTime.GetTime()
-		 << " last time: " << fLastDriveTime.GetTime() << endl;
-	  }
         //
         // Check that we have drive report for this time
@@ -340,13 +340,16 @@
 	    else                                   time = fLastDriveTime.GetTime();
 		
-	    if (fDebug)
-	      {
-		*fLog << " PointingPos: time = " << time << " (" << *fEvtTime << ")  (zd, az) = (" 
-		      << fSplineZd->Eval( time )<< ", "  <<fSplineAz->Eval( time )<< ")" << endl;
-	      }
         }
         break;
     }
 
+   if (fDebug)
+     {
+       *fLog << " real time : " << time 
+	     << " first time: " << fFirstDriveTime.GetTime()
+	     << " last time: " << fLastDriveTime.GetTime() << endl;
+       *fLog << " PointingPos: time = " << time << " (" << *fEvtTime << ")  (zd, az) = (" 
+	     << fSplineZd->Eval( time )<< ", "  <<fSplineAz->Eval( time )<< ")" << endl;
+     }
     //
     // Check that we have drive report for this time
@@ -389,4 +392,21 @@
 	rc = kTRUE;
       }
+
+    if (IsEnvDefined(env, prefix, "TimeMode", print))
+      {
+
+	TString dat(GetEnvValue(env, prefix, "TimeMode", ""));
+	dat.ToLower();
+
+	rc = kTRUE;
+
+	if (dat.Contains("eventtime"))
+	  SetTimeMode(kEventTime);
+	else if (dat.Contains("runtime"))
+	  SetTimeMode(kRunTime);
+	else
+	  rc = kFALSE;
+      }
     return rc;
 }
+
