Functions | Variables
fetchNoiseMap Namespace Reference

Functions

def get_time (time_str)
 
def get_mapname (stime)
 
def get_metadata (fname)
 
def fetch_map (fname, tgt)
 

Variables

 parser = argparse.ArgumentParser(description='Fetch the noise channel mask for given file/timestamp')
 
 help
 
 default
 
 args = parser.parse_args()
 
 fname = args.FILE
 
 target = args.output
 
 mdata = get_metadata(fname)
 
 stime = get_time(mdata['Start Time'])
 
int attempt = 0
 
 mapname = get_mapname(stime)
 
 hours
 

Function Documentation

def fetchNoiseMap.fetch_map (   fname,
  tgt 
)
Copy a noise channel mask here

Definition at line 30 of file fetchNoiseMap.py.

30 def fetch_map(fname,tgt):
31  """ Copy a noise channel mask here"""
32  p = subprocess.call(['scp','novadaq@novadaq-far-trigger-2016.fnal.gov:/ddt/NoiseMaps/backup/'+fname,tgt])
33  return p
34 
35 
36 
def fetch_map(fname, tgt)
def fetchNoiseMap.get_mapname (   stime)

Definition at line 11 of file fetchNoiseMap.py.

11 def get_mapname(stime):
12  return stime.strftime("mask.FD.%Y%m%d_%H00*.nhm")
13 
def get_mapname(stime)
def fetchNoiseMap.get_metadata (   fname)
get the file metadata as a dict

Definition at line 14 of file fetchNoiseMap.py.

References if(), and print.

14 def get_metadata(fname):
15  """ get the file metadata as a dict"""
16  p = subprocess.Popen(['samweb','get-metadata',fname],
17  stdout=subprocess.PIPE, stderr=subprocess.PIPE)
18  resp_s,err=p.communicate()
19  if(len(err)): print("### Error: "+err);
20 
21  resp={}
22  for line in resp_s.split('\n'):
23  pos = line.find(':') #find the delimiter
24  if(pos==-1): continue
25  key=line[:pos].strip()
26  val=line[(pos+1):].strip()
27  resp[key]=val
28  return resp
29 
def get_metadata(fname)
if(dump)
bool print
def fetchNoiseMap.get_time (   time_str)

Definition at line 8 of file fetchNoiseMap.py.

8 def get_time(time_str):
9  return datetime.strptime(time_str,"%Y-%m-%dT%H:%M:%S+00:00")
10 
def get_time(time_str)
Definition: fetchNoiseMap.py:8

Variable Documentation

fetchNoiseMap.args = parser.parse_args()

Definition at line 41 of file fetchNoiseMap.py.

int fetchNoiseMap.attempt = 0

Definition at line 51 of file fetchNoiseMap.py.

fetchNoiseMap.default

Definition at line 40 of file fetchNoiseMap.py.

fetchNoiseMap.fname = args.FILE

Definition at line 44 of file fetchNoiseMap.py.

fetchNoiseMap.help

Definition at line 39 of file fetchNoiseMap.py.

fetchNoiseMap.hours
fetchNoiseMap.mapname = get_mapname(stime)

Definition at line 53 of file fetchNoiseMap.py.

Referenced by photrans::BrightnessLevel.BrightnessLevel().

fetchNoiseMap.mdata = get_metadata(fname)

Definition at line 47 of file fetchNoiseMap.py.

fetchNoiseMap.parser = argparse.ArgumentParser(description='Fetch the noise channel mask for given file/timestamp')

Definition at line 38 of file fetchNoiseMap.py.

fetchNoiseMap.stime = get_time(mdata['Start Time'])
fetchNoiseMap.target = args.output

Definition at line 45 of file fetchNoiseMap.py.