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


Python Node.add_arg方法代码示例

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


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

示例1: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_arg [as 别名]
    def create_node(self, data_seg, valid_seg, parent=None, inj_file=None,
                    dfParents=None, bankVetoBank=None, ipn_file=None, tags=[]):
        node = Node(self)

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

        # If doing single IFO search, make sure slides are disabled
        if len(self.ifo_list) < 2 and \
                ('--do-short-slides' in node._options or \
                 '--short-slide-offset' in node._options):
            raise ValueError("Cannot run with time slides in a single IFO "
                             "configuration! Please edit your configuration "
                             "file accordingly.")

        pad_data = self.get_opt('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)

        # Feed in bank_veto_bank.xml
        if self.cp.has_option('inspiral', 'do-bank-veto'):
            if not bankVetoBank:
                raise ValueError("%s must be given a bank veto file if the "
                                 "argument 'do-bank-veto' is given"
                                 % self.name)
            node.add_input_opt('--bank-veto-templates', bankVetoBank)

        # Set time options
        node.add_opt('--gps-start-time', data_seg[0] + int(pad_data))
        node.add_opt('--gps-end-time', data_seg[1] - int(pad_data))
        node.add_opt('--trig-start-time', valid_seg[0])
        node.add_opt('--trig-end-time', valid_seg[1])

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

        # Set the input and output files
        node.new_output_file_opt(data_seg, '.xml.gz', '--output-file',
                                 tags=tags, store_file=self.retain_files)
        node.add_input_opt('--non-spin-bank', parent, )

        for frameCache in dfParents:
            node.add_input_opt('--%s-frame-cache' % frameCache.ifo.lower(),
                               frameCache)
            node.add_arg('--%s-data' % frameCache.ifo.lower())

        if ipn_file is not None:
            node.add_input_opt('--sky-positions-file', ipn_file)

        if inj_file is not None:
            if ('--do-short-slides' in node._options or \
                    '--short-slide-offset' in node._options):
                raise ValueError("Cannot run with short slides in an "
                                 "injection job. Please edit your "
                                 "configuration file accordingly.")
            node.add_input_opt('--injection-file', inj_file)

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

示例2: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_arg [as 别名]
    def create_node(self, data_seg, valid_seg, parent=None, inj_file=None,
                    dfParents=None, bankVetoBank=None, tags=[]):
        node = Node(self)

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

        pad_data = self.get_opt('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)
        
        # Feed in bank_veto_bank.xml
        if self.cp.has_option('inspiral', 'do-bank-veto'):
            if not bankVetoBank:
                raise ValueError("%s must be given a bank veto file if the"
                                 "argument 'do-bank-veto' is given"
                                 % self.name)
            node.add_input_opt('--bank-veto-templates', bankVetoBank)
        
        node.add_opt('--gps-start-time', data_seg[0] + int(pad_data))
        node.add_opt('--gps-end-time', data_seg[1] - int(pad_data))
        node.add_opt('--trig-start-time', valid_seg[0])
        node.add_opt('--trig-end-time', valid_seg[1])

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

        # Set the input and output files
        node.new_output_file_opt(data_seg, '.xml.gz', '--output-file',
                                 tags=tags, store_file=self.retain_files)
        node.add_input_opt('--non-spin-bank', parent, )

        for frameCache in dfParents:
            node.add_input_opt('--%s-frame-cache' % frameCache.ifo.lower(),
                               frameCache)
            node.add_arg('--%s-data' % frameCache.ifo.lower())
            node.add_opt('--%s-channel-name' % frameCache.ifo.lower(),
                         self.cp.get('workflow',
                                     '%s-channel-name' %frameCache.ifo.lower()))

        if inj_file is not None:
            node.add_input_opt('--injection-file', inj_file)

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


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