parser.add_option("--candidates",metavar="filename",help="Set the name of the SQLite database from which to pull candidates (required).")
parser.add_option("--ranking-stat-cache",metavar="filename",help="Load all ranking statistic files from this cache (required).")
parser.add_option("--output-format",metavar="extension",default=".png",help="Select output format by setting the filename extension (default = \".png\").")
# iterate over candidates, generate (ranking stat, fast-path stat) samples
#
n_samples=100000
cursor_outer=connection.cursor()
cursor_inner=connection.cursor()
ifoptions.verbose:
(n_samples,),=cursor_outer.execute("SELECT COUNT(*) FROM coinc_event WHERE coinc_def_id == ? AND time_slide_id NOT IN (SELECT DISTINCT(time_slide_id) FROM time_slide WHERE offset != 0);",(coinc_def_id,)).fetchall()
forln_lr,coinc_event_id,time_slide_idincursor_outer.execute("SELECT coinc_event.likelihood, coinc_event.coinc_event_id, coinc_event.time_slide_id FROM coinc_event WHERE coinc_def_id == ? AND time_slide_id NOT IN (SELECT DISTINCT(time_slide_id) FROM time_slide WHERE offset != 0);",(coinc_def_id,)):
# retrieve triggers
events=map(sngl_inspiral_row,cursor_inner.execute("SELECT sngl_inspiral.* FROM sngl_inspiral JOIN coinc_event_map ON (coinc_event_map.table_name == 'sngl_inspiral' AND coinc_event_map.event_id == sngl_inspiral.event_id) WHERE coinc_event_map.coinc_event_id == ?",(coinc_event_id,)))