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

gstlal_inspiral a bit of clean-up

parent cfc1a0b9
No related branches found
No related tags found
No related merge requests found
......@@ -34,9 +34,9 @@ import warnings
import pygtk
pygtk.require('2.0')
pygtk.require("2.0")
import pygst
pygst.require('0.10')
pygst.require("0.10")
from gstlal.option import OptionParser
......@@ -46,6 +46,7 @@ from glue.ligolw import utils
from glue.ligolw.utils import segments as ligolw_segments
from pylal.datatypes import LIGOTimeGPS
from gstlal import ligolw_output
from gstlal import svd_bank
from pylal.xlal.datatypes.snglinspiraltable import from_buffer as sngl_inspirals_from_buffer
......@@ -97,7 +98,7 @@ def parse_command_line():
options, filenames = parser.parse_args()
if len([option for option in ('frame_cache', 'fake_data', 'online_data') if getattr(options, option) is not None]) != 1:
if len([option for option in ("frame_cache", "fake_data", "online_data") if getattr(options, option) is not None]) != 1:
raise ValueError, "must provide exactly one of --frame-cache, --fake-data, --online-data"
required_options = ["instrument", "output"]
......@@ -196,18 +197,13 @@ else:
# The following snippet is taken from http://gstreamer.freedesktop.org/wiki/FAQ#Mypygstprogramismysteriouslycoredumping.2Chowtofixthis.3F
import pygtk
pygtk.require("2.0")
import gobject
gobject.threads_init()
import pygst
pygst.require('0.10')
import gst
from gstlal import pipeparts
from gstlal import lloidparts
from gstlal import svd_bank
from gstlal import reference_psd
......@@ -246,7 +242,7 @@ if options.reference_psd is not None:
else:
# FIXME right now vetoes are applied after whitening. If that
# changes this function will need to know about vetoes too
psd = measure_psd(
psd = reference_psd.measure_psd(
options.instrument,
seekevent,
detectors[options.instrument],
......@@ -404,11 +400,15 @@ if options.write_pipeline is not None:
if options.write_pipeline is not None:
write_dump_dot(pipeline, "%s.%s" % (options.write_pipeline, "NULL"), verbose = options.verbose)
if options.verbose:
print >>sys.stderr, "setting pipeline state to playing ..."
pipeline.set_state(gst.STATE_PLAYING)
if pipeline.set_state(gst.STATE_PLAYING) != gst.STATE_CHANGE_SUCCESS:
raise RuntimeError, "pipeline did not enter playing state"
if options.write_pipeline is not None:
write_dump_dot(pipeline, "%s.%s" % (options.write_pipeline, "PLAYING"), verbose = options.verbose)
if options.verbose:
print >>sys.stderr, "running pipeline ..."
mainloop.run()
......
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