Index: /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3530)
+++ /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3531)
@@ -99,4 +99,6 @@
     fRaSource  = 0.0;
 
+    // these are the default values when starting the excution;
+    // later these locations contain the values of the last event
     fxSourceold  =  25.0;
     fySourceold  = -40.0;
@@ -292,5 +294,5 @@
     if (fDecSource == 0.0  ||  fRaSource == 0.0  ||  fStars == 0) 
     {
-      *fLog << err << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars = " << fStars 
+      *fLog << warn << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars = " << fStars 
             << endl;
     }
@@ -531,11 +533,11 @@
         }
 
-        MSourcePosfromStarPos::SourcefromStar( fDistCameraReflector,
-                      fDecStar, fRaStar, fDecSource, fRaSource,
-                      fThetaTel[i],   fPhiTel[i],   
-         	      xStar,          yStar,
-		      dxStar,         dyStar,
-		      fxSource,       fySource,
-		      fdxSource,      fdySource);
+        SourcefromStar( fDistCameraReflector,
+                        fDecStar, fRaStar, fDecSource, fRaSource,
+                        fThetaTel[i],   fPhiTel[i],   
+         	        xStar,          yStar,
+		        dxStar,         dyStar,
+		        fxSource,       fySource,
+		        fdxSource,      fdySource);
       
         fSrcPos->SetXY(fxSource, fySource);
@@ -637,4 +639,6 @@
 
     Int_t fRows = fxStar.GetNrows();
+    if (fRows <= 0)
+      fRows = 1;
     fxStar.ResizeTo(fRows, fSize);
     fyStar.ResizeTo(fRows, fSize);
@@ -665,4 +669,6 @@
     
     Int_t fRows = fxStar.GetNrows();
+    if (fRows <= 0)
+      fRows = 1;
     fxStar.ResizeTo(fRows, fSize);
     fyStar.ResizeTo(fRows, fSize);
@@ -690,10 +696,19 @@
 
 
+  while(1)
+  {
+    *fIn >> ival;
+
+    // run number must be greater than 10000
+    if (fabs(ival) < 10000)
+    {
+      *fLog << err << "===========> Error when reading file with theta and phi <========="
+	    << "             ival = " << ival << endl;
+    }          
+    else
+      break;
+  }  
+
   fRuns += 1;
-
-  *fIn >> ival;
-
-
-  
   //*fLog << fRuns <<"th run : " << ival << endl;  
 
Index: /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h	(revision 3530)
+++ /trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h	(revision 3531)
@@ -55,25 +55,25 @@
 
 
-    Double_t fDecSource;
+    Double_t fDecSource;  // sky coordinates of source
     Double_t fRaSource;
-    Double_t fxSource;
+    Double_t fxSource;    // estimated position of source in camera
     Double_t fySource;
     Double_t fdxSource;
     Double_t fdySource;
 
-    TArrayI fRunNr;
-    TArrayD fThetaTel;
+    TArrayI fRunNr;       // list of run numbers
+    TArrayD fThetaTel;    // for each run : theta, phi, ...
     TArrayD fPhiTel;
     TArrayD fdThetaTel;
     TArrayD fdPhiTel;
 
-    TArrayD  fDecStar;
+    TArrayD  fDecStar;   // sky coordinates of stars
     TArrayD  fRaStar;
-    TMatrixD fxStar;
+    TMatrixD fxStar;     // for each run : positions of stars in camera (from DC currents)
     TMatrixD fyStar;
     TMatrixD fdxStar;
     TMatrixD fdyStar;
 
-    Double_t fxSourceold;
+    Double_t fxSourceold;  
     Double_t fySourceold;
     Double_t fThetaradold;
