Index: /fact/tools/pyscripts/pyfact/pyfact.py
===================================================================
--- /fact/tools/pyscripts/pyfact/pyfact.py	(revision 13440)
+++ /fact/tools/pyscripts/pyfact/pyfact.py	(revision 13441)
@@ -297,4 +297,87 @@
         
 # -----------------------------------------------------------------------------
+class RawDataFake( object ):
+    """ raw data FAKE access similar to real RawData access
+    """
+
+
+    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=''):
+        self.__module__='pyfact'
+
+        self.nroi    = 300
+        self.npix    = 9
+        self.nevents = 1000
+        
+        self.simulator = None
+        
+        self.time = np.ones(1024) * 0.5
+        
+        
+        self.event_id = c_ulong(0)
+        self.trigger_type = c_ushort(4)
+        self.data  = np.zeros( self.npix * self.nroi, np.int16 ).reshape(self.npix ,self.nroi)
+        self.start_cells = np.zeros( self.npix, np.int16 )
+        self.board_times = np.zeros( 40, np.int32 )
+    def __iter__(self):
+        """ iterator """
+        return self
+        
+    def next(self):
+        """ used by __iter__ """
+        self.event_id = c_ulong(self.event_id.value + 1)
+        self.board_times = self.board_times + 42
+        
+        if self.event_id.value >= self.nevents:
+            raise StopIteration
+        else:
+            self._make_event_data()
+        
+        return self.__dict__
+
+    def _make_event_data(self):
+        sample_times = self.time.cumsum() - time[0]
+        
+        # random start cell
+        self.start_cells = np.ones( self.npix, np.int16 ) * np.random.randint(0,1024)
+        
+        starttime = self.start_cells[0]
+        
+        signal = self._std_sinus_simu(sample_times, starttime)
+        
+        data = np.vstack( (signal,signal) )
+        for i in range(8):
+            data = np.vstack( (data,signal) )
+        
+        self.data = data
+    
+    def _std_sinus_simu(self, times, starttime):
+        period = 10 # in ns
+        
+        # give a jitter on starttime
+        starttime = np.random.normal(startime, 0.05)
+        
+        phase = 0.0
+        signal = 10 * np.sin(times * 2*np.pi/period + starttime + phase)
+        
+        # add some noise
+        noise = np.random.normal(0.0, 0.5, signal.shape)
+        signal += noise
+        return signal
+
+    def info(self):
+        """ print run information
+        
+        """
+        
+        print 'data file:  ', data_file_name
+        print 'calib file: ', calib_file_name
+        print 'calibration file'
+        print 'N baseline_mean: ', self.Nblm
+        print 'N gain mean: ', self.Ngm
+        print 'N TriggeroffsetMean: ', self.Ntom
+        
+# -----------------------------------------------------------------------------
 class fnames( object ):
     """ organize file names of a FACT data run
