Skip to content
Snippets Groups Projects
Commit 3f5439f5 authored by Brian Moe's avatar Brian Moe
Browse files

Now using glue.lvalert.make_LVAlertTable. Added Omega filename for LUMIN.

parent 6c2ad4aa
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,8 @@ sys.path.append('/home/lars/django')
# OK, the lib/lib64 situation should be handled better.
sys.path.append('/opt/lscsoft/glue/lib64/python2.4/site-packages')
sys.path.append('/opt/lscsoft/glue/lib/python2.4/site-packages')
sys.path.append('/opt/lscsoft-bleed/lib64/python2.4/site-packages')
sys.path.append('/opt/lscsoft-bleed/lib/python2.4/site-packages')
sys.path.append('/opt/lscsoft/pylal/lib/python2.4/site-packages')
sys.path.append('/opt/lscsoft/pylal/lib64/python2.4/site-packages')
......
......@@ -2,15 +2,19 @@
import sys
import time
from subprocess import Popen, PIPE, STDOUT
import StringIO
from django.core.mail import send_mail
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse, get_script_prefix
import glue.ligolw.utils
import glue.lvalert.utils
def issueAlert(event, location):
issueXMPPAlert(event, location)
def issueAlert(event, location, temp_data_loc):
issueXMPPAlert(event, location, temp_data_loc)
issueEmailAlert(event, location)
def indent(nindent, text):
......@@ -49,7 +53,7 @@ Event Summary:
indent(3, prepareSummary(event)))
send_mail(subject, message, fromaddress, toaddress)
def issueXMPPAlert(event, location):
def issueXMPPAlert(event, location, temp_data_loc):
nodename = "%s_%s"% (event.group.name, event.get_analysisType_display())
nodename = nodename.lower()
......@@ -75,7 +79,13 @@ def issueXMPPAlert(event, location):
stdout=null,
stderr=STDOUT,
env=env)
msg = createPayload(event.graceid(), location)
#msg = createPayload(event.graceid(), location)
xmldoc = glue.lvalert.utils.make_LVAlertTable("", location, event.graceid(), temp_data_loc)
buf = StringIO.StringIO()
glue.ligolw.utils.write_fileobj(xmldoc, buf)
msg = buf.getvalue()
p.stdin.write(msg)
p.stdin.close()
for i in range(1,10):
......
......@@ -19,6 +19,7 @@ def handle_uploaded_data(event, datafilename,
log_filename='event.log',
coinc_table_filename='coinc.xml'):
temp_data_loc = ""
if event.analysisType == 'HM':
# Wildly speculative
xmldoc = glue.ligolw.utils.load_filename(datafilename)
......@@ -68,18 +69,14 @@ def handle_uploaded_data(event, datafilename,
if event.analysisType == 'MBTA':
#xmldoc, log_data, detectors, cid = populate_inspiral_tables("MbtaFake-930909680-16.gwf")
#final_xmldoc = populate_coinc_tables(xmldoc,cid,insp_event_id_dict,\
# InspiralCoincDef,detectors)
#here's how it works for inspirals
#populate the tables
#xmldoc, log_data, temp_data_loc = populate_inspiral_tables("MbtaFake-930909680-16.gwf")
#write the output
#write_output_files('.', xmldoc, log_data)
xmldoc, log_data, detectors, cid = \
xmldoc, log_data, temp_data_loc = \
populate_inspiral_tables(datafilename)
xmldoc = populate_coinc_tables(xmldoc,
cid,
insp_event_id_dict,
InspiralCoincDef,
detectors)
output_dir = os.path.dirname(datafilename)
write_output_files(output_dir, xmldoc, log_data,
......@@ -124,16 +121,11 @@ def handle_uploaded_data(event, datafilename,
event.save()
elif event.analysisType == 'OM': # Omega
#xmldoc, log_data, detectors, cid = populate_burst_tables("initial.data")
#final_xmldoc = populate_coinc_tables(xmldoc,cid, coherent_event_id_dict,\
# BurstCoincDef, detectors)
#here's how it works for bursts
#xmldoc, log_data, temp_data_loc = populate_burst_tables("initial.data")
#write_output_files('.', final_xmldoc, log_data)
xmldoc, log_data, detectors, cid = populate_burst_tables(datafilename)
xmldoc = populate_coinc_tables(
xmldoc, cid, \
coherent_event_id_dict, BurstCoincDef, \
detectors)
xmldoc, log_data, temp_data_loc = populate_burst_tables(datafilename)
output_dir = os.path.dirname(datafilename)
write_output_files(output_dir, xmldoc, log_data)
......@@ -175,3 +167,5 @@ def handle_uploaded_data(event, datafilename,
event.save()
else:
pass
return temp_data_loc
......@@ -66,10 +66,14 @@ def create(request):
createWikiPage(event.graceid())
# Extract Info from uploaded data
handle_uploaded_data(event, uploadDestination)
# Temp (ha!) hack to deal with
# out of band data from Omega to LUMIN.
temp_data_loc = handle_uploaded_data(event, uploadDestination)
# Send an alert.
issueAlert(event, os.path.join(event.clusterurl(), "private", f.name))
issueAlert(event,
os.path.join(event.clusterurl(), "private", f.name),
temp_data_loc)
#return HttpResponseRedirect(reverse(view, args=[event.graceid()]))
except:
# something went wrong.
......
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