Index: /fact/tools/pyscripts/pyfact/pyfact_rename.py
===================================================================
--- /fact/tools/pyscripts/pyfact/pyfact_rename.py	(revision 12974)
+++ /fact/tools/pyscripts/pyfact/pyfact_rename.py	(revision 12975)
@@ -113,4 +113,17 @@
         self.pulse_amplitude = None
 
+    def __iter__(self):
+        """ iterator """
+        return self
+        
+    def next(self):
+        """ used by __iter__ """
+        if self.event_id.value == self.nevents:
+            raise StopIteration
+        else:
+            self.data_file.GetNextRow()
+            self.calibrate_drs_amplitude()
+        return self.acal_data, self.start_cells, self.trigger_type.value
+
     def next_event(self):
         """ load the next event from disk and calibrate it
@@ -361,18 +374,17 @@
 # end of class definition: fnames( object )
 
+def _test_iter():
+    """ test for function __iter__ """
+
+    data_file_name = '/data00/fact-construction/raw/2011/11/24/20111124_111.fits.gz'
+    calib_file_name = '/data00/fact-construction/raw/2011/11/24/20111124_111.drs.fits.gz'
+    run = RawData( data_file_name, calib_file_name )
+
+    for data, scell, tt in run:
+        print 'data[0,0] = ', data[0,0], "start_cell[0] =", scell[0], "trigger type = ", tt
+
+
 if __name__ == '__main__':
-    """
-    create an instance
-    """
-    data_file_name = '/data03/fact-construction/raw/2011/11/24/20111124_121.fits'
-    calib_file_name = '/data03/fact-construction/raw/2011/11/24/20111124_111.drs.fits'
-    rd = rawdata( data_file_name, calib_file_name )
-    rd.info()
-    rd.next()
-    
-# for i in range(10):
-#    df.GetNextRow() 
-
-#    print 'evNum: ', evNum.value
-#    print 'start_cells[0:9]: ', start_cells[0:9]
-#    print 'evData[0:9]: ', evData[0:9]
+    """ tests  """
+
+    _test_iter()
