Last change
on this file since 14268 was 14207, checked in by neise, 12 years ago |
works
|
-
Property svn:executable
set to
*
|
File size:
953 bytes
|
Line | |
---|
1 | #!/usr/bin/python -tti
|
---|
2 | #
|
---|
3 | #
|
---|
4 |
|
---|
5 | from pyfact import RawData
|
---|
6 | import sys
|
---|
7 | from ROOT import TFile, TCanvas, TH2F, TTree, TStyle, TObject
|
---|
8 | import numpy as np
|
---|
9 |
|
---|
10 | data_filename = '/fact/raw/2012/06/06/20120606_116.fits.gz'
|
---|
11 | calib_filename = '/fact/raw/2012/06/06/20120606_112.drs.fits.gz'
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 | run = RawData(data_filename, calib_filename, use_CalFactFits = False, do_calibration = False)
|
---|
16 | offset = run.blm / (2000./4096.)
|
---|
17 | offset = offset.astype(int)
|
---|
18 | roi = run.nroi
|
---|
19 | npix = run.npix
|
---|
20 |
|
---|
21 | rootfile = TFile('test.root', "RECREATE")
|
---|
22 | h = TH2F('h', 'diffs', npix, -0.5, npix-0.5, 2401, -1200.5, 1200.5)
|
---|
23 |
|
---|
24 | for event in run:
|
---|
25 | index = event['event_id'].value
|
---|
26 | print index, '/', run.nevents
|
---|
27 | data = event['data']
|
---|
28 |
|
---|
29 | cal_data = data.copy()
|
---|
30 |
|
---|
31 | for pixel in range(npix):
|
---|
32 | sc = event['start_cells'][pixel]
|
---|
33 | cal_data[pixel,:] -= offset[pixel,sc:sc+roi]
|
---|
34 | for d in np.diff(cal_data[pixel,:]):
|
---|
35 | h.Fill(pixel, d)
|
---|
36 |
|
---|
37 | h.Write()
|
---|
38 | rootfile.Close()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.