~vpec/maus/tof_calib_read

« back to all changes in this revision

Viewing changes to macros/cis/.svn/text-base/update_channel_status.py.svn-base

  • Committer: tunnell
  • Date: 2010-09-20 10:52:02 UTC
  • Revision ID: tunnell@itchy-20100920105202-ce4w9jm59zvgnsxq
moving stuff from tucs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Author: Christopher Tunnell <tunnell@hep.uchicago.edu>
 
2
#
 
3
# This is a script intended to provide summary status information about the
 
4
# CIS system in the form of a channel status bit.  This does NOT update the
 
5
# database directly.  Instead, it creates a local SQLite file.
 
6
#
 
7
# March 04, 2009
 
8
#
 
9
 
 
10
execfile('src/load.py', globals()) # don't remove this!
 
11
 
 
12
 
 
13
"""
 
14
Step 1:
 
15
You need to set the 'runs' variable to reflect which runs you would like to look at.  There are various examples below: the set of runs used for the Feb. 2009 TileWeek, the set of runs of Feb. 27th 2009, and the last example uses the last month of CIS runs.
 
16
"""
 
17
#runs = [72652, 73305, 72653, 72661, 79259, 78023, 79781, 78026]
 
18
runs = '-28 day'
 
19
#runs= [104467,104675,104835,104934,105130,107141,108481,108566,108666,110934,111291,112497,112922,113131,113236,113248,113284,113469] #Wed Apr 29 16:28:49 CEST 2009
 
20
 
 
21
#runs =[102893,103322, 103347,103864,104019,104051,104131,104274,104467,104675,104835,104934,105130,107141,108481,108566,108666] # Wed Apr 15 16:28:52 CEST 2009
 
22
 
 
23
#runs=[102208, 102217,102501,102893,103322,103347,103864,104019,104051,104131,104274,104467,104675,] # april 1 09  
 
24
 
 
25
#runs=108666
 
26
#
 
27
"""
 
28
Step 2:
 
29
Do you want to look at the CIS scans for the last month?  If you set 'scans' equal to true, then you will have plots of the CIS scans for all channels that failed to be calibrated. However, be mindful that this will load in CIS scans for each channel for each run.  This can be slow (~30 minutes).
 
30
"""
 
31
showAll=False
 
32
useScans = False  #  Read in the CIS scan graphs in order to plot them?
 
33
 
 
34
#
 
35
#  Experts only below.
 
36
#
 
37
 
 
38
if useScans:
 
39
    gs2 = GetScans(all=showAll)
 
40
    scs = ShowCISScans(all=showAll)
 
41
else:
 
42
    gs2 = None
 
43
    scs = None
 
44
 
 
45
# Use the whole detector if no selected region is specified
 
46
if not globals().has_key('selected_region'):
 
47
    selected_region = ''
 
48
    
 
49
print 'Dumping plots for %s' % selected_region
 
50
Go([Use(run=runs, runType='CIS', region=selected_region),\
 
51
    ReadCIS(),\
 
52
    ReadDB(),\
 
53
    CISFlagProcedure(),\
 
54
    CISRecalibrateProcedure(),\
 
55
    gs2,\
 
56
    scs,\
 
57
    CopyLocalChanStat(),\
 
58
    WriteChanStat()
 
59
    ])
 
60
 
 
61