Markus Feldmann 2009-05-26 extraktpeaks3
von Anonymous- SNIPPET_TEXT:
-
- def extrahierePeaks(self,starttime,endtime,timescale,nitems):
- f_output = open('../../../peakswerteundzeit.dat','wb')
- f_p_1 = open('../../../peakdetektor1.hex','rb')
- f_p_2 = open('../../../peakdetektor2.hex','rb')
- f_p_3 = open('../../../peakdetektor3.hex','rb')
- f_pv_1 = open('../../../peakband1.hex','rb')
- f_pv_2 = open('../../../peakband2.hex','rb')
- f_pv_3 = open('../../../peakband3.hex','rb')
- a_p_1 = numpy.fromfile(f_p_1,dtype='b')
- a_p_2 = numpy.fromfile(f_p_2,dtype='b')
- a_p_3 = numpy.fromfile(f_p_3,dtype='b')
- a_pv_1 = numpy.fromfile(f_pv_1,dtype=numpy.complex64)
- a_pv_2 = numpy.fromfile(f_pv_2,dtype=numpy.complex64)
- a_pv_3 = numpy.fromfile(f_pv_3,dtype=numpy.complex64)
- criterion = (a_p_1==1) | (a_p_2==1) | (a_p_3==1)
- i = 0
- a_time = []
- # print a_p_1[0:4]
- # print a_p_2[0:4]
- # print a_p_3[0:4]
- # print a_pv_1[0:4]
- # print a_pv_2[0:4]
- # print a_pv_3[0:4]
- #print "Timescale*1e6 ist ",timescale*10000
- while i <= nitems-1:
- if (a_p_1[i] or a_p_2[i] or a_p_3[i]):
- a_time += [timescale*i*10000]
- i += 1
- # print a_time[0:4]
- cPickle.dump((a_time[criterion],
- a_p_1[criterion],
- a_p_2[criterion],
- a_p_3[criterion],
- a_pv_1[criterion],
- a_pv_2[criterion],
- a_pv_3[criterion]),f_output)
- f_output.close()
Quellcode
Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN