Skip to content
Snippets Groups Projects
Commit 46af0486 authored by Rachael Huxford's avatar Rachael Huxford
Browse files

Move verbose calls -> options.verbose

parent c46f0873
No related branches found
No related tags found
2 merge requests!612Combined online-offline ranks,!535Logging Patch + Extension of Queues in Injection Streamer
Pipeline #572274 passed
...@@ -194,8 +194,7 @@ for ftype in options.frame_type: ...@@ -194,8 +194,7 @@ for ftype in options.frame_type:
# Logging # Logging
# #
verbose = options.verbose log_level = logging.DEBUG if options.verbose else logging.INFO
log_level = logging.DEBUG if verbose else logging.INFO
logging.basicConfig(level = log_level, format = "%(asctime)s | gstlal_ll_inj_stream : %(levelname)s : %(message)s") logging.basicConfig(level = log_level, format = "%(asctime)s | gstlal_ll_inj_stream : %(levelname)s : %(message)s")
...@@ -269,7 +268,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -269,7 +268,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
# #
inj_src = pipeparts.mklalcachesrc(pipeline, location=f.name, cache_src_regex='HKLV') inj_src = pipeparts.mklalcachesrc(pipeline, location=f.name, cache_src_regex='HKLV')
if verbose: if options.verbose:
inj_src = pipeparts.mkprogressreport(pipeline, inj_src, '%s_inj_strain_pre_demux'%instrument) inj_src = pipeparts.mkprogressreport(pipeline, inj_src, '%s_inj_strain_pre_demux'%instrument)
inj_demux = pipeparts.mkframecppchanneldemux(pipeline, inj_src, do_file_checksum=False, channel_list=list(map("%s:%s".__mod__, hoft_inj_channel_dict.items()))) inj_demux = pipeparts.mkframecppchanneldemux(pipeline, inj_src, do_file_checksum=False, channel_list=list(map("%s:%s".__mod__, hoft_inj_channel_dict.items())))
...@@ -278,7 +277,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -278,7 +277,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
inj_strain = pipeparts.mkqueue(pipeline, None, max_size_buffers=0, max_size_bytes=0, max_size_time=frame_duration * Gst.SECOND) inj_strain = pipeparts.mkqueue(pipeline, None, max_size_buffers=0, max_size_bytes=0, max_size_time=frame_duration * Gst.SECOND)
pipeparts.src_deferred_link(inj_demux, "%s:%s" % (instrument, hoft_inj_channel_dict[instrument]), inj_strain.get_static_pad("sink")) pipeparts.src_deferred_link(inj_demux, "%s:%s" % (instrument, hoft_inj_channel_dict[instrument]), inj_strain.get_static_pad("sink"))
inj_strain.get_static_pad("src").add_probe(Gst.PadProbeType.BUFFER, check_current_frames, now) inj_strain.get_static_pad("src").add_probe(Gst.PadProbeType.BUFFER, check_current_frames, now)
if verbose: if options.verbose:
inj_strain = pipeparts.mkprogressreport(pipeline, inj_strain, '%s_inj_strain_after_demux'%instrument) inj_strain = pipeparts.mkprogressreport(pipeline, inj_strain, '%s_inj_strain_after_demux'%instrument)
...@@ -288,7 +287,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -288,7 +287,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
hoft_src = pipeparts.mkdevshmsrc(pipeline, shm_dirname=shared_memory_dict[instrument], wait_time=60) hoft_src = pipeparts.mkdevshmsrc(pipeline, shm_dirname=shared_memory_dict[instrument], wait_time=60)
hoft_src = pipeparts.mkqueue(pipeline, hoft_src, max_size_buffers=0, max_size_bytes=0, max_size_time=Gst.SECOND * frame_duration) hoft_src = pipeparts.mkqueue(pipeline, hoft_src, max_size_buffers=0, max_size_bytes=0, max_size_time=Gst.SECOND * frame_duration)
if verbose: if options.verbose:
hoft_src = pipeparts.mkprogressreport(pipeline, hoft_src, '%s_hoft_src'%instrument) hoft_src = pipeparts.mkprogressreport(pipeline, hoft_src, '%s_hoft_src'%instrument)
hoft_demux = pipeparts.mkframecppchanneldemux(pipeline, hoft_src, do_file_checksum=False, skip_bad_files=True) hoft_demux = pipeparts.mkframecppchanneldemux(pipeline, hoft_src, do_file_checksum=False, skip_bad_files=True)
...@@ -299,7 +298,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -299,7 +298,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
for channel_name in hoft_channel_dict[instrument]: for channel_name in hoft_channel_dict[instrument]:
channel_src = pipeparts.mkqueue(pipeline, None, max_size_buffers=0, max_size_bytes=0, max_size_time=Gst.SECOND * 10) channel_src = pipeparts.mkqueue(pipeline, None, max_size_buffers=0, max_size_bytes=0, max_size_time=Gst.SECOND * 10)
pipeparts.src_deferred_link(hoft_demux, "%s:%s" % (instrument, channel_name), channel_src.get_static_pad("sink")) pipeparts.src_deferred_link(hoft_demux, "%s:%s" % (instrument, channel_name), channel_src.get_static_pad("sink"))
if verbose: if options.verbose:
channel_src = pipeparts.mkprogressreport(pipeline, channel_src, "%s:%s" % (instrument, channel_name)) channel_src = pipeparts.mkprogressreport(pipeline, channel_src, "%s:%s" % (instrument, channel_name))
# Only add items to strain_dict which we want to become a new hoft + inj stream # Only add items to strain_dict which we want to become a new hoft + inj stream
...@@ -326,7 +325,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -326,7 +325,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
# add injections to hoft # add injections to hoft
inj_strain_dict[channel+'_INJ'] = pipeparts.mkadder(pipeline, [hoft_strain, this_inj_strain], sync=True, mix_mode="sum") inj_strain_dict[channel+'_INJ'] = pipeparts.mkadder(pipeline, [hoft_strain, this_inj_strain], sync=True, mix_mode="sum")
if verbose: if options.verbose:
inj_strain_dict[channel+'_INJ'] = pipeparts.mkprogressreport(pipeline, inj_strain_dict[channel+'_INJ'], "%s_%s_INJ_after_adder"%(instrument,channel)) inj_strain_dict[channel+'_INJ'] = pipeparts.mkprogressreport(pipeline, inj_strain_dict[channel+'_INJ'], "%s_%s_INJ_after_adder"%(instrument,channel))
# Be sure to sink the queued inj stream # Be sure to sink the queued inj stream
this_inj_strain = pipeparts.mkfakesink(pipeline, this_inj_strain) this_inj_strain = pipeparts.mkfakesink(pipeline, this_inj_strain)
...@@ -338,7 +337,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: ...@@ -338,7 +337,7 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f:
channel_dict.update(strain_dict) channel_dict.update(strain_dict)
channel_dict.update(inj_strain_dict) channel_dict.update(inj_strain_dict)
output_stream = pipeparts.mkframecppchannelmux(pipeline, channel_src_map=channel_dict, frame_duration=1, frames_per_file=1) output_stream = pipeparts.mkframecppchannelmux(pipeline, channel_src_map=channel_dict, frame_duration=1, frames_per_file=1)
if verbose: if options.verbose:
output_stream = pipeparts.mkprogressreport(pipeline, output_stream, "%s_output_after_mux"%instrument) output_stream = pipeparts.mkprogressreport(pipeline, output_stream, "%s_output_after_mux"%instrument)
......
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