From c2c4ed2fc62a3bb0f79b32dbf0720e7d35bf0bfe Mon Sep 17 00:00:00 2001 From: Patrick Godwin <patrick.godwin@ligo.org> Date: Wed, 5 Sep 2018 12:37:37 -0700 Subject: [PATCH] feature extractor: make channel list INI files friendlier to parse due to spaces in section names --- gstlal-burst/python/fxtools/multichannel_datasource.py | 6 +++--- .../Makefile.gstlal_feature_extractor_offline | 10 +++++----- .../Makefile.gstlal_feature_extractor_online | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gstlal-burst/python/fxtools/multichannel_datasource.py b/gstlal-burst/python/fxtools/multichannel_datasource.py index 922c153ae7..acdb250568 100644 --- a/gstlal-burst/python/fxtools/multichannel_datasource.py +++ b/gstlal-burst/python/fxtools/multichannel_datasource.py @@ -143,7 +143,7 @@ def channel_dict_from_channel_ini(options): for name in sections: # ensure only channels whose sections aren't excluded are added to the dict - if not options.section_include or name in options.section_include: + if not options.section_include or name.replace(' ','_') in options.section_include: # extract low frequency, high Q flow = config.getfloat(name, 'flow') @@ -533,7 +533,7 @@ def append_options(parser): Required iff --frame-segments-file is given - --section-include [string] - Set the channel sections to be included from the INI file. Can be given multiple times. If not specified, assumed to include all sections. + Set the channel sections to be included from the INI file. Can be given multiple times. Pass in spaces as underscores instead. If not specified, assumed to include all sections. - --safety-include [string] Set the safety values for channels to be included from the INI file. Can be given multiple times. Default = "safe". @@ -582,7 +582,7 @@ def append_options(parser): group.add_option("--frame-type", type="string", metavar = "name", help = "Include only those channels with the frame type given.") group.add_option("--frame-segments-file", metavar = "filename", help = "Set the name of the LIGO light-weight XML file from which to load frame segments. Optional iff --data-source=frames") group.add_option("--frame-segments-name", metavar = "name", help = "Set the name of the segments to extract from the segment tables. Required iff --frame-segments-file is given") - group.add_option("--section-include", default=[], type="string", action="append", help="Set the channel sections to be included from the INI file. Can be given multiple times. If not specified, assumed to include all sections") + group.add_option("--section-include", default=[], type="string", action="append", help="Set the channel sections to be included from the INI file. Can be given multiple times. Pass in spaces as underscores instead. If not specified, assumed to include all sections") group.add_option("--safety-include", default=["safe"], type="string", action="append", help="Set the safety values for channels to be included from the INI file. Can be given multiple times. Default = 'safe'.") group.add_option("--fidelity-exclude", default=[], type="string", action="append", help="Set the fidelity values for channels to be excluded from the INI file. Can supply multiple values by repeating this argument. Each must be on of (add here)") group.add_option("--safe-channel-include", default=[], action="append", type="string", help="Include this channel when reading the INI file (requires exact match). Can be repeated. If not specified, assume to include all channels.") diff --git a/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_offline b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_offline index dc0d23a4f1..7c4971d06b 100644 --- a/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_offline +++ b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_offline @@ -119,7 +119,7 @@ LEVEL = standard CHANNEL_LIST = $(IFO)-$(EPOCH)-$(LEVEL).ini -# if not specified, use all sections +# if not specified, use all sections (replace spaces with underscores'_') SECTION_INCLUDE = # if not specified, use defaults @@ -130,10 +130,10 @@ FIDELITY_EXCLUDE = UNSAFE_CHANNEL_INCLUDE = $(IFO):CAL-DELTAL_EXTERNAL_DQ # parse include/excludes into command line options -SECTION_INCLUDE_COMMANDS := $(addprefix --section-include= ,$(SECTION_INCLUDE)) -SAFETY_INCLUDE_COMMANDS := $(addprefix --safety-include= ,$(SAFETY_INCLUDE)) -FIDELITY_EXCLUDE_COMMANDS := $(addprefix --fidelity-exclude= ,$(FIDELITY_EXCLUDE)) -UNSAFE_CHANNEL_INCLUDE_COMMANDS := $(addprefix --unsafe-channel-include= ,$(UNSAFE_CHANNEL_INCLUDE)) +SECTION_INCLUDE_COMMANDS := $(addprefix --section-include ,$(SECTION_INCLUDE)) +SAFETY_INCLUDE_COMMANDS := $(addprefix --safety-include ,$(SAFETY_INCLUDE)) +FIDELITY_EXCLUDE_COMMANDS := $(addprefix --fidelity-exclude ,$(FIDELITY_EXCLUDE)) +UNSAFE_CHANNEL_INCLUDE_COMMANDS := $(addprefix --unsafe-channel-include ,$(UNSAFE_CHANNEL_INCLUDE)) ################ # Segment info # diff --git a/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online index 40595de065..fb269af407 100644 --- a/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online +++ b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online @@ -144,7 +144,7 @@ LEVEL = standard CHANNEL_LIST = $(IFO)-$(EPOCH)-$(LEVEL).ini -# if not specified, use all sections +# if not specified, use all sections (replace spaces with underscores'_') SECTION_INCLUDE = # if not specified, use defaults @@ -155,10 +155,10 @@ FIDELITY_EXCLUDE = UNSAFE_CHANNEL_INCLUDE = $(IFO):CAL-DELTAL_EXTERNAL_DQ # parse include/excludes into command line options -SECTION_INCLUDE_COMMANDS := $(addprefix --section-include= ,$(SECTION_INCLUDE)) -SAFETY_INCLUDE_COMMANDS := $(addprefix --safety-include= ,$(SAFETY_INCLUDE)) -FIDELITY_EXCLUDE_COMMANDS := $(addprefix --fidelity-exclude= ,$(FIDELITY_EXCLUDE)) -UNSAFE_CHANNEL_INCLUDE_COMMANDS := $(addprefix --unsafe-channel-include= ,$(UNSAFE_CHANNEL_INCLUDE)) +SECTION_INCLUDE_COMMANDS := $(addprefix --section-include ,$(SECTION_INCLUDE)) +SAFETY_INCLUDE_COMMANDS := $(addprefix --safety-include ,$(SAFETY_INCLUDE)) +FIDELITY_EXCLUDE_COMMANDS := $(addprefix --fidelity-exclude ,$(FIDELITY_EXCLUDE)) +UNSAFE_CHANNEL_INCLUDE_COMMANDS := $(addprefix --unsafe-channel-include ,$(UNSAFE_CHANNEL_INCLUDE)) ################# # Web directory # -- GitLab