Skip to content
Snippets Groups Projects
Commit a1659c3f authored by Madeline Wade's avatar Madeline Wade
Browse files

Cleaning up some no longer needed glue imports and python3 syntax

parent cde951ed
No related branches found
No related tags found
No related merge requests found
...@@ -225,12 +225,10 @@ AC_SUBST([LAL_LIBS]) ...@@ -225,12 +225,10 @@ AC_SUBST([LAL_LIBS])
# #
# Check for glue # Check for ligo_segments
# #
AC_SUBST([MIN_GLUE_VERSION], [1.50])
AX_PYTHON_GLUE()
AC_SUBST([MIN_LIGO_SEGMENTS_VERSION], [1.1.0]) AC_SUBST([MIN_LIGO_SEGMENTS_VERSION], [1.1.0])
AX_PYTHON_LIGO_SEGMENTS([$MIN_LIGO_SEGMENTS_VERSION]) AX_PYTHON_LIGO_SEGMENTS([$MIN_LIGO_SEGMENTS_VERSION])
......
...@@ -14,7 +14,6 @@ Build-Depends: ...@@ -14,7 +14,6 @@ Build-Depends:
libgstreamer-plugins-base1.0-dev (>= @MIN_GSTREAMER_VERSION@), libgstreamer-plugins-base1.0-dev (>= @MIN_GSTREAMER_VERSION@),
pkg-config, pkg-config,
python-all-dev (>= @MIN_PYTHON_VERSION@), python-all-dev (>= @MIN_PYTHON_VERSION@),
python-glue (>= @MIN_GLUE_VERSION@),
python-numpy python-numpy
Package: gstlal-calibration Package: gstlal-calibration
...@@ -36,7 +35,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ...@@ -36,7 +35,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends},
libgstreamer-plugins-base1.0-0 (>= @MIN_GSTREAMER_VERSION@), libgstreamer-plugins-base1.0-0 (>= @MIN_GSTREAMER_VERSION@),
python (>= @MIN_PYTHON_VERSION@), python (>= @MIN_PYTHON_VERSION@),
python-gi, python-gi,
python-glue (>= @MIN_GLUE_VERSION@),
python-ligo-segments (>= @MIN_LIGO_SEGMENTS_VERSION@), python-ligo-segments (>= @MIN_LIGO_SEGMENTS_VERSION@),
python-gst-1.0, python-gst-1.0,
python-numpy, python-numpy,
......
...@@ -9,7 +9,6 @@ from math import pi ...@@ -9,7 +9,6 @@ from math import pi
from gwpy.plotter import BodePlot from gwpy.plotter import BodePlot
import numpy import numpy
from optparse import OptionParser, Option from optparse import OptionParser, Option
from glue import datafind
parser = OptionParser() parser = OptionParser()
......
...@@ -10,7 +10,6 @@ Group: LSC Software/Data Analysis ...@@ -10,7 +10,6 @@ Group: LSC Software/Data Analysis
Requires: gstlal >= @MIN_GSTLAL_VERSION@ Requires: gstlal >= @MIN_GSTLAL_VERSION@
Requires: gstlal-ugly >= @MIN_GSTLALUGLY_VERSION@ Requires: gstlal-ugly >= @MIN_GSTLALUGLY_VERSION@
Requires: python >= @MIN_PYTHON_VERSION@ Requires: python >= @MIN_PYTHON_VERSION@
Requires: glue >= @MIN_GLUE_VERSION@
Requires: python2-ligo-segments >= @MIN_LIGO_SEGMENTS_VERSION@ Requires: python2-ligo-segments >= @MIN_LIGO_SEGMENTS_VERSION@
Requires: %{gstreamername} >= @MIN_GSTREAMER_VERSION@ Requires: %{gstreamername} >= @MIN_GSTREAMER_VERSION@
Requires: %{gstreamername}-plugins-base >= @MIN_GSTREAMER_VERSION@ Requires: %{gstreamername}-plugins-base >= @MIN_GSTREAMER_VERSION@
......
...@@ -290,32 +290,32 @@ def remove_lines_with_witnesses(pipeline, signal, witnesses, freqs, freq_vars, f ...@@ -290,32 +290,32 @@ def remove_lines_with_witnesses(pipeline, signal, witnesses, freqs, freq_vars, f
# Re-format inputs if necessary # Re-format inputs if necessary
if type(witnesses) is not list and type(witnesses) is not tuple and type(witnesses) is not numpy.ndarray: if type(witnesses) is not list and type(witnesses) is not tuple and type(witnesses) is not numpy.ndarray:
print "remove_lines_with_witnesses(): argument 3 should be type list. Converting %s to list" % type(witnesses) print("remove_lines_with_witnesses(): argument 3 should be type list. Converting %s to list" % type(witnesses))
witnesses = [[witnesses]] witnesses = [[witnesses]]
if type(freqs) is not list and type(freqs) is not tuple and type(freqs) is not numpy.ndarray: if type(freqs) is not list and type(freqs) is not tuple and type(freqs) is not numpy.ndarray:
print "remove_lines_with_witnesses(): argument 4 should be type list. Converting %s to list" % type(freqs) print("remove_lines_with_witnesses(): argument 4 should be type list. Converting %s to list" % type(freqs))
freqs = [[freqs]] freqs = [[freqs]]
if type(freq_vars) is not list and type(freq_vars) is not tuple and type(freq_vars) is not numpy.ndarray: if type(freq_vars) is not list and type(freq_vars) is not tuple and type(freq_vars) is not numpy.ndarray:
print "remove_lines_with_witnesses(): argument 5 should be type list. Converting %s to list" % type(freq_vars) print("remove_lines_with_witnesses(): argument 5 should be type list. Converting %s to list" % type(freq_vars))
freq_vars = [freq_vars] freq_vars = [freq_vars]
for i in range(0, len(witnesses) - len(freqs)): for i in range(0, len(witnesses) - len(freqs)):
print "remove_lines_with_witnesses(): Warning: not enough elements in argument 4" print("remove_lines_with_witnesses(): Warning: not enough elements in argument 4")
freqs.append(freqs[-1]) freqs.append(freqs[-1])
for i in range(0, len(witnesses) - len(freq_vars)): for i in range(0, len(witnesses) - len(freq_vars)):
print "remove_lines_with_witnesses(): Warning: not enough elements in argument 5" print("remove_lines_with_witnesses(): Warning: not enough elements in argument 5")
freq_vars.append(freq_vars[-1]) freq_vars.append(freq_vars[-1])
if len(freqs) > len(witnesses): if len(freqs) > len(witnesses):
print "remove_lines_with_witnesses(): Warning: too many elements in argument 4" print("remove_lines_with_witnesses(): Warning: too many elements in argument 4")
freqs = freqs[:len(witnesses)] freqs = freqs[:len(witnesses)]
if len(freq_vars) > len(witnesses): if len(freq_vars) > len(witnesses):
print "remove_lines_with_witnesses(): Warning: too many elements in argument 5" print("remove_lines_with_witnesses(): Warning: too many elements in argument 5")
freq_vars = freq_vars[:len(witnesses)] freq_vars = freq_vars[:len(witnesses)]
for i in range(0, len(witnesses)): for i in range(0, len(witnesses)):
if type(witnesses[i]) is not list and type(witnesses[i]) is not tuple and type(witnesses[i]) is not numpy.ndarray: if type(witnesses[i]) is not list and type(witnesses[i]) is not tuple and type(witnesses[i]) is not numpy.ndarray:
print "remove_lines_with_witnesses(): argument 3 should be list of lists. Converting %s to list" % type(witnesses[i]) print("remove_lines_with_witnesses(): argument 3 should be list of lists. Converting %s to list" % type(witnesses[i]))
witnesses[i] = [witnesses[i]] witnesses[i] = [witnesses[i]]
if type(freqs[i]) is not list and type(freqs[i]) is not tuple and type(freqs[i]) is not numpy.ndarray: if type(freqs[i]) is not list and type(freqs[i]) is not tuple and type(freqs[i]) is not numpy.ndarray:
print "remove_lines_with_witnesses(): argument 4 should be list of lists. Converting %s to list" % type(freqs[i]) print("remove_lines_with_witnesses(): argument 4 should be list of lists. Converting %s to list" % type(freqs[i]))
freqs[i] = [freqs[i]] freqs[i] = [freqs[i]]
filter_param = 0.0625 filter_param = 0.0625
......
#!/usr/bin/env python #!/usr/bin/env python
from gwpy.timeseries import TimeSeries from gwpy.timeseries import TimeSeries
from glue import datafind
import glob import glob
from math import pi from math import pi
import matplotlib as mpl; mpl.use('Agg') import matplotlib as mpl; mpl.use('Agg')
......
...@@ -9,7 +9,6 @@ from math import pi ...@@ -9,7 +9,6 @@ from math import pi
from gwpy.plotter import BodePlot from gwpy.plotter import BodePlot
import numpy import numpy
from optparse import OptionParser, Option from optparse import OptionParser, Option
from glue import datafind
parser = OptionParser() parser = OptionParser()
......
...@@ -9,7 +9,6 @@ from math import pi ...@@ -9,7 +9,6 @@ from math import pi
from gwpy.plotter import BodePlot from gwpy.plotter import BodePlot
import numpy import numpy
from optparse import OptionParser, Option from optparse import OptionParser, Option
from glue import datafind
parser = OptionParser() parser = OptionParser()
......
...@@ -159,7 +159,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs): ...@@ -159,7 +159,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs):
pipeline = Gst.Pipeline(name = name) pipeline = Gst.Pipeline(name = name)
head = pipeparts.mkgeneric(pipeline, None, "appsrc", caps = pipeio.caps_from_array(input_arrays[0], rate = rate)) head = pipeparts.mkgeneric(pipeline, None, "appsrc", caps = pipeio.caps_from_array(input_arrays[0], rate = rate))
def need_data(elem, arg, (input_arrays, rate)): def need_data(elem, arg, input_arrays, rate):
if input_arrays: if input_arrays:
arr = input_arrays.pop(0) arr = input_arrays.pop(0)
elem.set_property("caps", pipeio.caps_from_array(arr, rate)) elem.set_property("caps", pipeio.caps_from_array(arr, rate))
...@@ -169,7 +169,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs): ...@@ -169,7 +169,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs):
else: else:
elem.emit("end-of-stream") elem.emit("end-of-stream")
return Gst.FlowReturn.EOS return Gst.FlowReturn.EOS
head.connect("need-data", need_data, (input_arrays, rate)) head.connect("need-data", need_data, input_arrays, rate)
head = elemfunc(pipeline, head, **elemfunc_kwargs) head = elemfunc(pipeline, head, **elemfunc_kwargs)
......
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