Commit 815360af authored by Stephen Privitera's avatar Stephen Privitera
Browse files

PR 3686: Updating pipedown for use with UL codes.

Original: 0505a0de249b0268e552b8592f91ac48602440d2
parent 03b22cdc
......@@ -811,22 +811,35 @@ for result_db in result_dbs_cache:
############################################################################
# Compute the upper limits as a function of mass for these types of mass binnings
if 'FULL_DATA' in tag: #for full data, use FAR of loudest event
for bintype in ["MASS1_MASS2","CHIRP_MASS","TOTAL_MASS"]:
output_cache_name = ''.join(sorted(instruments)) + "-SEARCH_VOLUME_BY_"+bintype+"_" + tag + ".cache"
search_volume_node = inspiral.SearchVolumeNode( search_volume_job, result_db.path(), output_tag = tag, output_cache = output_cache_name, veto_segments_name = "VETO_CAT"+str(get_veto_cat_from_tag(tag))+"_CUMULATIVE", bintype = bintype )
if 'FULL_DATA' in tag:
#for full data, use FAR of loudest event
output_cache_name = ''.join(sorted(instruments)) + "-SEARCH_VOLUME_" + tag + ".cache"
search_volume_node = inspiral.SearchVolumeNode( search_volume_job )
search_volume_node.add_database( result_db.path() )
search_volume_node.set_output_tag( tag )
search_volume_node.set_output_cache( output_cache_name )
search_volume_node.set_veto_segments_name( "VETO_CAT"+str(get_veto_cat_from_tag(tag))+"_CUMULATIVE" )
search_volume_node.add_parent( ccfar_node )
search_upper_limit_node = inspiral.SearchUpperLimitNode( search_upper_limit_job, output_cache_name )
search_upper_limit_node = inspiral.SearchUpperLimitNode( search_upper_limit_job )
search_upper_limit_node.set_open_box()
search_upper_limit_node.add_input_cache( output_cache_name )
search_upper_limit_node.add_parent( search_volume_node )
dag.add_node( search_volume_node )
dag.add_node( search_upper_limit_node )
# upper limits for playground (using FAR of expected loudest event)
# make corresponding jobs for playground (using FAR of expected loudest event)
search_volume_node = inspiral.SearchVolumeNode( search_volume_job )
search_volume_node.use_expected_loudest_event()
output_cache_name = output_cache_name.replace("FULL_DATA","PLAYGROUND")
search_volume_node = inspiral.SearchVolumeNode( search_volume_job, result_db.path(), output_tag = tag.replace("FULL_DATA","PLAYGROUND"), output_cache = output_cache_name, use_expected_loudest_event = True, veto_segments_name = "VETO_CAT"+str(get_veto_cat_from_tag(tag))+"_CUMULATIVE", bintype = bintype )
search_volume_node.add_database( result_db.path() )
search_volume_node.set_output_tag( tag.replace("FULL_DATA","PLAYGROUND" ) )
search_volume_node.set_output_cache( output_cache_name )
search_volume_node.set_veto_segments_name( "VETO_CAT"+str(get_veto_cat_from_tag(tag))+"_CUMULATIVE" )
search_volume_node.add_parent( ccfar_node )
search_upper_limit_node = inspiral.SearchUpperLimitNode( search_upper_limit_job, output_cache_name )
search_upper_limit_node = inspiral.SearchUpperLimitNode( search_upper_limit_job )
search_upper_limit_node.add_input_cache( output_cache_name )
search_upper_limit_node.add_parent( search_volume_node )
dag.add_node( search_volume_node )
dag.add_node( search_upper_limit_node )
......
......@@ -3347,30 +3347,26 @@ class SearchVolumeNode(pipeline.SqliteNode):
"""
A search volume node.
"""
def __init__(self, job, database, output_cache = None, output_tag = "SEARCH_VOLUME", bootstrap_iterations=10000, veto_segments_name="vetoes", use_expected_loudest_event = False, bintype = "TOTAL_MASS"):
def __init__(self, job):
"""
@database: the pipedown database containing the injection triggers
@ouptut_cache: name prefix for cache file to be written out by program
@output_tag: a string label for the output files
@use_expected_loudest_event: disables the use of loudest event FAR, use 1./livetime instead
"""
pipeline.SqliteNode.__init__(self, job)
self.add_var_arg(database)
self.add_var_opt("bootstrap-iterations",bootstrap_iterations)
self.add_var_opt("veto-segments-name",veto_segments_name)
if output_cache:
self.add_var_opt("output-cache",output_cache)
if output_tag:
self.add_var_opt("output-name-tag",output_tag)
if use_expected_loudest_event:
self.add_var_arg("--use-expected-loudest-event")
if bintype == "TOTAL_MASS":
self.add_var_arg("--bin-by-total-mass")
if bintype == "CHIRP_MASS":
self.add_var_arg("--bin-by-chirp-mass")
if bintype == "MASS1_MASS2":
self.add_var_arg("--bin-by-m1m2")
def add_database(self, db):
self.add_var_arg(db)
def set_output_cache(self, file):
self.add_var_opt("output-cache", file)
def set_output_tag(self, tag):
self.add_var_opt("output-name-tag",tag)
def set_veto_segments_name(self, name):
self.add_var_opt("veto-segments-name", name)
def use_expected_loudest_event(self):
self.add_var_arg("--use-expected-loudest-event")
class SearchUpperLimitJob(pipeline.SqliteJob):
"""
......@@ -3390,14 +3386,16 @@ class SearchUpperLimitNode(pipeline.SqliteNode):
"""
A search upper limit node.
"""
def __init__(self, job, input_cache):
def __init__(self, job):
"""
@job: a SearchUpperLimitJob
"""
pipeline.SqliteNode.__init__(self, job)
self.add_var_opt("input-cache", input_cache)
self.open_box = False
def add_input_cache(self, input_cache):
self.add_var_arg(input_cache)
def set_open_box(self):
'''
Set the open box flag.
......@@ -3405,4 +3403,3 @@ class SearchUpperLimitNode(pipeline.SqliteNode):
if not self.open_box:
self.open_box = True
self.add_var_arg("--open-box")
......@@ -979,6 +979,11 @@ plot-normalized-energy-range = 0,25.5
; THIS SECTION MUST BE LEFT BLANK!!!!!!!!
[search-volume]
dist-err = 0.197
dist-sys-err = 0.074
mass-bins = 5
dist-err = 0.2
dist-sys-err = 0.1
mass-bins = 11
bin-by-total-mass =
bin-by-component-mass =
bin-by-chirp-mass =
iterations = 10000
bootstrap =
......@@ -930,6 +930,12 @@ plot-normalized-energy-range = 0,25.5
; THIS SECTION MUST BE LEFT BLANK!!!!!!!!
[search-volume]
dist-err = 0.197
dist-sys-err = 0.074
mass-bins = 5
dist-err = 0.2
dist-sys-err = 0.1
total-mass-bins = '2,5,8,11,14,17,20,25'
component-mass1-bins = '1,3,8,13,18,23'
bin-by-chirp-mass =
bin-by-bns-bbh =
iterations = 10000
bootstrap =
......@@ -904,49 +904,14 @@ def write_upperlimit(page, opts,thisSearch='playground',pipedown='pipedown'):
sections.append(section)
htmlAndPlot.append(section)
titles[section] = "Sensitive Distance as a Function of Component Masses."
tags[section] = '*lalapps_cbc_sink_by_mass1_mass2*'+ifartag[0]+'*CAT_4_VETO*'
tags[section] = '*lalapps_cbc_sink_by_component_mass*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_mass1_mass2_range_summary*'
imagetags[section] = ['distance','fractional_error']
captions[section] = """Mean sensitive distance for the CBC search pipeline as a function of the component masses. The sensitive distance is determined by computing the cube root of the mean distance^3 for injections found with a FAR below the FAR of the loudest event. The corresponding fractional error plot gives a measure of the relative uncertainty in the measured sensitive distance arising from uncertainty in calibration and a finite injection population. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
comments[section] = None
configs[section] = None
images_dirs[section] = PDdir
section= 'upperlimitVmtotal'
sections.append(section)
htmlAndPlot.append(section)
titles[section] = "Upper Limits as a Function of Total Mass."
tags[section] = '*lalapps_cbc_sink_by_total_mass*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_total_mass_range_summary*'
imagetags[section] = ['upper_limit_plot']
captions[section] = """Uncombined upper limits on the inspiral merger rate (in mergers/Mpc^3/yr) as a function of total mass. The plot gives the upper limits with and without including the effect of systematic errors due to calibration uncertainty and finite injection population. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
comments[section] = None
configs[section] = None
images_dirs[section] = PDdir
section= 'upperlimitVmchirp'
sections.append(section)
htmlAndPlot.append(section)
titles[section] = "Upper Limits as a Function of Chirp Mass."
tags[section] = '*lalapps_cbc_sink_by_chirp_mass*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_chirp_mass_range_summary*'
imagetags[section] = ['upper_limit_plot']
captions[section] = """Uncombined upper limits on the inspiral merger rate (in mergers/Mpc^3/yr) as a function of chirp mass. The plot gives the upper limits with and without including the effect of systematic errors due to calibration uncertainty and finite injection population. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
imagetags[section] = ['distance']
captions[section] = """Mean sensitive distance for the CBC search pipeline as a function of the component masses. The sensitive distance is determined by computing the cube root of the mean distance^3 for injections found with a FAR below the FAR of the loudest event. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
comments[section] = None
configs[section] = None
images_dirs[section] = PDdir
section= 'upperlimitVm1m2'
sections.append(section)
htmlAndPlot.append(section)
titles[section] = "Upper Limits as a Function of Component Masses."
tags[section] = '*lalapps_cbc_sink_by_mass1_mass2*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_mass1_mass2_range_summary*'
imagetags[section] = ['upper_limit_plot']
captions[section] = """Uncombined upper limits on the inspiral merger rate (in mergers/Mpc^3/yr) as a function of the component masses. The plot gives the upper limits with and without including the effect of systematic errors due to calibration uncertainty and finite injection population. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
comments[section] = None
configs[section] = None
images_dirs[section] = PDdir
section= 'combupperlimitVmtotal'
sections.append(section)
......@@ -976,8 +941,8 @@ def write_upperlimit(page, opts,thisSearch='playground',pipedown='pipedown'):
sections.append(section)
htmlAndPlot.append(section)
titles[section] = "Combined Upper Limits as a Function of Component Masses."
tags[section] = '*lalapps_cbc_combined_sink_by_mass1_mass2*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_mass1_mass2_combined_upper_limit*'
tags[section] = '*lalapps_cbc_combined_sink_by_component_mass*'+ifartag[0]+'*CAT_4_VETO*'
htmltags[section] = '*'+ifartag[0]+'_CAT_4_VETO_component_mass_combined_upper_limit*'
imagetags[section] = ['upper_limit_plot']
captions[section] = """Combined upper limits on the inspiral merger rate (in mergers/Mpc^3/yr) as a function of the component masses. The plot gives the upper limits with and without including the effect of systematic errors due to calibration uncertainty and finite injection population. (CAT2 and CAT3 vetoes applied and CBC hardware injections removed)."""
comments[section] = None
......@@ -2784,9 +2749,9 @@ if opts.hardware_injection is True:
if opts.full_data is True: html_sections['full_data'] = "Full Data"
if opts.followup is True: html_sections['followup'] = "Followup"
if opts.upperlimit is True:
html_sections['upperlimit_play'] = "Playground Upper Limit"
html_sections['upperlimit_play'] = "Search Sensitivity"
if opts.upperlimit and opts.full_data:
html_sections['upperlimit_full'] = "Full Data Upper Limit"
html_sections['upperlimit_full'] = "Upper Limits"
if opts.summary_files:
html_sections['summary_files'] = "Summary files"
html_sections['logfile'] = "Log File"
......
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