Last change
on this file since 12898 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 |
|
---|
9 | from pyfact import *
|
---|
10 |
|
---|
11 | dfname = '/data03/fact-construction/raw/2011/11/24/20111124_121.fits'
|
---|
12 | calfname = '/data03/fact-construction/raw/2011/11/24/20111124_111.drs.fits'
|
---|
13 | # access the data
|
---|
14 | rd = rawdata( dfname, calfname )
|
---|
15 |
|
---|
16 | print 'dfname: ', dfname
|
---|
17 | print 'calfname:', calfname
|
---|
18 | print 'NEvents: ', rd.NEvents
|
---|
19 |
|
---|
20 | def 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 |
|
---|
46 | print (rd.filterSlidingAverage.__doc__)
|
---|
47 | print (rd.filterCFD.__doc__)
|
---|
48 | print (rd.findPeak.__doc__)
|
---|
49 | print (rd.sumAroundPeak.__doc__)
|
---|
50 |
|
---|
51 | loop_acal(2)
|
---|
52 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.