Skip to content
Snippets Groups Projects
Commit 03fb8c11 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

lvalert_helper.upload_fig(): make log_message a required argument

parent 2b5bf9dd
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
#
# Copyright (C) 2013 Kipp Cannon
# Copyright (C) 2013--2015 Kipp Cannon
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
......@@ -16,6 +16,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## @file gstlal_inspiral_lvalert_psd_plotter
# A program to listen to lvalerts, download the psd from gstlal gracedb events, plot it, and upload the results
#
......@@ -25,6 +26,8 @@
# + `--skip-404`: Skip events that give 404 (file not found) errors (default is to abort)
# + `--gracedb-service-url`: GraceDb service url to upload (default is gracedb.DEFAULT_SERVICE_URL)
# + `--verbose`: Be verbose.
#
# =============================================================================
#
......@@ -162,5 +165,5 @@ for graceid in graceids:
logging.info("writing %s ..." % filename)
fig.savefig(filename)
else:
lvalert_helper.upload_fig(fig, gracedb_client, graceid)
lvalert_helper.upload_fig(fig, gracedb_client, graceid, log_message = "strain spectral density plot")
logging.info("finished processing %s" % graceid)
......@@ -72,7 +72,7 @@ def get_coinc_xmldoc(gracedb_client, graceid, filename = "coinc.xml"):
return ligolw_utils.load_fileobj(get_filename(gracedb_client, graceid, filename = filename), contenthandler = LIGOLWContentHandler)[0]
def upload_fig(fig, gracedb_client, graceid, filename = "psd.png", log_message = "strain spectral density plot", tagname = "psd"):
def upload_fig(fig, gracedb_client, graceid, filename, log_message, tagname = "psd"):
plotfile = StringIO.StringIO()
fig.savefig(plotfile, format = os.path.splitext(filename)[-1][1:])
logging.info("uploading \"%s\" for %s" % (filename, graceid))
......
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