source: fact/tools/pyscripts/examples/test_dneise.py@ 12817

Last change on this file since 12817 was 12817, checked in by neise, 13 years ago
added examples folder with some small scripts for mere testing
File size: 1.2 KB
Line 
1#!/usr/bin/python
2#
3# Dominik Neise
4# TU Dortmund
5#
6# test for freshly implemented methods in pyfact.
7# subject to frequent change!
8
9from pyfact import *
10
11dfname = '/data03/fact-construction/raw/2011/11/24/20111124_121.fits'
12calfname = '/data03/fact-construction/raw/2011/11/24/20111124_111.drs.fits'
13# access the data
14rd = rawdata( dfname, calfname )
15
16print 'dfname: ', dfname
17print 'calfname:', calfname
18print 'NEvents: ', rd.NEvents
19
20def loop_acal( Neve = 1000 ):
21 """
22 bla
23 """
24 if rd.NEvents < Neve:
25 print 'data file contains not enough events'
26 exit( 0 )
27 else:
28 for i in range( Neve ):
29 #if np.mod(i,1000):
30 # print 'Event: ', i
31 rd.next()
32
33 rd.filterSlidingAverage()
34 print rd.smoothData
35 rd.filterCFD()
36 print rd.cfdData
37 rd.findPeak()
38 print rd.maxPos
39 print rd.maxAmp
40 rd.sumAroundPeak()
41 print rd.integral
42 #print len(rd.maxPos)
43 #print len(rd.maxAmp)
44 print 'Trigger Type', rd.trigType
45
46print (rd.filterSlidingAverage.__doc__)
47print (rd.filterCFD.__doc__)
48print (rd.findPeak.__doc__)
49print (rd.sumAroundPeak.__doc__)
50
51loop_acal(2)
52
Note: See TracBrowser for help on using the repository browser.