source: fact/tools/pyscripts/sandbox/dneise/fact_compress/diff_wo_offset_sub.py@ 14215

Last change on this file since 14215 was 14215, checked in by neise, 12 years ago
more
  • Property svn:executable set to *
File size: 785 bytes
Line 
1#!/usr/bin/python -tti
2#
3#
4
5from pyfact import RawData
6import sys
7from ROOT import TFile, TCanvas, TH2F, TTree, TStyle, TObject
8import numpy as np
9
10data_filename = '/fact/raw/2012/06/06/20120606_116.fits.gz'
11calib_filename = '/fact/raw/2012/06/06/20120606_112.drs.fits.gz'
12
13run = RawData(data_filename, calib_filename, use_CalFactFits = False, do_calibration = False)
14npix = run.npix
15
16rootfile = TFile('20120606_116_diff_wo_offset_sub.root', "RECREATE")
17h = TH2F('h', 'diffs', npix, -0.5, npix-0.5, 4801, -2400.5, 2400.5)
18
19for event in run:
20 index = event['event_id'].value
21 print index, '/', run.nevents
22 cal_data = event['data']
23
24
25 for pixel in range(npix):
26 for d in np.diff(cal_data[pixel,:]):
27 h.Fill(pixel, d)
28
29h.Write()
30rootfile.Close()
Note: See TracBrowser for help on using the repository browser.