Skip to content

Commit

Permalink
Addressed some of Ian's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtrevor committed Aug 29, 2023
1 parent ee0d860 commit 4c5ed69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
15 changes: 3 additions & 12 deletions bin/workflows/pycbc_make_offline_search_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,9 @@ save_fig_with_metadata(time_str, time_file.storage_path, **kwds)

# Get segments and find the data locations
sci_seg_name = 'science'
science_tags = []
if 'science' in workflow.cp.get_subsections('workflow-segments'):
science_tags = ['science']
science_seg_file = wf.get_segments_file(workflow, sci_seg_name, 'segments-science',
rdir['analysis_time/segment_data'],
tags=science_tags)
tags=['science'])

ssegs = {}
for ifo in workflow.ifos:
Expand All @@ -147,23 +144,17 @@ datafind_files, analyzable_file, analyzable_segs, analyzable_name = \
seg_file=science_seg_file, tags=hoft_tags)

final_veto_name = 'vetoes'
veto_tags = []
if 'veto' in workflow.cp.get_subsections('workflow-segments'):
veto_tags = ['veto']
final_veto_file = wf.get_segments_file(workflow, final_veto_name,
'segments-vetoes',
rdir['analysis_time/segment_data'],
tags=veto_tags)
tags=['veto'])

# Get dq segments from veto definer and calculate data quality timeseries
dq_flag_name = 'dq_flag'
dq_tags = []
if 'dq' in workflow.cp.get_subsections('workflow-segments'):
dq_tags = ['dq']
dq_segment_file = wf.get_flag_segments_file(workflow, dq_flag_name,
'segments-dq',
rdir['analysis_time/segment_data'],
tags=dq_tags)
tags=['dq'])

# Template bank stuff
hdfbank = wf.setup_tmpltbank_workflow(workflow, analyzable_segs,
Expand Down
19 changes: 12 additions & 7 deletions pycbc/workflow/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ def get_segments_file(workflow, name, option_name, out_dir, tags=None):
start = workflow.analysis_time[0]
end = workflow.analysis_time[1]

if tags is None:
tags = []

# Check for veto definer file
veto_definer = None
veto_tags = []
if 'veto' in workflow.cp.get_subsections('workflow-segments'):
veto_tags = ['veto']
if cp.has_option_tags("workflow-segments", "segments-veto-definer-url", veto_tags):
veto_definer = save_veto_definer(workflow.cp, out_dir, veto_tags)
if cp.has_option_tags("workflow-segments",
"segments-veto-definer-url", veto_tags):
veto_definer = save_veto_definer(workflow.cp, out_dir, tags=['veto'])

# Check for provided server
server = "https://segments.ligo.org"
Expand Down Expand Up @@ -415,10 +416,14 @@ def get_flag_segments_file(workflow, name, option_name, out_dir, tags=None):
start = workflow.analysis_time[0]
end = workflow.analysis_time[1]

if tags is None:
tags = []

# Check for veto definer file
veto_definer = None
if cp.has_option("workflow-segments", "segments-veto-definer-url"):
veto_definer = save_veto_definer(workflow.cp, out_dir, [])
if cp.has_option_tags("workflow-segments",
"segments-veto-definer-url", veto_tags):
veto_definer = save_veto_definer(workflow.cp, out_dir, tags=['veto'])

# Check for provided server
server = "https://segments.ligo.org"
Expand Down

0 comments on commit 4c5ed69

Please sign in to comment.