source: fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py@ 13440

Last change on this file since 13440 was 13435, checked in by kraehenb, 13 years ago
Changed CalFitsTest.py to work with the current version of caltest.h.
File size: 1.7 KB
Line 
1#!/usr/bin/python -tt
2# ********************************
3# Test script for the CalFits 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("calfits_h.so")
17from ROOT import *
18print "Testing object creation: "
19caltest = CalFits(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 "Event ID: ", caltest.event_id
32print "Trigger type: ", caltest.event_triggertype
33print "Uncalibrated data: ", caltest.event_data
34print "Calibrated data: ", caltest.npcaldata
35print "Board times: ", caltest.event_boardtimes
36print "Trigger offsets: ", caltest.event_offset
37print
38
39print "Examples of other information"
40print "Calibfile ROI: ", caltest.calib_nroi
41print "Column size BaselineMean: ", caltest.calibfile.GetN("BaselineMean")
42print "Datafile ROI: ", caltest.data_nroi
43print "Data: ", caltest.datafile.GetN("Data")
44print "StartCellData: ", caltest.datafile.GetN("StartCellData")
45print "Direct datafile access: ", caltest.datafile.GetN("StartCellData")
46print
47print "Columns of the datafile: "
48caltest.datafile.PrintColumns()
49
50#while caltest.GetCalEvent():
51# if caltest.event_id>10:
52# break
53# print caltest.event_id, caltest.event_triggertype, caltest.event_caldata[10]
54# pass
55#print
56
57del caltest
Note: See TracBrowser for help on using the repository browser.