source: fact/tools/pyscripts/examples/CalFactFitsTest.py@ 14098

Last change on this file since 14098 was 13515, checked in by kraehenb, 13 years ago
Renamed test scripts and Class calls within to new naming standard.
File size: 1.8 KB
Line 
1#!/usr/bin/python -tt
2# ********************************
3# Test script for the CalFactFits class
4#
5# written by Thomas Kraehenbuehl, ETH Zurich
6# tpk@phys.ethz.ch, +41 44 633 3973
7# April 2012
8# ********************************
9
10datafilename = '/fact/raw/2012/04/17/20120417_004.fits.gz'
11calibfilename = '/fact/raw/2012/04/17/20120417_003.drs.fits.gz'
12
13import numpy as np
14
15from ROOT import gSystem
16gSystem.Load("calfactfits_h.so")
17from ROOT import *
18print "Testing object creation: "
19caltest = CalFactFits(datafilename,calibfilename)
20npcalevent = np.empty( caltest.npix * caltest.nroi, np.float64) #.reshape(caltest.npix ,caltest.nroi)
21caltest.SetNpcaldataPtr(npcalevent)
22
23print "Common variables:"
24print "ROI: ", caltest.nroi
25print "#Pix: ", caltest.npix
26print "Number of events: ", caltest.nevents
27print
28
29print "Information per Event:"
30caltest.GetCalEvent()
31print "Calibrated data in numpy array: ", npcalevent
32print "Event ID: ", caltest.event_id
33print "Trigger type: ", caltest.event_triggertype
34print "Uncalibrated data: ", caltest.event_data
35print "Calibrated data: ", caltest.npcaldata
36print "Board times: ", caltest.event_boardtimes
37print "Trigger offsets: ", caltest.event_offset
38print
39
40print "Examples of other information"
41print "Calibfile ROI: ", caltest.calib_nroi
42print "Column size BaselineMean: ", caltest.calibfile.GetN("BaselineMean")
43print "Datafile ROI: ", caltest.data_nroi
44print "Data: ", caltest.datafile.GetN("Data")
45print "StartCellData: ", caltest.datafile.GetN("StartCellData")
46print "Direct datafile access: ", caltest.datafile.GetN("StartCellData")
47print
48print "Columns of the datafile: "
49caltest.datafile.PrintColumns()
50
51#while caltest.GetCalEvent():
52# if caltest.event_id>10:
53# break
54# print caltest.event_id, caltest.event_triggertype, caltest.event_caldata[10]
55# pass
56#print
57
58del caltest
Note: See TracBrowser for help on using the repository browser.