source: fact/tools/pyscripts/sandbox/dneise/RateControl/plot_PatchThr_vs_Time.py@ 16858

Last change on this file since 16858 was 14426, checked in by neise, 12 years ago
initial commit
  • Property svn:executable set to *
File size: 1013 bytes
Line 
1#!/usr/bin/python -tti
2import sys
3from pyfact import SlowData
4from pylab import *
5
6from datetime import date
7d0 = date(1970,01,01)
8d1 = date(2001,01,01)
9delta = d1-d0
10days_offset = delta.days
11del d0,d1,delta
12
13plt.ion()
14
15if len(sys.argv) < 3:
16 ftm_static = '20120924.FTM_CONTROL_STATIC_DATA.fits'
17 ftm_rates = '20120924.FTM_CONTROL_TRIGGER_RATES.fits'
18
19else:
20 ftm_static = sys.argv[1]
21 ftm_rates = sys.argv[2]
22
23f1 = SlowData(ftm_static)
24f2 = SlowData(ftm_rates)
25
26f1.register('all')
27f2.register('all')
28f1.stack()
29f2.stack()
30print "reading", ftm_static
31for i in f1:
32 pass
33print "reading", ftm_rates
34for i in f2:
35 pass
36
37
38c = f1.stacked_cols
39t = c['Time']-days_offset
40
41thr = c['PatchThresh']
42
43thrm = thr.mean(axis=1)
44
45scale = 50.
46plt.plot_date( t, thrm/scale, '.:', label='Patch THR mean ('+str(scale)+'DAC counts)')
47
48t2 = f2.stacked_cols['Time']-days_offset
49log_rates = np.log10(f2.stacked_cols['TriggerRate'])
50
51plt.plot_date( t2, log_rates, '+', label = 'log(Rate/Hz)')
52plt.legend()
Note: See TracBrowser for help on using the repository browser.