Debian Codegraph @

commissioning/makehist.py

raw symbols SCIP
1 import numpy as N
2 from pylab import *
3 import pylab
4 import pickle
5
6
7 #Load the data extracted from the database
8 f=open('countrate_discrep.pickle')
9 d2=pickle.load(f)
10
11 #oops, we sucked in some testefflam cases
12 d = dict()
13 for k in d2:
14 if 'testcountrate' in k:
15 d[k] = d2[k]
16
17 f.close()
18 f=open('countrate_discrep.pickle','w')
19 pickle.dump(d,f)
20 f.close()
21
22
23 #Break it up by instrument
24 acs=N.array([d[k] for k in d if 'acs' in k])
25 acsid = N.array([k for k in d if 'acs' in k])
26 nicmos=N.array([d[k] for k in d if 'nicmos' in k])
27 stis=N.array([d[k] for k in d if 'stis' in k])
28 wfc3=N.array([d[k] for k in d if 'wfc3' in k])
29 ilist=['acs','nicmos','stis','wfc3']
30
31
32 #Make the histograms, with a bin width of half a percent
33 clf()
34 bar_width=.001
35 for i,x in enumerate((acs,nicmos,stis,wfc3)):
36 subplot(221+i)
37 bins = N.arange(min(x),max(x)+bar_width,bar_width)
38 a,b,c = pylab.hist(x, bins)
39 xlim(-0.15,0.15)
40 ylim(0,40)
41 ylabel('clipped at 40')
42 legend([ilist[i]])
43 xlabel('(min,max) = %g, %g'%(x.min(),x.max()))
44 if i == 0:
45 title('countrate: (syn-pysyn)/syn')
46
47 savefig('countrate.png')
48
49 #Zoom in both x and y
50 for i in range(4):
51 subplot(221+i)
52 xlim(-0.03,0.03)
53 ylim(0,40)
54 ylabel('clipped at 40')
55 grid()
56
57 savefig('countrate_zoomed.png')