Index: /fact/tools/pyscripts/pyfact/extractor.py
===================================================================
--- /fact/tools/pyscripts/pyfact/extractor.py	(revision 13131)
+++ /fact/tools/pyscripts/pyfact/extractor.py	(revision 13132)
@@ -130,36 +130,6 @@
 
 
-def plotter(signal, text):
-    x=range(len(signal))
-    ax = plt.plot(x, signal, 'b.', label='signal')
-    plt.title(text)
-    plt.xlabel('sample')
-    plt.legend()
-    plt.grid(True)
-    plt.show()
-    
-def histplotter(signal, text):
-    plt.xlabel('time of zero crossing')
-    plt.title(text)
-    plt.axis([0, 300,0,1440])
-    plt.grid(True)
-    n, bins, patches = plt.hist(signal, 3000, facecolor='r', alpha=0.75)
-    plt.show()
 
-
-if __name__ == '__main__':
-    """ test the extractors """
-    sg = SignalGenerator()
-    pulse_str = 'len 300 bsl -0.5 noise 0.5 triangle 65 10 8 100' 
-    pulse = sg(pulse_str)
-    event = []
-    for i in range(1440):
-        event.append(sg(pulse_str))
-    event = np.array(event)
-    print 'test event with 1000 pixel generated, like this:'
-    print pulse_str
-    print
-    
-    # Test GlobalMaxFinder
+def _test_GlobalMaxFinder():
     gmf = GlobalMaxFinder(30,250)
     print gmf
@@ -171,8 +141,6 @@
     else:
         print "BAD: time mean:", time.mean()
-    
-    print 
-    
-    # Test FixedWindowIntegrator
+
+def _test_FixedWindowIntegrator():
     fwi = FixedWindowIntegrator(50,200)
     print fwi
@@ -183,6 +151,6 @@
     else:
         print "Test 2:  X FixedWindowIntegrator integral.mean failed:", integral.mean()
-    
-    print
+
+def _test_ZeroXing():
     cfd = CFD()
     sa = SlidingAverage(8)
@@ -203,9 +171,29 @@
     print 'most probable time of zero-crossing', most_probable_time/10.
     print 'this includes filter delays ... for average filter setting 8 this turns out to be 78.8 most of the time'
+
+if __name__ == '__main__':
+    """ test the extractors """
     
-    #histplotter(times.flatten(), 'times.flatten()')
-    #plotter(cfd_out[0], 'cfd_out')
-    #plotter (pulse, pulse_str)
+    # Generate a fake event, with a triangular pulse at slice 65
+    sg = SignalGenerator()
+    pulse_str = 'len 300 bsl -0.5 noise 0.5 triangle 65 10 8 100' 
+    pulse = sg(pulse_str)
+    event = []
+    for i in range(1440):
+        event.append(sg(pulse_str))
+    event = np.array(event)
+    print 'test event with 1000 pixel generated, like this:'
+    print pulse_str
+    print
     
-
-
+    print '_test_GlobalMaxFinder()'
+    _test_GlobalMaxFinder()
+    print 
+    print
+    print '_test_FixedWindowIntegrator()'
+    _test_FixedWindowIntegrator()
+    print
+    print
+    print '_test_ZeroXing()'
+    _test_ZeroXing()
+    print
