- Timestamp:
- 03/26/12 13:29:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/examples/hillas_test.py
r13177 r13227 4 4 # * looping over RawData class object 5 5 # 6 import matplotlib.pyplot as plt 7 import numpy as np 8 import matplotlib.patches as patches 6 9 7 10 from pyfact import RawData 8 11 from plotters import Plotter 9 12 from plotters import CamPlotter 13 14 10 15 11 16 from drs_spikes import DRSSpikes … … 29 34 hillas = HillasParameter() 30 35 31 p = CamPlotter('cleaned')36 #p = CamPlotter('cleaned') 32 37 #p2 = CamPlotter('not') 33 38 … … 41 46 data = sa(data) 42 47 amp, time = gmf(data) 43 survivors, num_islands = clean(amp) 44 #if num_islands == 1 and len(survivors) < 10: 48 survivors= clean(amp) 49 50 # if nothing survived the cleaning, just go on 51 if len(clean.islands) == 0: 52 continue 53 54 # play with the if statements here, to look at only those events you would like to analyse 55 #if num_islands >= 2 and len(survivors) > 30: 56 #if num_islands == 1 and len(survivors) > 20: 45 57 if True: 46 print 'num_islands', num_islands 58 47 59 print 'calling HillasParameter' 48 hillas(survivors, amp) 60 hillaspar = hillas(survivors, amp) 61 for k in hillaspar.keys(): 62 if k[0] != '_': 63 print k, hillaspar[k] 64 65 #print 66 #print 'delta:', hillaspar['delta']/np.pi * 180 67 #print 'COG:', hillaspar['cog_euc'] 68 #print 'Mxx/size:', hillaspar['Mxx']/hillaspar['size'] 69 #print 'Mxy/size:', hillaspar['Mxy']/hillaspar['size'] 70 #print 'Myy/size:', hillaspar['Myy']/hillaspar['size'] 49 71 50 72 51 p ( amp, survivors ) 73 #p ( amp, survivors ) 74 #plt.figure( p.fig_id ) 75 76 # paint arroy to COG 77 #plt.gca().add_patch( 78 # patches.Polygon( 79 # [ 80 # (hillaspar['source_pos'][0], hillaspar['source_pos'][1]), 81 # (hillaspar['cog_euc'][0], hillaspar['cog_euc'][1]) 82 # ] ) ) 83 # paint copy of x-axis through COG 84 #plt.axhline( hillaspar['cog_euc'][1] ) 85 86 #plt.gca().add_patch( 87 # patches.Ellipse( 88 # ( hillaspar['cog_euc'][0], hillaspar['cog_euc'][1] ), 89 # 2*hillaspar['length'], 90 # 2*hillaspar['width'], 91 # hillaspar['delta'] /np.pi * 180, 92 # facecolor='none' ) ) 93 94 #plt.gca().add_patch( 95 # patches.Circle( 96 # (hillaspar['source_pos'][0], hillaspar['source_pos'][1] ), 97 # 0.5 ) ) 98 99 100 101 52 102 #p2 (amp) 53 103
Note:
See TracChangeset
for help on using the changeset viewer.