当前位置: 首页>>代码示例>>Python>>正文


Python core.makedir函数代码示例

本文整理汇总了Python中pycbc.workflow.core.makedir函数的典型用法代码示例。如果您正苦于以下问题:Python makedir函数的具体用法?Python makedir怎么用?Python makedir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了makedir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_trigger_timeseries

def make_trigger_timeseries(workflow,
                            singles,
                            ifo_times,
                            out_dir,
                            special_tids,
                            exclude=None,
                            require=None,
                            tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    name = 'plot_trigger_timeseries'
    secs = requirestr(workflow.cp.get_subsections(name), require)
    secs = excludestr(secs, exclude)
    files = FileList([])
    for tag in secs:
        node = PlotExecutable(
            workflow.cp,
            name,
            ifos=workflow.ifos,
            out_dir=out_dir,
            tags=[tag] + tags).create_node()
        node.add_multiifo_input_list_opt('--single-trigger-files', singles)
        node.add_opt('--times', ifo_times)
        node.new_output_file_opt(workflow.analysis_time, '.png',
                                 '--output-file')

        if special_tids is not None:
            node.add_opt('--special-trigger-ids', special_tids)

        workflow += node
        files += node.output_files
    return files
开发者ID:bcheeseboro,项目名称:pycbc,代码行数:32,代码来源:minifollowups.py

示例2: make_coinc_info

def make_coinc_info(workflow,
                    singles,
                    bank,
                    coinc,
                    num,
                    out_dir,
                    exclude=None,
                    require=None,
                    tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    name = 'page_coincinfo'
    secs = requirestr(workflow.cp.get_subsections(name), require)
    secs = excludestr(secs, exclude)
    files = FileList([])
    node = PlotExecutable(
        workflow.cp, name, ifos=workflow.ifos, out_dir=out_dir,
        tags=tags).create_node()
    node.add_input_list_opt('--single-trigger-files', singles)
    node.add_input_opt('--statmap-file', coinc)
    node.add_input_opt('--bank-file', bank)
    node.add_opt('--n-loudest', str(num))
    node.new_output_file_opt(workflow.analysis_time, '.html', '--output-file')
    workflow += node
    files += node.output_files
    return files
开发者ID:bcheeseboro,项目名称:pycbc,代码行数:26,代码来源:minifollowups.py

示例3: make_snrifar_plot

def make_snrifar_plot(workflow, bg_file, out_dir, tags=[]):
    makedir(out_dir)
    node = PlotExecutable(workflow.cp, 'plot_snrifar', ifos=workflow.ifos,
                out_dir=out_dir, tags=tags).create_node()
    node.add_input_opt('--trigger-file', bg_file)
    node.new_output_file_opt(bg_file.segment, '.png', '--output-file')
    workflow += node
开发者ID:shasvath,项目名称:pycbc,代码行数:7,代码来源:plotting.py

示例4: make_throughput_plot

def make_throughput_plot(workflow, insp_files, out_dir, tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    node = PlotExecutable(workflow.cp, "plot_throughput", ifos=workflow.ifos, out_dir=out_dir, tags=tags).create_node()
    node.add_input_list_opt("--input-file", insp_files)
    node.new_output_file_opt(workflow.analysis_time, ".png", "--output-file")
    workflow += node
开发者ID:sfairhur,项目名称:pycbc,代码行数:7,代码来源:plotting.py

示例5: make_inference_samples_plot

def make_inference_samples_plot(
                    workflow, inference_file, output_dir, parameters=None,
                    name="inference_samples", analysis_seg=None, tags=None):
    # default values
    tags = [] if tags is None else tags
    analysis_seg = workflow.analysis_time \
                       if analysis_seg is None else analysis_seg

    # make the directory that will contain the output files
    makedir(output_dir)

    # make a node for plotting the posterior as a corner plot
    node = PlotExecutable(workflow.cp, name, ifos=workflow.ifos,
                      out_dir=output_dir, universe="local",
                      tags=tags).create_node()

    # add command line options
    node.add_input_opt("--input-file", inference_file)
    node.new_output_file_opt(analysis_seg, ".png", "--output-file")
    node.add_opt("--parameters", " ".join(parameters))

    # add node to workflow
    workflow += node

    return node.output_files
开发者ID:cmbiwer,项目名称:pycbc,代码行数:25,代码来源:inference_followups.py

示例6: render_workflow_html_template

def render_workflow_html_template(filename, subtemplate, filelists, **kwargs):
    """ Writes a template given inputs from the workflow generator. Takes
    a list of tuples. Each tuple is a pycbc File object. Also the name of the
    subtemplate to render and the filename of the output.
    """

    dirnam = os.path.dirname(filename)
    makedir(dirnam)

    try:
        filenames = [f.name for filelist in filelists for f in filelist if f is not None]
    except TypeError:
        filenames = []

    # render subtemplate
    subtemplate_dir = pycbc.results.__path__[0] + '/templates/wells'
    env = Environment(loader=FileSystemLoader(subtemplate_dir))
    env.globals.update(get_embedded_config=get_embedded_config)
    env.globals.update(path_exists=os.path.exists)
    env.globals.update(len=len)
    subtemplate = env.get_template(subtemplate)
    context = {'filelists' : filelists,
               'dir' : dirnam}
    context.update(kwargs)
    output = subtemplate.render(context)

    # save as html page
    kwds = {'render-function' : 'render_tmplt',
            'filenames' : ','.join(filenames)}
    save_html_with_metadata(str(output), filename, None, kwds)
开发者ID:a-r-williamson,项目名称:pycbc,代码行数:30,代码来源:render.py

示例7: make_inj_table

def make_inj_table(workflow, inj_file, out_dir, tags=[]):
    makedir(out_dir)
    node = PlotExecutable(workflow.cp, 'page_injections', ifos=workflow.ifos,
                    out_dir=out_dir, tags=tags).create_node()
    node.add_input_opt('--injection-file', inj_file)
    node.new_output_file_opt(inj_file.segment, '.html', '--output-file')
    workflow += node   
开发者ID:cmessick,项目名称:pycbc,代码行数:7,代码来源:plotting.py

示例8: make_singles_plot

def make_singles_plot(workflow, trig_files, bank_file, veto_file, veto_name,
                     out_dir, exclude=None, require=None, tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    secs = requirestr(workflow.cp.get_subsections('plot_singles'), require)
    secs = excludestr(secs, exclude)
    files = FileList([])
    for tag in secs:
        for trig_file in trig_files:
            node = PlotExecutable(workflow.cp, 'plot_singles',
                        ifos=trig_file.ifo,
                        out_dir=out_dir,
                        tags=[tag] + tags).create_node()

            node.set_memory(15000)
            node.add_input_opt('--bank-file', bank_file)
            if veto_file is not None:
                node.add_input_opt('--veto-file', veto_file)
                node.add_opt('--segment-name', veto_name)
            node.add_opt('--detector', trig_file.ifo)
            node.add_input_opt('--single-trig-file', trig_file)
            node.new_output_file_opt(trig_file.segment, '.png', '--output-file')
            workflow += node
            files += node.output_files
    return files
开发者ID:bhooshan-gadre,项目名称:pycbc,代码行数:25,代码来源:plotting.py

示例9: make_foreground_table

def make_foreground_table(workflow, trig_file, bank_file, ftag, out_dir,
                          singles=None, extension='.html', tags=None,
                          hierarchical_level=None):

    if hierarchical_level is not None and tags:
        tags = [("HIERARCHICAL_LEVEL_{:02d}".format(
                hierarchical_level))] + tags
    elif hierarchical_level is not None and not tags:
        tags = ["HIERARCHICAL_LEVEL_{:02d}".format(hierarchical_level)]
    elif hierarchical_level is None and not tags:
        tags = []

    makedir(out_dir)
    node = PlotExecutable(workflow.cp, 'page_foreground', ifos=workflow.ifos,
                    out_dir=out_dir, tags=tags).create_node()
    node.add_input_opt('--bank-file', bank_file)
    node.add_opt('--foreground-tag', ftag)
    node.add_input_opt('--trigger-file', trig_file)
    if hierarchical_level is not None:
        node.add_opt('--use-hierarchical-level', hierarchical_level)
    if singles is not None:
        node.add_input_list_opt('--single-detector-triggers', singles)
    node.new_output_file_opt(bank_file.segment, extension, '--output-file')
    workflow += node
    return node.output_files[0]
开发者ID:a-r-williamson,项目名称:pycbc,代码行数:25,代码来源:plotting.py

示例10: make_plot_waveform_plot

def make_plot_waveform_plot(workflow, params, out_dir, ifos, exclude=None, require=None, tags=None):
    """ Add plot_waveform jobs to the workflow.
    """
    tags = [] if tags is None else tags
    makedir(out_dir)
    name = "single_template_plot"
    secs = requirestr(workflow.cp.get_subsections(name), require)
    secs = excludestr(secs, exclude)
    files = FileList([])
    for tag in secs:
        node = PlotExecutable(workflow.cp, "plot_waveform", ifos=ifos, out_dir=out_dir, tags=[tag] + tags).create_node()
        node.add_opt("--mass1", "%.6f" % params["mass1"])
        node.add_opt("--mass2", "%.6f" % params["mass2"])
        node.add_opt("--spin1z", "%.6f" % params["spin1z"])
        node.add_opt("--spin2z", "%.6f" % params["spin2z"])
        if params.has_key("u_vals"):
            # Precessing options
            node.add_opt("--spin1x", "%.6f" % params["spin1x"])
            node.add_opt("--spin2x", "%.6f" % params["spin2x"])
            node.add_opt("--spin1y", "%.6f" % params["spin1y"])
            node.add_opt("--spin2y", "%.6f" % params["spin2y"])
            node.add_opt("--inclination", "%.6f" % params["inclination"])
            node.add_opt("--u-val", "%.6f" % params["u_vals"])
        node.new_output_file_opt(workflow.analysis_time, ".png", "--output-file")
        workflow += node
        files += node.output_files
    return files
开发者ID:prayush,项目名称:pycbc,代码行数:27,代码来源:minifollowups.py

示例11: make_single_template_plots

def make_single_template_plots(workflow, segs, seg_name, coinc, bank, num, out_dir, 
                               exclude=None, require=None, tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    name = 'single_template_plot'
    secs = requirestr(workflow.cp.get_subsections(name), require)  
    secs = excludestr(secs, exclude)
    files = FileList([])
    for tag in secs:
        for ifo in workflow.ifos:
            # Reanalyze the time around the trigger in each detector
            node = PlotExecutable(workflow.cp, 'single_template', ifos=[ifo],
                                 out_dir=out_dir, tags=[tag] + tags).create_node()
            node.add_input_opt('--statmap-file', coinc)
            node.add_opt('--n-loudest', str(num))
            node.add_input_opt('--inspiral-segments', segs[ifo])
            node.add_opt('--segment-name', seg_name)
            node.add_input_opt('--bank-file', bank)
            node.new_output_file_opt(workflow.analysis_time, '.hdf', '--output-file')
            data = node.output_files[0]
            workflow += node
            
            # Make the plot for this trigger and detector
            node = PlotExecutable(workflow.cp, name, ifos=[ifo],
                                  out_dir=out_dir, tags=[tag] + tags).create_node()
            node.add_input_opt('--single-template-file', data)
            node.new_output_file_opt(workflow.analysis_time, '.png', '--output-file')
            workflow += node
            files += node.output_files
    return files      
开发者ID:vaibhavtewari,项目名称:pycbc,代码行数:30,代码来源:minifollowups.py

示例12: make_snrifar_plot

def make_snrifar_plot(workflow, bg_file, out_dir, closed_box=False,
                     cumulative=True, tags=None, hierarchical_level=None):

    if hierarchical_level is not None and tags:
        tags = [("HIERARCHICAL_LEVEL_{:02d}".format(
                hierarchical_level))] + tags
    elif hierarchical_level is not None and not tags:
        tags = ["HIERARCHICAL_LEVEL_{:02d}".format(hierarchical_level)]
    elif hierarchical_level is None and not tags:
        tags = []

    makedir(out_dir)
    node = PlotExecutable(workflow.cp, 'plot_snrifar', ifos=workflow.ifos,
                out_dir=out_dir, tags=tags).create_node()
    node.add_input_opt('--trigger-file', bg_file)
    if hierarchical_level is not None:
        node.add_opt('--use-hierarchical-level', hierarchical_level)

    if closed_box:
        node.add_opt('--closed-box')

    if not cumulative:
        node.add_opt('--not-cumulative')

    node.new_output_file_opt(bg_file.segment, '.png', '--output-file')
    workflow += node
    return node.output_files[0]
开发者ID:bhooshan-gadre,项目名称:pycbc,代码行数:27,代码来源:plotting.py

示例13: make_plot_waveform_plot

def make_plot_waveform_plot(workflow, params, out_dir, ifos, exclude=None,
                            require=None, tags=None):
    """ Add plot_waveform jobs to the workflow.
    """
    tags = [] if tags is None else tags
    makedir(out_dir)
    name = 'single_template_plot'
    secs = requirestr(workflow.cp.get_subsections(name), require)
    secs = excludestr(secs, exclude)
    files = FileList([])
    for tag in secs:
        node = PlotExecutable(workflow.cp, 'plot_waveform', ifos=ifos,
                              out_dir=out_dir, tags=[tag] + tags).create_node()
        node.add_opt('--mass1', "%.6f" % params['mass1'])
        node.add_opt('--mass2', "%.6f" % params['mass2'])
        node.add_opt('--spin1z',"%.6f" % params['spin1z'])
        node.add_opt('--spin2z',"%.6f" % params['spin2z'])
        if params.has_key('u_vals'):
            # Precessing options
            node.add_opt('--spin1x',"%.6f" % params['spin1x'])
            node.add_opt('--spin2x',"%.6f" % params['spin2x'])
            node.add_opt('--spin1y',"%.6f" % params['spin1y'])
            node.add_opt('--spin2y',"%.6f" % params['spin2y'])
            node.add_opt('--inclination',"%.6f" % params['inclination'])
            node.add_opt('--u-val', "%.6f" % params['u_vals'])
        node.new_output_file_opt(workflow.analysis_time, '.png',
                                     '--output-file')
        workflow += node
        files += node.output_files
    return files
开发者ID:andrew-lundgren,项目名称:pycbc,代码行数:30,代码来源:minifollowups.py

示例14: make_segments_plot

def make_segments_plot(workflow, seg_files, out_dir, tags=[]):
    makedir(out_dir)
    node = PlotExecutable(workflow.cp, 'plot_segments', ifos=workflow.ifos,
                         out_dir=out_dir, tags=tags).create_node()
    node.add_input_list_opt('--segment-files', seg_files)
    node.new_output_file_opt(workflow.analysis_time, '.html', '--output-file')
    workflow += node
开发者ID:cmessick,项目名称:pycbc,代码行数:7,代码来源:plotting.py

示例15: make_segments_plot

def make_segments_plot(workflow, seg_files, out_dir, tags=None):
    tags = [] if tags is None else tags
    makedir(out_dir)
    node = PlotExecutable(workflow.cp, "plot_segments", ifos=workflow.ifos, out_dir=out_dir, tags=tags).create_node()
    node.add_input_list_opt("--segment-files", seg_files)
    node.new_output_file_opt(workflow.analysis_time, ".html", "--output-file")
    workflow += node
开发者ID:sfairhur,项目名称:pycbc,代码行数:7,代码来源:plotting.py


注:本文中的pycbc.workflow.core.makedir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。