Changeset 12875


Ignore:
Timestamp:
02/08/12 16:37:28 (13 years ago)
Author:
neise
Message:
adjusted camera coordinates to Etiennes style
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/camplotter.py

    r12872 r12875  
    66class camplotter( object ):
    77    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)
    99        self.fig = plt.figure()
    1010        self.xe = xe
    1111        self.ye = ye
    1212        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
    1422
    1523
     
    2937       
    3038    cplt = camplotter()
     39   
    3140    # np.savez ( filename, amplitude=maxAmp, time=maxPos, integral=integ)
    3241    npz = np.load( inputfname )
     
    5463    ax6.grid(True)
    5564   
    56     thr = 40.
    57    
    58     print '------------ thr=', thr, '-------------------'
     65    thr = 50
     66    hithr = 80
     67    lothr = 40
     68    print '------------ hiTHR=', hithr, 'loTHR=', lothr ,'-------------------'
    5969    print '------------', len(amp[:,0]), '-------------------'
    6070
     
    6777        my = ma.masked_where(mamp.mask == True, cplt.ye)
    6878       
     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       
    6989        ax1.cla()
    7090        ax2.cla()
    7191        ax3.cla()
    7292        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')
    7498        ax1.axis([-22,22,-22,22])
    7599       
Note: See TracChangeset for help on using the changeset viewer.