Index: /fact/tools/pyscripts/pyfact/pyfact.py
===================================================================
--- /fact/tools/pyscripts/pyfact/pyfact.py	(revision 13155)
+++ /fact/tools/pyscripts/pyfact/pyfact.py	(revision 13156)
@@ -29,7 +29,8 @@
     def __init__(self, data_file_name, calib_file_name, 
                 user_action_calib=lambda acal_data, data, blm, tom, gm, scells, nroi: None,
-                baseline_file_name=''):
+                baseline_file_name='',
+                return_dict = None):
         """ initialize object
-
+        
         open data file and calibration data file
         get basic information about the data in data_file_name
@@ -39,7 +40,20 @@
         calib_file_name : fits or fits.gz file containing DRS calibration data
         baseline_file_name : npy file containing the baseline values
-        
-        """
-
+        """
+        # manual implementation of default value, but I need to find out
+        # if the user of this class is aware of the new option
+        if return_dict == None:
+            print 'Warning: Rawdata.__init__() has a new option "return_dict"'
+            print 'the default value of this option is False, so nothing changes for you at the moment.'
+            print
+            print 'you probably want, to get a dictionary out of the next() method anyway'
+            print ' so please change your scripts and set this option to True, for the moment'
+            print 'e.g. like this: run = RawData(data_filename, calib_filename, return_dict = True)'
+            print "after a while, the default value, will turn to True .. so you don't have to give the option anymore"
+            print 'and some time later, the option will not be supported anymore'
+            return_dict = False
+
+        self.return_dict = return_dict
+        
         self.data_file_name = data_file_name
         self.calib_file_name = calib_file_name
@@ -115,7 +129,4 @@
 
         self.v_bsl = np.zeros(self.npix)  # array of baseline values (all ZERO)
-        self.data_saverage_out = None
-        self.pulse_time_of_maximum = None
-        self.pulse_amplitude = None
 
     def __iter__(self):
@@ -136,6 +147,8 @@
 
         #print 'nevents = ', self.nevents, 'event_id = ', self.event_id.value
-
-        return self.acal_data, self.start_cells, self.trigger_type.value
+        if self.return_dict:
+            return self.__dict__
+        else:
+            return self.acal_data, self.start_cells, self.trigger_type.value
 
     def next_event(self):
@@ -165,6 +178,12 @@
             # rotate the pixel baseline mean to the Data startCell
             blm_pixel = np.roll( blm[pixel,:], -self.start_cells[pixel] )
-            tom_pixel =  tom[pixel,:]
+            # rotate the pixel gain mean to the Data startCell
             gm_pixel = np.roll( gm[pixel,:], -self.start_cells[pixel] )
+            # the 'trigger offset mean' does not need to be rolled
+            # on the contrary, it seems there is an offset in the DRS data,
+            # which is related to its distance to the startCell, not to its 
+            # distance to the beginning of the physical pipeline in the DRS chip
+            tom_pixel = tom[pixel,:]
+            
             acal_data[pixel,:] -= blm_pixel[0:self.nroi]
             acal_data[pixel,:] -= tom_pixel[0:self.nroi]
