Skip to content
Snippets Groups Projects
Commit 6cf9f621 authored by Christian's avatar Christian
Browse files

Moved formatting of some parameters to main app file

parent b464e59f
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ def process_gcn(payload, root): ...@@ -168,7 +168,7 @@ def process_gcn(payload, root):
table=h5file.get_node("/events",'EventSimulation') table=h5file.get_node("/events",'EventSimulation')
det_event = table.row det_event = table.row
for key, value in params.items(): for key, value in params.items():
#print(key, '=', value) # print(key, '=', value)
if key == 'FAR': if key == 'FAR':
per_yr = float(value)*scipy.constants.year per_yr = float(value)*scipy.constants.year
if per_yr <= 1: if per_yr <= 1:
...@@ -181,7 +181,7 @@ def process_gcn(payload, root): ...@@ -181,7 +181,7 @@ def process_gcn(payload, root):
val = "One every "+str("{0:.3f}".format(oneinyr))+" yrs" val = "One every "+str("{0:.3f}".format(oneinyr))+" yrs"
det_event[key] = val det_event[key] = val
descriptions[key]=descs[i] descriptions[key]=descs[i]
elif key == 'Pkt_Ser_Num': if key == 'Pkt_Ser_Num':
key = 'Revision' key = 'Revision'
det_event[key] = value det_event[key] = value
descriptions[key] = descs[i] descriptions[key] = descs[i]
...@@ -223,7 +223,7 @@ def process_gcn(payload, root): ...@@ -223,7 +223,7 @@ def process_gcn(payload, root):
det_formtime = one+' at '+two det_formtime = one+' at '+two
det_event['DetectionTime']=det_formtime det_event['DetectionTime']=det_formtime
upt_time = root.find('.//Date') upt_time = root.find('.//Date')
upt_text = upt_time.text upt_text = upt_time.text
[one1,two1] = upt_text.split('T') [one1,two1] = upt_text.split('T')
...@@ -271,6 +271,6 @@ def process_gcn(payload, root): ...@@ -271,6 +271,6 @@ def process_gcn(payload, root):
#testing #testing
#os.chdir('./event_data') #os.chdir('./event_data')
#import lxml #import lxml
#payload = open('PreviousEventToRead.xml', 'rb').read() #payload = open('S190828l-1-Preliminary.xml', 'rb').read()
#root = lxml.etree.fromstring(payload) #root = lxml.etree.fromstring(payload)
#process_gcn(payload, root) #process_gcn(payload, root)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment