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

Retractions are now successfully caught and removed from event history

parent 20324153
No related branches found
No related tags found
No related merge requests found
......@@ -73,8 +73,6 @@ def process_gcn(payload, root):
for elem in root.iterfind('.//Param')}
descs = [elem.text for elem in root.iterfind('.//Description')]
if params['Group'] != 'CBC':
return
#prepare path for localization skymap, then download and produce the map in png format
#filepath = params['skymap_fits']
......@@ -156,6 +154,10 @@ def process_gcn(payload, root):
pass
h5file.close()
return
if params['Group'] != 'CBC':
return
if sim == False:
try:
table = h5file.create_table(h5file.root.events,params['GraceID'],Event,'CBC event')
......@@ -238,7 +240,6 @@ def process_gcn(payload, root):
'''PLOTTING'''
#save the pie of possibilities
specindex = np.argmax(vals)
fig1, ax1 = plt.subplots(figsize=(5,5))
ax1.pie(vals,labels=None,wedgeprops=dict(width=0.5))
ax1.axis('equal')
......
......@@ -40,8 +40,6 @@ def sync_database():
for col in soup.tbody.find_all("tr"):
#print(row)
#for col in row("tr"):
if 'RETRACTED' in str(col):
continue
#link = col.find(hasstylenotclass).a.extract()
name = col.find(hasstylenotclass).a.string
eventnames.append(name)
......@@ -55,14 +53,16 @@ def sync_database():
bestfiles = []
imglinks = []
if any('Update' in s for s in all_files):
retracted = 0
if any('Retract' in s for s in all_files):
bestfiles= [s for s in all_files if 'Retract' in s]
retracted = 1
elif any('Update' in s for s in all_files):
bestfiles = [s for s in all_files if 'Update' in s]
elif any('Initial' in s for s in all_files):
bestfiles= [s for s in all_files if 'Initial' in s]
else:
bestfiles = [s for s in all_files if 'Preliminary' in s]
bestfiles = [s for s in all_files if 'Preliminary' in s]
if any('LALInferenceOffline.png' in s for s in all_files):
imglinks = [s for s in all_files if 'LALInferenceOffline.png' in s]
else:
......@@ -76,8 +76,8 @@ def sync_database():
imgpath = evname+'.png'
datapath = 'ToRead'+evname+'.xml'
os.system("curl --silent -0 "+imgfilepath + '> ' + './'+imgpath)
if retracted != 1:
os.system("curl --silent -0 "+imgfilepath + '> ' + './'+imgpath)
os.system("curl --silent -0 "+datafilepath + '> ' + './'+datapath)
payload = open(datapath,'rb').read()
......
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