def get_science_segments(workflow, out_dir, tags=None):
    """
    Get the analyzable segments after applying ini specified vetoes.

    Parameters
    -----------
    workflow : Workflow object
        Instance of the workflow object
    out_dir : path
        Location to store output files
    tags : list of strings
        Used to retrieve subsections of the ini file for
        configuration options.

    Returns
    --------
    sci_seg_file : workflow.core.SegFile instance
        The segment file combined from all ifos containing the science segments.
    sci_segs : Ifo keyed dict of ligo.segments.segmentlist instances
        The science segs for each ifo, keyed by ifo
    sci_seg_name : str
        The name with which science segs are stored in the output XML file.
    """
    if tags is None:
        tags = []
    logging.info('Starting generation of science segments')

    make_analysis_dir(out_dir)
    start_time = workflow.analysis_time[0]
    end_time = workflow.analysis_time[1]

    # NOTE: Should this be overrideable in the config file?
    sci_seg_name = "SCIENCE"
    sci_segs = {}
    sci_seg_dict = segments.segmentlistdict()
    sci_seg_summ_dict = segments.segmentlistdict()

    for ifo in workflow.ifos:
        curr_sci_segs, curr_sci_xml, curr_seg_name = get_sci_segs_for_ifo(ifo,
                              workflow.cp, start_time, end_time, out_dir, tags)
        sci_seg_dict[ifo + ':' + sci_seg_name] = curr_sci_segs
        sci_segs[ifo] = curr_sci_segs
        sci_seg_summ_dict[ifo + ':' + sci_seg_name] = \
                          curr_sci_xml.seg_summ_dict[ifo + ':' + curr_seg_name]
    sci_seg_file = SegFile.from_segment_list_dict(sci_seg_name,
                                          sci_seg_dict, extension='xml',
                                          valid_segment=workflow.analysis_time,
                                          seg_summ_dict=sci_seg_summ_dict,
                                          directory=out_dir, tags=tags)
    logging.info('Done generating science segments')
    return sci_seg_file, sci_segs, sci_seg_name
def get_science_segments ( workflow , out_dir , tags = None ) : if tags is None : tags = [ ] logging . info ( 'Starting generation of science segments' ) make_analysis_dir ( out_dir ) start_time = workflow . analysis_time [ 0 ] end_time = workflow . analysis_time [ 1 ] sci_seg_name = "SCIENCE" sci_segs = { } sci_seg_dict = segments . segmentlistdict ( ) sci_seg_summ_dict = segments . segmentlistdict ( ) for ifo in workflow . ifos : curr_sci_segs , curr_sci_xml , curr_seg_name = get_sci_segs_for_ifo ( ifo , workflow . cp , start_time , end_time , out_dir , tags ) sci_seg_dict [ ifo + ':' + sci_seg_name ] = curr_sci_segs sci_segs [ ifo ] = curr_sci_segs sci_seg_summ_dict [ ifo + ':' + sci_seg_name ] = curr_sci_xml . seg_summ_dict [ ifo + ':' + curr_seg_name ] sci_seg_file = SegFile . from_segment_list_dict ( sci_seg_name , sci_seg_dict , extension = 'xml' , valid_segment = workflow . analysis_time , seg_summ_dict = sci_seg_summ_dict , directory = out_dir , tags = tags ) logging . info ( 'Done generating science segments' ) return sci_seg_file , sci_segs , sci_seg_name
Get the analyzable segments after applying ini specified vetoes.

    Parameters
    -----------
    workflow : Workflow object
        Instance of the workflow object
    out_dir : path
        Location to store output files
    tags : list of strings
        Used to retrieve subsections of the ini file for
        configuration options.

    Returns
    --------
    sci_seg_file : workflow.core.SegFile instance
        The segment file combined from all ifos containing the science segments.
    sci_segs : Ifo keyed dict of ligo.segments.segmentlist instances
        The science segs for each ifo, keyed by ifo
    sci_seg_name : str
        The name with which science segs are stored in the output XML file.