Index: /fact/tools/pyscripts/new_pyfact/pyfact.py
===================================================================
--- /fact/tools/pyscripts/new_pyfact/pyfact.py	(revision 17974)
+++ /fact/tools/pyscripts/new_pyfact/pyfact.py	(revision 17975)
@@ -82,4 +82,10 @@
         self._setup_columns()
 
+    def __len__(self):
+        """ return the number of events, in case it's a FACT physics data file
+        or simply the number of rows in case it's a slow data (so called aux) file.
+        """
+        return self.f.GetNumRows()
+
     def _make_header(self):
         """
@@ -136,5 +142,6 @@
         self._cols = {}
         self.cols = {}
-        N = self.header['NAXIS2']
+        
+        N = len(self)
         for key,col in self.f.GetColumns():
             self._cols[key] = np.zeros(col.num, col_type_to_np_type_map[col.type])
@@ -151,5 +158,5 @@
                     step = 10
                 if i % step == 0:
-                    print "reading line", i
+                    print "reading line", i, 'of', self.header['NAXIS2']
 
             for key in self._cols:
@@ -226,5 +233,5 @@
     f = RawData(sys.argv[1], sys.argv[2])
 
-    print "number of events:", f.header['NAXIS2']
+    print "number of events:", len(f)
     print "date of observation:", f.header['DATE']
     print "The files has these cols:", f.cols.keys()
