Skip to content
Snippets Groups Projects
Commit 58f18dc2 authored by Patrick Godwin's avatar Patrick Godwin
Browse files

gstlal_idq_trigger_gen: added option to toggle latency output

parent f537dad2
No related branches found
No related tags found
No related merge requests found
......@@ -486,7 +486,11 @@ for channel in channels:
max_samp_rate = int(samp_rate)
min_samp_rate = min(32, max_samp_rate)
n_rates = int(numpy.log2(max_samp_rate/min_samp_rate) + 1)
if data_source_info.latency_output:
head[channel] = pipeparts.mklatency(pipeline, head[channel], name = 'stage2_beforeWhitening_%s' % channel)
for rate, thishead in idq_multirate_datasource.mkwhitened_multirate_src(pipeline, head[channel], [min_samp_rate*2**i for i in range(n_rates)], instrument, channel_name = channel, width=32, quality=1, cutoff=None).items():
if data_source_info.latency_output:
thishead = pipeparts.mklatency(pipeline, thishead, name = 'stage3_afterWhitening_%s_%s' % (str(rate).zfill(5), channel))
if data_source_info.extension == 'ini':
# use omicron params with .ini files
flow = data_source_info.channel_dict[channel]['flow']
......@@ -504,11 +508,15 @@ for channel in channels:
basis_params[(channel, rate)] = [(phi, q, duration(phi, q, 1e-3)/2.) for (phi, q) in phi_ql(flow, fhigh, qlow, qhigh)]
thishead = pipeparts.mkqueue(pipeline, thishead, max_size_buffers = 0, max_size_bytes = 0, max_size_time = Gst.SECOND * 30)
thishead = pipeparts.mkfirbank(pipeline, thishead, fir_matrix = numpy.array([half_sine_gaussian(sine_gaussian(phi, phi_0, q, t_arr)) for (phi, q) in phi_ql(flow, fhigh, qlow, qhigh) for phi_0 in phase]), time_domain = False, block_stride = int(rate), latency = 0)
if data_source_info.latency_output:
thishead = pipeparts.mklatency(pipeline, thishead, name = 'stage4_afterFIRbank_%s_%s' % (str(rate).zfill(5), channel))
thishead = pipeparts.mkqueue(pipeline, thishead, max_size_buffers = 1, max_size_bytes = 0, max_size_time = 0)
thishead = pipeparts.mktogglecomplex(pipeline, thishead)
thishead = pipeparts.mkcapsfilter(pipeline, thishead, caps = "audio/x-raw, format=Z64LE, rate=%i" % rate)
thishead = pipeparts.mktaginject(pipeline, thishead, "instrument=%s,channel-name=%s" %( instrument, channel) )
thishead = pipeparts.mktrigger(pipeline, thishead, rate, max_snr = True)
if data_source_info.latency_output:
thishead = pipeparts.mklatency(pipeline, thishead, name = 'stage5_afterTrigger_%s_%s' % (str(rate).zfill(5), channel))
src[(channel, rate)] = thishead
if options.verbose:
......
......@@ -234,6 +234,9 @@ class DataSourceInfo(object):
## Analysis segment. Default is None
self.seg = None
## Set latency output
self.latency_output = options.latency_output
if options.gps_start_time is not None:
if options.gps_end_time is None:
......@@ -337,6 +340,8 @@ def append_options(parser):
- --channel-exclude [string]
Set the channel names to be excluded. Can be given multiple times.
- --latency-output
Set whether to print out latency (in seconds) at various stages of the detector.
#### Typical usage case examples
......@@ -362,7 +367,8 @@ def append_options(parser):
group.add_option("--section-exclude", default=[], type="string", action="append", help="Exclude these sections of the INI file from the final omegascan config. We require an exact match to exclude a section.")
group.add_option("--safety-exclude", default=[], type="string", action="append", help="Exclude any channel with this safety value. Can supply multiple values by repeating this argument. Each must be one of (add here)")
group.add_option("--fidelity-exclude", default=[], type="string", action="append", help="Exclude any channel with this fidelity value. Can supply multiple values by repeating this argument. Each must be on of (add here)")
group.add_option("--channel-exclude", default=[], action="append", type="string", help="Exclude this channel (requires exact match). Can be repeated")
group.add_option("--channel-exclude", default=[], action="append", type="string", help="Exclude this channel (requires exact match). Can be repeated.")
group.add_option("--latency-output", action = "store_true", help = "Print out latency output (s) at different stages of the pipeline (measured as current time - buffer time).")
parser.add_option_group(group)
##
......@@ -463,7 +469,9 @@ def mkbasicmultisrc(pipeline, data_source_info, instrument, verbose = False):
for channel in head:
head[channel] = pipeparts.mkqueue(pipeline, None, max_size_buffers = 0, max_size_bytes = 0, max_size_time = Gst.SECOND* 60 * 1) # 1 minute of buffering
pipeparts.src_deferred_link(demux, channel, head[channel].get_static_pad("sink"))
if data_source_info.latency_output:
head[channel] = pipeparts.mklatency(pipeline, head[channel], name = 'stage1_afterFrameXmit_%s' % channel)
# fill in holes, skip duplicate data
head[channel] = pipeparts.mkaudiorate(pipeline, head[channel], skip_to_first = True, silent = False)
......
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