From 87dc3e985e2c73423be5b7dae522124dc51b8466 Mon Sep 17 00:00:00 2001 From: Wanting Niu <wanting.niu@ligo.org> Date: Tue, 29 Oct 2024 03:16:12 +0000 Subject: [PATCH] Enable Multiple Channel Output in Online Streamer --- gstlal-ugly/bin/gstlal_ll_inj_stream | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gstlal-ugly/bin/gstlal_ll_inj_stream b/gstlal-ugly/bin/gstlal_ll_inj_stream index 658547626d..3a8254bc09 100755 --- a/gstlal-ugly/bin/gstlal_ll_inj_stream +++ b/gstlal-ugly/bin/gstlal_ll_inj_stream @@ -65,6 +65,10 @@ def parse_command_line(): parser.add_option("--frame-type", metavar = "name", type="string", action = "append", help = "Frame type to be included in the name of the output frame files. Must be provided once for each ifo anlyzed as {IFO}={FRAME_TYPE}.") parser.add_option("--gps-end-time", metavar = "s", default = 2000000000, help = "The time at which to stop looking for data in frame cache if different from legnth of cache. Script will terminate at this time. Default is to take all times in frame cache. e.g. GPS=200000000") parser.add_option("--history-len", metavar = "s", type=int, default = 300, help = "Length of time (in seconds) to keep files for in output-dir. Files written more than history-len in the past, will be deleted from output-dir. Default: 300s") + + # Add output options + parser.add_option("--output-channel-tag", metavar = "channel_name", type = "str", help = "Add a tag for the output channel name of injection channel to distinguish sources. ") + parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose (optional).") options, filenames = parser.parse_args() @@ -316,7 +320,10 @@ with tempfile.NamedTemporaryFile(mode='w',suffix='.cache') as f: # add injections to hoft # note that the adder sinks the streams - inj_strain_dict[channel+'_INJ'] = pipeparts.mkadder(pipeline, [hoft_strain, this_inj_strain], sync=True, mix_mode="sum") + if options.output_channel_tag: + inj_strain_dict[channel + '_' + options.output_channel_tag + '_INJ'] = pipeparts.mkadder(pipeline, [hoft_strain, this_inj_strain], sync=True, mix_mode="sum") + else: + inj_strain_dict[channel + '_INJ'] = pipeparts.mkadder(pipeline, [hoft_strain, this_inj_strain], sync=True, mix_mode="sum") # want to mux hoft, inj + hoft, and passthrough channels -- GitLab