Skip to content
Snippets Groups Projects
Commit f8ff8c40 authored by Soichiro Kuwahara's avatar Soichiro Kuwahara
Browse files

gstlal_cherenkov_plot_rankingstat: change the command line options

- can load multiple rankingstat files
parent 59b96491
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@ from optparse import OptionParser
import sys
from ligo.lw import utils as ligolw_utils
from lal.utils import CacheEntry
from gstlal.cherenkov import rankingstat as cherenkov_rankingstat
......@@ -68,15 +69,18 @@ def parse_command_line():
parser = OptionParser(
description = "GstLAL-based cherenkov burst ranking statistic plotting tool."
)
parser.add_option("--verbose", action = "store_true", help = "Be verbose.")
parser.add_option("--input-rank", metavar = "filename", help = "Name of the input rankingstat .")
parser.add_option("--ranking-stat-cache", metavar = "filename", help = "Also load the ranking statistic likelihood ratio data files listed in this LAL cache. See lalapps_path2cache for information on how to produce a LAL cache file.")
parser.add_option("--output", metavar = "string", help = "Name of output png.")
options, filenames = parser.parse_args()
parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.")
options, urls = parser.parse_args()
if options.ranking_stat_cache is not None:
urls += [CacheEntry(line).url for line in open(options.ranking_stat_cache)]
# save for the process_params table
options.options_dict = dict(options.__dict__)
return options, filenames
return options, urls
#
......@@ -88,15 +92,14 @@ def parse_command_line():
#
options, filenames = parse_command_line()
options, urls = parse_command_line()
#
# load the ranking stat file
#
rankingstat = cherenkov_rankingstat.RankingStat.from_xml(ligolw_utils.load_filename(options.input_rank, verbose = options.verbose, contenthandler = cherenkov_rankingstat.LIGOLWContentHandler), "rankingstat")
rankingstat = cherenkov_rankingstat.marginalize_rankingstat_urls(urls, verbose = 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