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

gstlal_inspiral_make_snr_pdf: fix some options

- options that can be given multiple times and that have default values were appending the values from the command line to the defaults instead of overriding the defaults with the user-supplied values.
parent 8031dcb0
No related branches found
No related tags found
No related merge requests found
......@@ -66,9 +66,9 @@ def parse_command_line():
parser.add_option("--full-fragment", metavar = "n/m", default = "1/1", help = "Enable parallelization of --full by selecting a fragment of the full SNR PDFs sequence to generate. When --full is enabled, the iteration over SNR PDFs employs a reproducible, deterministic, sequence. That sequence is divided into m (m >= 1) approximately equal-sized intervals, and only the SNR PDFs from the n-th interval (1 <= n <= m) of the sequence will be constructed. Afterwards, the files generated by several jobs can be combined by re-invoking the program using the --seed or --seed-cache options to obtain the complete SNR PDF collection. The format of this option is \"n/m\", and the default is \"1/1\", which causes all SNR PDFs to be constructed.")
parser.add_option("--horizon-distances", metavar = "instrument=distance[,instrument=distance,...]", action = "append", help = "Cache SNR PDFs for these instruments and horizon distances. Format is, e.g., H1=120,L1=120,V1=48. Units for distance are irrelevant (PDFs depend only on their ratios). A PDF will be constructed for every combination of --min-instruments or more instruments from the set. All --horizon-distances must list the same instruments (if an instrument is off set its horizon distance to 0).")
parser.add_option("--horizon-distance-flow", metavar = "Hz", default = 10., type = "float", help = "When obtaining horizon distances from a collection PSD files, start horizon distance integral at this frequency in Hertz (default = 10 Hz).")
parser.add_option("--horizon-distance-masses", metavar = "m1,m2", action = "append", default = ["1.4,1.4"], help = "When obtaining horizon distances from a collection of PSD files, compute them for these masses in solar mass units (default = 1.4,1.4). Can be given multiple times.")
parser.add_option("--horizon-distance-masses", metavar = "m1,m2", action = "append", help = "When obtaining horizon distances from a collection of PSD files, compute them for these masses in solar mass units (default = 1.4,1.4). Can be given multiple times.")
parser.add_option("--instruments", metavar = "name[,name,...]", help = "Set the instruments to include in the network. If PSD files alone are to be used to provide horizon distances, or --full is selected, then this option is required, otherwise it is optional. If both --instruments and --horizon-distances are given, they must list the same instruments.")
parser.add_option("--min-instruments", metavar = "count", action = "append", default = [1, 2], type = "int", help = "Set the minimum number of instruments required to form a candidate; can be given multiple times (default is 1 and 2). Note that the probability that a recovered signal is recovered by a given set of instruments depends on how many instruments are required to participate. The PDF cache must contain entries for every value of this parameter one will use to conduct searches.")
parser.add_option("--min-instruments", metavar = "count", action = "append", type = "int", help = "Set the minimum number of instruments required to form a candidate; can be given multiple times (default is 1 and 2). Note that the probability that a recovered signal is recovered by a given set of instruments depends on how many instruments are required to participate. The PDF cache must contain entries for every value of this parameter one will use to conduct searches.")
parser.add_option("--output", "-o", metavar = "filename", help = "Write SNR PDF cache to this file (required).")
parser.add_option("--seed", metavar = "filename", action = "append", default = [], help = "Seed the SNR PDF cache by loading pre-computed SNR PDFs from this file. Can be given multiple times.")
parser.add_option("--seed-cache", metavar = "filename", help = "Seed the SNR PDF cache by loading pre-computed SNR PDFs from the files named in this LAL cache.")
......@@ -76,6 +76,13 @@ def parse_command_line():
options, filenames = parser.parse_args()
# defaults that can't be set in OptionParser because they would be
# appended to instead of overridden
if options.horizon_distance_masses is None:
options.horizon_distance_masses = ["1.4,1.4"]
if options.min_instruments is None:
options.min_instruments = [1, 2]
processparams = options.__dict__.copy()
if options.verbose:
......
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