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


Python Node.add_input_list_opt方法代码示例

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


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

示例1: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
 def create_node(self, stat_files, tags=None):
     if tags is None:
         tags = []
     node = Node(self)
     node.add_input_list_opt('--statmap-files', stat_files)
     node.new_output_file_opt(stat_files[0].segment, '.hdf', '--output-file', tags=tags)
     return node
开发者ID:aravind-pazhayath,项目名称:pycbc,代码行数:9,代码来源:coincidence.py

示例2: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
    def create_node(self, trig_files, inj_files, seg_dir, tags=[]):
        node = Node(self)

        # Set input / output options
        node.add_input_list_opt('--input-files', trig_files)
        node.add_input_list_opt('--inj-files', inj_files)

        node.add_opt('--ifo-tag', self.ifos)
        node.add_opt('--exclude-segments', '%s/bufferSeg.txt' % seg_dir)
        node.add_opt('--output-dir', self.out_dir)

        # Create output files as File objects
        name_string = inj_files[0].description
        seg = trig_files[0].segment

        f_file = File(
            self.ifos,
            name_string,
            seg,
            extension="xml",
            directory=self.out_dir,
            store_file=self.retain_files,
            tags=[inj_files[0].tag_str.replace("split0", "FOUND")])

        m_file = File(
            self.ifos,
            name_string,
            seg,
            extension="xml",
            directory=self.out_dir,
            store_file=self.retain_files,
            tags=[inj_files[0].tag_str.replace("split0", "MISSED")])

        return node, FileList([f_file, m_file])
开发者ID:shinsei90,项目名称:pycbc,代码行数:36,代码来源:legacy_ihope.py

示例3: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
    def create_node(self, coinc_files, tags=[]):
        segs = coinc_files.get_times_covered_by_files()
        seg = segments.segment(segs[0][0], segs[-1][1])

        node = Node(self)
        node.set_memory(5000)
        node.add_input_list_opt('--coinc-files', coinc_files)
        node.new_output_file_opt(seg, '.hdf', '--output-file', tags=tags)
        return node
开发者ID:alex-nielsen,项目名称:pycbc,代码行数:11,代码来源:coincidence.py

示例4: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
    def create_node(self, trig_files=None, segment_dir=None, out_tags=[],
                    tags=[]):
        node = Node(self)

        if not trig_files:
            raise ValueError("%s must be supplied with trigger files"
                              % self.name)

        # Data options
        pad_data = self.cp.get('inspiral', 'pad-data')
        if pad_data is None:
            raise ValueError("The option pad-data is a required option of "
                             "%s. Please check the ini file." % self.name)

        num_trials = int(self.cp.get("trig_combiner", "num-trials"))
        trig_name = self.cp.get('workflow', 'trigger-name')
        if all("COHERENT_NO_INJECTIONS" in t.name for t in trig_files) and \
                self.cp.has_option_tag('inspiral', 'do-short-slides',
                                       'coherent_no_injections'):
            node.add_opt('--short-slides')
        
        node.add_opt('--grb-name', trig_name)
        
        node.add_opt('--pad-data', pad_data)
        node.add_opt('--segment-length', self.cp.get('inspiral',
                                                     'segment-duration'))
        node.add_opt('--ifo-tag', self.ifos)
        node.add_opt('--user-tag', 'INSPIRAL')

        # Set input / output options
        node.add_input_list_opt('--input-files', trig_files)

        node.add_opt('--segment-dir', segment_dir)
        node.add_opt('--output-dir', self.out_dir)

        out_files = FileList([])
        for out_tag in out_tags:
            out_file = File(self.ifos, 'INSPIRAL', trig_files[0].segment,
                            directory=self.out_dir, extension='xml.gz',
                            tags=["GRB%s" % trig_name, out_tag],
                            store_file=self.retain_files)
            out_files.append(out_file)

        for trial in range(1, num_trials + 1):
            out_file = File(self.ifos, 'INSPIRAL', trig_files[0].segment,
                            directory=self.out_dir, extension='xml.gz',
                            tags=["GRB%s" % trig_name, "OFFTRIAL_%d" % trial],
                            store_file=self.retain_files)
            out_files.append(out_file)

        node.add_profile('condor', 'request_cpus', self.num_threads)

        return node, out_files
开发者ID:juancalderonbustillo,项目名称:pycbc,代码行数:55,代码来源:legacy_ihope.py

