- Timestamp:
- 02/08/12 16:37:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/camplotter.py
r12872 r12875 6 6 class camplotter( object ): 7 7 def __init__( self ): 8 chid, y,x, xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)8 chid, y,x,ye,xe,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True) 9 9 self.fig = plt.figure() 10 10 self.xe = xe 11 11 self.ye = ye 12 12 self.H = (6,0,30./180.*3.1415926) 13 13 14 coor2chid = {} 15 chid2coor = [] 16 for i in range ( len(chid) ): 17 coor2chid[ (x[i],y[i]) ] = chid[i] 18 chid2coor.append( (x[i],y[i]) ) 19 20 # print coor2chid 21 # print chid2coor 14 22 15 23 … … 29 37 30 38 cplt = camplotter() 39 31 40 # np.savez ( filename, amplitude=maxAmp, time=maxPos, integral=integ) 32 41 npz = np.load( inputfname ) … … 54 63 ax6.grid(True) 55 64 56 thr = 40. 57 58 print '------------ thr=', thr, '-------------------' 65 thr = 50 66 hithr = 80 67 lothr = 40 68 print '------------ hiTHR=', hithr, 'loTHR=', lothr ,'-------------------' 59 69 print '------------', len(amp[:,0]), '-------------------' 60 70 … … 67 77 my = ma.masked_where(mamp.mask == True, cplt.ye) 68 78 79 core = ma.masked_less(amp[i,:], hithr) 80 edgecand = ma.masked_less(amp[i,:], lothr) 81 #edgecand = ma.masked_where(core.mask == True, edgecand) 82 83 mxc = ma.masked_where(core.mask == True, cplt.xe).compressed() 84 myc = ma.masked_where(core.mask == True, cplt.ye).compressed() 85 mxe = ma.masked_where(edgecand.mask == True, cplt.xe).compressed() 86 mye = ma.masked_where(edgecand.mask == True, cplt.ye).compressed() 87 88 69 89 ax1.cla() 70 90 ax2.cla() 71 91 ax3.cla() 72 92 ax1.scatter(cplt.xe,cplt.ye,s=65,alpha=0.75,marker=cplt.H, c=amp[i,:], edgecolors='none', label='amp') 73 ax1.scatter(mx.compressed() , my.compressed() ,s=65,alpha=0.75,marker=cplt.H, facecolors='none', linewidths=3, edgecolors='r') 93 #ax1.scatter(mx.compressed() , my.compressed() ,s=65,alpha=0.75,marker=cplt.H, facecolors='none', linewidths=3, edgecolors='r') 94 if ( len(mxe) > 0 ): 95 ax1.scatter(mxe , mye ,s=65,alpha=0.75,marker=cplt.H, facecolors='none', linewidths=2, edgecolors='r') 96 if ( len(mxc) > 0 ): 97 ax1.scatter(mxc , myc ,s=65,alpha=0.75,marker=cplt.H, facecolors='none', linewidths=3, edgecolors='k') 74 98 ax1.axis([-22,22,-22,22]) 75 99
Note:
See TracChangeset
for help on using the changeset viewer.