Index: /fact/tools/pyscripts/examples/hillas_test.py
===================================================================
--- /fact/tools/pyscripts/examples/hillas_test.py	(revision 13226)
+++ /fact/tools/pyscripts/examples/hillas_test.py	(revision 13227)
@@ -4,8 +4,13 @@
 #    * looping over RawData class object
 # 
+import matplotlib.pyplot as plt
+import numpy as np
+import matplotlib.patches as patches
 
 from pyfact   import RawData
 from plotters import Plotter
 from plotters import CamPlotter
+
+
 
 from drs_spikes import DRSSpikes
@@ -29,5 +34,5 @@
 hillas = HillasParameter()
 
-p = CamPlotter('cleaned')
+#p = CamPlotter('cleaned')
 #p2 = CamPlotter('not')
 
@@ -41,13 +46,58 @@
         data = sa(data)
         amp, time = gmf(data)
-        survivors, num_islands = clean(amp)
-        #if num_islands == 1 and len(survivors) < 10:
+        survivors= clean(amp)
+        
+        # if nothing survived the cleaning, just go on
+        if len(clean.islands) == 0:
+            continue
+        
+        # play with the if statements here, to look at only those events you would like to analyse
+        #if num_islands >= 2 and len(survivors) > 30:
+        #if num_islands == 1 and len(survivors) > 20:
         if True:
-            print 'num_islands', num_islands
+
             print 'calling HillasParameter'
-            hillas(survivors, amp)
+            hillaspar = hillas(survivors, amp)
+            for k in hillaspar.keys():
+                if k[0] != '_':
+                    print k, hillaspar[k]
+                    
+            #print
+            #print 'delta:', hillaspar['delta']/np.pi * 180
+            #print 'COG:', hillaspar['cog_euc']
+            #print 'Mxx/size:', hillaspar['Mxx']/hillaspar['size']
+            #print 'Mxy/size:', hillaspar['Mxy']/hillaspar['size']
+            #print 'Myy/size:', hillaspar['Myy']/hillaspar['size']
             
             
-            p ( amp, survivors )
+            #p ( amp, survivors )
+            #plt.figure( p.fig_id )
+            
+            # paint arroy to COG
+            #plt.gca().add_patch( 
+            #    patches.Polygon( 
+            #    [   
+            #        (hillaspar['source_pos'][0], hillaspar['source_pos'][1]), 
+            #        (hillaspar['cog_euc'][0], hillaspar['cog_euc'][1]) 
+            #    ] ) )
+            # paint copy of x-axis through COG
+            #plt.axhline( hillaspar['cog_euc'][1] )
+            
+            #plt.gca().add_patch( 
+            #    patches.Ellipse(
+            #        ( hillaspar['cog_euc'][0], hillaspar['cog_euc'][1] ),
+            #        2*hillaspar['length'],
+            #        2*hillaspar['width'],
+            #        hillaspar['delta'] /np.pi * 180, 
+            #        facecolor='none' ) )
+                    
+            #plt.gca().add_patch( 
+            #    patches.Circle( 
+            #        (hillaspar['source_pos'][0], hillaspar['source_pos'][1] ), 
+            #        0.5 ) )
+            
+            
+            
+            
             #p2 (amp)
             