示例5: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
 def create_node(self, trig_files, bank_file, stat_files, veto_file,
                 veto_name, template_str, pivot_ifo, fixed_ifo, tags=None):
     if tags is None:
         tags = []
     segs = trig_files.get_times_covered_by_files()
     seg = segments.segment(segs[0][0], segs[-1][1])
     node = Node(self)
     node.add_input_opt('--template-bank', bank_file)
     node.add_input_list_opt('--trigger-files', trig_files)
     if len(stat_files) > 0:
         node.add_input_list_opt('--statistic-files', stat_files)
     if veto_file is not None:
         node.add_input_opt('--veto-files', veto_file)
         node.add_opt('--segment-name', veto_name)
     node.add_opt('--pivot-ifo', pivot_ifo)
     node.add_opt('--fixed-ifo', fixed_ifo)
     node.add_opt('--template-fraction-range', template_str)
     node.new_output_file_opt(seg, '.hdf', '--output-file', tags=tags)
     return node
开发者ID:josh-willis,项目名称:pycbc,代码行数:21,代码来源:coincidence.py

示例6: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_list_opt [as 别名]
    def create_node(self, trig_files=None, segment_dir=None, analysis_seg=None,
                    slide_tag=None, out_tags=None, tags=None):
        import Pegasus.DAX3 as dax
        if out_tags is None:
            out_tags = []
        if tags is None:
            tags = []
        node = Node(self)

        if not trig_files:
            raise ValueError("%s must be supplied with trigger files"
                              % self.name)

        # Data options
        num_trials = int(self.cp.get("trig_combiner", "num-trials"))
        trig_name = self.cp.get('workflow', 'trigger-name')
        if all("COHERENT_NO_INJECTIONS" in t.name for t in trig_files) and \
                self.cp.has_option_tag('inspiral', 'do-short-slides',
                                       'coherent_no_injections'):
            node.add_opt('--short-slides')
        
        node.add_opt('--grb-name', trig_name)
        
        node.add_opt('--trig-start-time', analysis_seg[0])
        node.add_opt('--ifo-tag', self.ifos)
        node.add_opt('--user-tag', 'INSPIRAL')
        if tags:
            node.add_opt('--job-tag', '_'.join(tags))

        if slide_tag is not None:
            node.add_opt('--slide-tag', slide_tag)
            node.add_opt('--long-slides')
            tag_start=["TIMESLIDES_GRB%s_%s" % (trig_name, slide_tag)]+tags
        else:
            tag_start=["GRB%s" % trig_name]+tags

        # Set input / output options
        if all(hasattr(t.node, "executable") for t in trig_files):
            if all(t.node.executable.name == "trig_cluster"
                   for t in trig_files):
                node.add_opt('--input-files',
                             " ".join([t.storage_path for t in trig_files]))
                if self.cp.has_option_tag('inspiral', 'do-short-slides',
                                          'coherent_no_injections'):
                    node.add_opt('--short-slides')
            else:
                node.add_input_list_opt('--input-files', trig_files)
        else:
            node.add_opt('--input-files',
                         " ".join([t.storage_path for t in trig_files]))

        node.add_opt('--segment-dir', segment_dir)
        node.add_opt('--output-dir', self.out_dir)

        out_files = FileList([])
        for out_tag in out_tags:
            out_file = File(self.ifos, 'INSPIRAL', trig_files[0].segment,
                            directory=self.out_dir, extension='xml.gz',
                            tags=tag_start+[out_tag],
                            store_file=self.retain_files)
            out_files.append(out_file)
            #node._dax_node.uses(out_file, link=dax.Link.OUTPUT, register=False,
            #                    transfer=False)
            #node._outputs += [out_file]
            #out_file.node = node
            #node._add_output(out_file)

        for trial in range(1, num_trials + 1):
            out_file = File(self.ifos, 'INSPIRAL', trig_files[0].segment,
                            directory=self.out_dir, extension='xml.gz',
                            tags=tag_start+["OFFTRIAL_%d" % trial],
                            store_file=self.retain_files)
            out_files.append(out_file)
            #node._dax_node.uses(out_file, link=dax.Link.OUTPUT, register=False,
            #                    transfer=False)
            #node._outputs += [out_file]
            #out_file.node = node
            #node._add_output(out_file)

        node.add_profile('condor', 'request_cpus', self.num_threads)

        return node, out_files
开发者ID:ligo-cbc,项目名称:pycbc-pylal,代码行数:84,代码来源:legacy_ihope.py


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