Functions | Variables
update_sam_good_runs_metadata Namespace Reference

Functions

def percentStr (x, y)
 
def bulkMark (samweb, files, flag)
 

Variables

string cuts = ' and data_tier raw and online.stream 0'
 
 det = sys.argv[1]
 
 goodname = sys.argv[2]
 
 badname = sys.argv[3]
 
 fgood = open(goodname, 'r')
 
 good = set()
 
 fields = line.split('\t')
 
 run = int(fields[0])
 
 subrun = int(fields[1])
 
 fbad = open(badname, 'r')
 
 bad = set()
 
 samweb = samweb_client.SAMWebClient(experiment='nova')
 
 dbBad = samweb.listFiles('online.detector '+det+' and dq.isgoodrun false' + cuts)
 
list toMarkGood = []
 
 dbGood = samweb.listFiles('online.detector '+det+' and dq.isgoodrun true' + cuts)
 
list toMarkBad = []
 
int stride = 100
 

Function Documentation

def update_sam_good_runs_metadata.bulkMark (   samweb,
  files,
  flag 
)

Definition at line 16 of file update_sam_good_runs_metadata.py.

16 def bulkMark(samweb, files, flag):
17  assert flag == 'true' or flag == 'false'
18 
19  if len(files) == 0: return
20 
21  # Undocumented bulk metadata update. Private mail from Robert I
22 
23  mdlist = [ {'file_name': f, 'dq.isgoodrun': flag} for f in files ]
24 
25  samweb.putURL('/files',
26  params = {'continue_on_error': 1},
27  data = json.dumps(mdlist),
28  content_type = 'application/json',
29  secure = True,
30  role='*')
31 
32 
def update_sam_good_runs_metadata.percentStr (   x,
  y 
)

Definition at line 13 of file update_sam_good_runs_metadata.py.

References makeTrainCVSamples.int, and runNovaSAM.str.

13 def percentStr(x, y):
14  return str(.1*int((1000*x+.5)/y))+'%'
15 

Variable Documentation

update_sam_good_runs_metadata.bad = set()
update_sam_good_runs_metadata.badname = sys.argv[3]

Definition at line 41 of file update_sam_good_runs_metadata.py.

string update_sam_good_runs_metadata.cuts = ' and data_tier raw and online.stream 0'
update_sam_good_runs_metadata.dbBad = samweb.listFiles('online.detector '+det+' and dq.isgoodrun false' + cuts)

Definition at line 88 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.dbGood = samweb.listFiles('online.detector '+det+' and dq.isgoodrun true' + cuts)

Definition at line 115 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.det = sys.argv[1]

Definition at line 37 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.fbad = open(badname, 'r')

Definition at line 62 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.fgood = open(goodname, 'r')

Definition at line 44 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.fields = line.split('\t')
update_sam_good_runs_metadata.good = set()
update_sam_good_runs_metadata.goodname = sys.argv[2]

Definition at line 40 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.run = int(fields[0])

Definition at line 52 of file update_sam_good_runs_metadata.py.

update_sam_good_runs_metadata.samweb = samweb_client.SAMWebClient(experiment='nova')

Definition at line 85 of file update_sam_good_runs_metadata.py.

int update_sam_good_runs_metadata.stride = 100
update_sam_good_runs_metadata.subrun = int(fields[1])

Definition at line 53 of file update_sam_good_runs_metadata.py.

list update_sam_good_runs_metadata.toMarkBad = []

Definition at line 119 of file update_sam_good_runs_metadata.py.

list update_sam_good_runs_metadata.toMarkGood = []

Definition at line 92 of file update_sam_good_runs_metadata.py.