Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

Commit f3a3b8f8 authored by Aaron Viets's avatar Aaron Viets

gstlal-calibration: Found some more print statements to re-format for Python 3.

parent 4f9be102
Pipeline #50085 passed with stages
in 10 minutes and 22 seconds
......@@ -49,6 +49,8 @@ For a full list of example command lines that were used to create the O2 h(t) fr
Type gstlal_compute_strain --help to see the full list of command line options.
"""
from __future__ import print_function
import os
import sys
import numpy
......@@ -382,7 +384,7 @@ if filters_name.count('/') > 0:
else:
# We need to search for the filters file
filters_paths = []
print "\nSearching for %s ..." % filters_name
print("\nSearching for %s ..." % filters_name)
# Check the user's home directory
for dirpath, dirs, files in os.walk(os.environ['HOME']):
if filters_name in files:
......@@ -401,7 +403,7 @@ else:
filters_paths.append(os.path.join(dirpath, filters_name))
if not len(filters_paths):
raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME']))
print "Loading calibration filters from %s\n" % filters_paths[0]
print("Loading calibration filters from %s\n" % filters_paths[0])
filters = numpy.load(filters_paths[0])
# In case we want to remove calibration lines, we will fill these dictionaries
......@@ -2615,7 +2617,7 @@ if any(witness_channel_list):
if key in witness_channel_list[i]:
witnesses.append(calibration_parts.caps_and_progress(pipeline, head_dict[key], "audio/x-raw, format=F64LE, channels=1, channel-mask=(bitmask)0x0", key))
if len(witnesses) != len(witness_channel_list[i]):
print "WARNING: Not all requested witness channels are being used"
print("WARNING: Not all requested witness channels are being used")
clean_strain = calibration_parts.clean_data(pipeline, clean_strain, hoft_sr, witnesses, witness_rates[i], witness_fft_samples, witness_fft_overlap, num_witness_ffts, min_witness_ffts, witness_tf_update_samples, witness_fir_samples, witness_frequency_resolution, witness_filter_taper_length, use_median = witness_tf_use_median, parallel_mode = witness_tf_parallel_mode, notch_frequencies = witness_notch_frequencies[i], high_pass = witness_highpasses[i], noisesub_gate_bit = noisesubgatetee, delay_time = witness_delay_time, critical_lock_loss_time = critical_lock_loss_time, filename = None if witness_tf_filename is None else "%s_%d.txt" % (witness_tf_filename, i))
witness_delay_time += witness_delay_increment
......@@ -2917,23 +2919,23 @@ if DebuggingConfigs["pipelinegraphfilename"] != "None":
# Seek the pipeline when necessary
if InputConfigs["datasource"] == "frames":
if verbose:
print >>sys.stderr, "seeking GPS start and stop times ..."
print("seeking GPS start and stop times ...", file=sys.stderr)
if pipeline.set_state(Gst.State.READY) != Gst.StateChangeReturn.SUCCESS:
raise RuntimeError("pipeline failed to enter READY state")
datasource.pipeline_seek_for_gps(pipeline, gps_start_time, gps_end_time)
if verbose:
print >>sys.stderr, "setting pipeline state to playing ..."
print("setting pipeline state to playing ...", file=sys.stderr)
if pipeline.set_state(Gst.State.PLAYING) != Gst.StateChangeReturn.SUCCESS:
raise RuntimeError("pipeline failed to enter PLAYING state")
else:
if verbose:
print "set to playing successfully"
print("set to playing successfully")
if DebuggingConfigs["pipelinegraphfilename"] != "None":
pipeparts.write_dump_dot(pipeline, "%s.%s" %(DebuggingConfigs["pipelinegraphfilename"], "PLAYING"), verbose = verbose)
if verbose:
print >>sys.stderr, "running pipeline ..."
print("running pipeline ...", file=sys.stderr)
mainloop.run()
......
......@@ -95,9 +95,9 @@ try:
f = open('frchannels.txt', 'r')
available_channels = f.read()
f.close()
print "Making channel list using available channels"
print("Making channel list using available channels")
except:
print "Cannot find file frchannels.txt. Run FrChannels to check for available channels"
print("Cannot find file frchannels.txt. Run FrChannels to check for available channels")
# These are (or may be) in the calibrated frames
channel_list.append(chan_prefix + "CALIB_STRAIN" + chan_suffix)
......@@ -300,7 +300,7 @@ for chan in temp_list:
if chan in available_channels:
channel_list.append(chan)
print "Finished channel list"
print("Finished channel list")
ifo_channel_list = []
for chan in channel_list:
......
......@@ -110,7 +110,7 @@ if filters_name.count('/') > 0:
else:
# We need to search for the filters file
filters_paths = []
print "\nSearching for %s ..." % filters_name
print("\nSearching for %s ..." % filters_name)
# Check the user's home directory
for dirpath, dirs, files in os.walk(os.environ['HOME']):
if filters_name in files:
......@@ -129,7 +129,7 @@ else:
filters_paths.append(os.path.join(dirpath, filters_name))
if not len(filters_paths):
raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME']))
print "Loading calibration filters from %s\n" % filters_paths[0]
print("Loading calibration filters from %s\n" % filters_paths[0])
filters = numpy.load(filters_paths[0])
ifo = options.ifo
......
......@@ -74,7 +74,7 @@ for tf_file in tf_files:
filters_name = tf_file.split('_npz')[0] + '.npz'
# Search the directory tree for filters files with names matching the one we want.
filters_paths = []
print "\nSearching for %s ..." % filters_name
print("\nSearching for %s ..." % filters_name)
# Check the user's home directory
for dirpath, dirs, files in os.walk(os.environ['HOME']):
if filters_name in files:
......@@ -93,7 +93,7 @@ for tf_file in tf_files:
filters_paths.append(os.path.join(dirpath, filters_name))
if not len(filters_paths):
raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME']))
print "Loading calibration filters from %s\n" % filters_paths[0]
print("Loading calibration filters from %s\n" % filters_paths[0])
filters = numpy.load(filters_paths[0])
model_jump_delay = options.filters_model_jump_delay
......
......@@ -149,7 +149,7 @@ if options.config_file is not None:
else:
# We need to search for the filters file
filters_paths = []
print "\nSearching for %s ..." % filters_name
print("\nSearching for %s ..." % filters_name)
# Check the user's home directory
for dirpath, dirs, files in os.walk(os.environ['HOME']):
if filters_name in files:
......@@ -168,7 +168,7 @@ if options.config_file is not None:
filters_paths.append(os.path.join(dirpath, filters_name))
if not len(filters_paths):
raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME']))
print "Loading calibration filters from %s\n" % filters_paths[0]
print("Loading calibration filters from %s\n" % filters_paths[0])
filters = numpy.load(filters_paths[0])
# Get the corrections for numerators and denominator, and resample if necessary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment