Commit 8f4b0e86 authored by Patrick Godwin's avatar Patrick Godwin

add option to turn on automatic ranking stat compression in gstlal_inspiral + online DAG

parent 08ed03e9
......@@ -265,6 +265,8 @@ def parse_command_line():
group.add_option("--ranking-stat-input", metavar = "url", help = "Set the URL from which to load a ranking statistic definition. When this is enabled, signal candidates will have ranking statistic values assigned on-the-fly. Required when --data-source is lvshm or framexmit; must also set --likelihood-snapshot-interval.")
group.add_option("--ranking-stat-output", metavar = "filename", action = "append", default = [], help = "Set the name of the file to which to write ranking statistic data collected from triggers (optional). Can be given more than once. If given, exactly as many must be provided as there are --svd-bank options and they will be writen to in order.")
group.add_option("--ranking-stat-output-cache", metavar = "filename", help = "Provide a cache of ranking statistic output files. This can be used instead of giving multiple --ranking-stat-output options. Cannot be combined with --ranking-stat-output.")
group.add_option("--compress-ranking-stat", action = "store_true", help = "Choose whether to compress the ranking stat upon start up. Only used when --ranking-stat-input is set.")
group.add_option("--compress-ranking-stat-threshold", type = "float", default = 0.03, help = "Only keep horizon distance values that differ by this much, fractionally, from their neighbours (default = 0.03).")
group.add_option("--likelihood-snapshot-interval", type = "float", metavar = "seconds", help = "How often to snapshot candidate and ranking statistic data to disk when running online.")
group.add_option("--ranking-stat-pdf", metavar = "url", help = "Set the URL from which to load the ranking statistic PDF. This is used to compute false-alarm probabilities and false-alarm rates and is required for online operation (when --data-source is framexmit or lvshm). It is forbidden for offline operation (all other data sources)")
group.add_option("--time-slide-file", metavar = "filename", help = "Set the name of the xml file to get time slide offsets (required).")
......@@ -798,6 +800,14 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
elif rankingstat.template_ids != template_ids:
raise ValueError("\"%s\" is for the wrong templates" % options.ranking_stat_input)
rankingstat.numerator.set_horizon_factors(horizon_factors)
if options.compress_ranking_stat:
if options.verbose:
print >> sys.stderr, "compressing ranking stat..."
rankingstat.numerator.horizon_history.compress(threshold = options.compress_ranking_stat_threshold)
if options.verbose:
print >> sys.stderr, "...done."
if rankingstat is None:
rankingstat = far.RankingStat(template_ids = template_ids, instruments = all_instruments, delta_t = options.coincidence_threshold, min_instruments = options.min_instruments, horizon_factors = horizon_factors)
......
......@@ -133,6 +133,8 @@ def parse_command_line():
parser.add_option("--likelihood-cache", help = "set the cache containin likelihood files")
parser.add_option("--zerolag-likelihood-cache", help = "set the cache containin zerolag likelihood files")
parser.add_option("--marginalized-likelihood-file", help = "set the marginalized likelihood file, required")
parser.add_option("--compress-ranking-stat", action = "store_true", help = "Choose whether to compress the ranking stat upon start up. Only used when --ranking-stat-input is set.")
parser.add_option("--compress-ranking-stat-threshold", type = "float", default = 0.03, help = "Only keep horizon distance values that differ by this much, fractionally, from their neighbours (default = 0.03).")
parser.add_option("--control-peak-time", default = 4, metavar = "secs", help = "set the control peak time, default 4")
parser.add_option("--fir-stride", default = 4, metavar = "secs", help = "set the fir bank stride, default 4")
parser.add_option("--gracedb-far-threshold", type = "float", help = "false alarm rate threshold for gracedb (Hz), if not given gracedb events are not sent")
......
......@@ -150,6 +150,14 @@ def online_inspiral_layer(dag, jobs, options):
}
common_opts.update(datasource_opts)
# add ranking stat compression options, if requested
if options.compress_ranking_stat:
compress_opts = {
"compress-ranking-stat": "",
"compress-ranking-stat-threshold": options.compress_ranking_stat_threshold
}
common_opts.update(compress_opts)
inspNode = dagparts.DAGNode(jobs['gstlalInspiral'], dag, [],
opts = common_opts,
input_files = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment