コード例 #1
0
ファイル: checkpop3.py プロジェクト: rgaior/WIMPanalysis
            ind = str(constant.runid[r].index(runid) + 1 + 9)
        else:
            ind = str(constant.runid[r].index(runid) + 1 )
        print 'runid = ' , runid
        print 'ind = ' , ind
        imfile = constant.usedfolder[r] + 'sim'+ filesec + '_0-1_' + str(ind.zfill(3)) + '_' + str(int(extid))  + '.root'

        f = R.TFile(imfile)
        im = f.Get("image")
        fig.suptitle('cluster on RUNID: '+ str(runid) + ' ext: '+ str(extid))
        delta_x = 15
        delta_y = 4
        centralbin_x = int(row['centerx'])
        centralbin_y = int(row['centery'])
#        print 'centralbin_x = ',centralbin_x,'centralbin_y = ',centralbin_y
        image = utils.getimagepart(im,centralbin_x,centralbin_y,delta_x,delta_y)
#        print ' ' , np.min(image[0]), ' ' , np.max(image[0]), ' ' , np.min(image[1]), ' ', np.max(image[1])        
        plt.imshow(image[2],origin='lower',extent=[np.min(image[0]),np.max(image[0])+1,np.min(image[1]),np.max(image[1])+1],aspect='auto')
        plt.xlabel("X [pixel]")
        plt.ylabel("Y [pixel]")
        plt.colorbar()
        fig.savefig(plotfolder + 'pop3_ev_r_'+r+'_run_'+str(runid) + '_ext_'+str(extid) + '_'+str(count)+ '.png')
plt.show()
        
# ### nr of fake vs extension:
#     a_nroffake = np.array([])
#     a_ext = np.array([])
#     for ext in constant.extensionlist:
#         dftemp= df[df.EXTID==ext]
#         dforitemp = dfori[dfori.EXTID==ext]
#         a_nroffake = np.append(a_nroffake, float(dftemp.shape[0])/dforitemp.shape[0])
コード例 #2
0
ファイル: drawseveral.py プロジェクト: rgaior/WIMPanalysis
    filesec = '100' if ('100000' in constant.usedfolder[runname]) else '30'
    filename = 'sim'+ filesec + '_0-1_' + str(ind.zfill(3)) + '_' + str(int(extid))  + '.root'
    folder = constant.usedfolder[runname] 
    file = folder + filename
    runpathname = folder[folder.find('damic1x100')+len('damic1x100')+1:folder.find('/cluster_sim')]
    fileelec = '/Users/gaior/DAMIC/data/processed/processed/'+runpathname + '/roots/'  + filename

    f = R.TFile(file)
    im = f.Get("image")
#    centralbin_x = int(row.centerx)
    centralbin_x = int(row.meanx)
    centralbin_y = int(row.centery)
    starx = row.meanx
    stary = row.centery

    image = utils.getimagepart(im,centralbin_x,centralbin_y,delta_x,delta_y)
#print image[2]
    if nelec == False and sigma == False:
        print 'here nelec = false'
        f, axarr = plt.subplots()
        f.suptitle('cluster on RUNID: '+ str(runid) + ' ext: '+ str(extid),fontsize=20)
        plt.imshow(image[2],origin='lower',extent=[np.min(image[0]),np.max(image[0])+1,np.min(image[1]),np.max(image[1])+1],aspect='auto')
#        plt.plot(np.array([row.centerx]),np.array([row.centery]),'*r',markersize=10)
        plt.plot(np.array([starx]),np.array([stary]),'*r',markersize=10)
#        plt.plot(np.array([centralbin_x]),np.array([centralbin_y]),'*r',markersize=10)
        axarr.set_xlabel('X [pixel]')
        axarr.set_ylabel('Y [pixel]')
        plt.colorbar()
    elif nelec ==True and sigma == False:    
        print ' here nelec = trye  sigma  = false'
        felec = R.TFile(fileelec)