#!/usr/bin/python # # Dominik Neise # TU Dortmund # # test for freshly implemented methods in pyfact. # subject to frequent change! from pyfact import * #from savecam import * dfname = '/data00/fact-construction/raw/2011/11/24/20111124_081.fits.gz' outfname = '20111124_081.npz' calfname = '/data00/fact-construction/raw/2011/11/24/20111124_071.drs.fits.gz' # access the data rd = rawdata( dfname, calfname ) print 'dfname: ', dfname print 'calfname:', calfname print 'NEvents: ', rd.NEvents def loop_acal( Neve = 1000 ): """ bla """ if rd.NEvents < Neve: print 'data file contains not enough events' exit( 0 ) else: for i in range( Neve ): if (np.mod(i,100)==0) : print 'Event: ', i rd.next() rd.filterSlidingAverage() # print rd.smoothData rd.filterCFD() # print rd.cfdData rd.findPeak() list_maxPos.append(rd.maxPos) list_maxAmp.append(rd.maxAmp) rd.sumAroundPeak() list_integral.append(rd.integral) # plotincam(rd.integral, 'evt_'+str(i)+'.pdf') #print len(rd.maxPos) #print len(rd.maxAmp) # print 'Trigger Type', rd.trigType #print (rd.filterSlidingAverage.__doc__) #print (rd.filterCFD.__doc__) #print (rd.findPeak.__doc__) #print (rd.sumAroundPeak.__doc__) list_maxPos = [] list_maxAmp = [] list_integral = [] loop_acal(rd.NEvents) maxAmp = np.vstack(list_maxAmp) maxPos = np.vstack(list_maxPos) integ = np.vstack(list_integral) np.savez(outfname, amplitude=maxAmp, time=maxPos, integral=integ)