Skip to content
Snippets Groups Projects
Commit a1113eb7 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

gstlal_inspiral: add extra config checking

- confirm the channel list matches the instruments in the time slide vectors
- confirm the reference PSDs, if given, match the instruments in the time slides
parent 2d20b580
No related branches found
No related tags found
No related merge requests found
......@@ -567,6 +567,8 @@ offsetvectors = lsctables.TimeSlideTable.get_table(ligolw_utils.load_filename(op
all_instruments = reduce(lambda a, b: a | set(b), offsetvectors, set())
if len(all_instruments) < options.min_instruments:
raise ValueError("--time-slide-file \"%s\" names %s but we need at least %d instruments" % (options.time_slide_file, ", ".join(sorted(all_instruments)), options.min_instruments))
if all_instruments != set(detectors.channel_dict):
raise ValueError("--time-slide-file names %s but have channel names for %s" % (", ".join(sorted(all_instruments)), ", ".join(sorted(detectors.channel_dict))))
#
......@@ -581,6 +583,8 @@ if len(all_instruments) < options.min_instruments:
if options.reference_psd is not None:
psd = lal.series.read_psd_xmldoc(ligolw_utils.load_filename(options.reference_psd, verbose = options.verbose, contenthandler = lal.series.PSDContentHandler))
if set(psd) < all_instruments:
raise ValueError("missing PSD(s) for %s" % ", ".join(sorted(all_instruments - set(psd))))
else:
psd = dict((instrument, None) for instrument in detectors.channel_dict)
......
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