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


Python Node.add_input_opt方法代码示例

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


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

示例1: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
 def create_node(self, trig_files, bank_file):
     node = Node(self)
     node.add_input_opt('--bank-file', bank_file)
     node.add_input_list_opt('--trigger-files', trig_files)
     node.new_output_file_opt(trig_files[0].segment, '.hdf',
                              '--output-file', use_tmp_subdirs=True)
     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_opt [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

示例3: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
 def create_node(self, inj_coinc_file, inj_xml_file, veto_file, veto_name, tags=[]):
     node = Node(self)        
     node.add_input_list_opt('--trigger-file', inj_coinc_file)
     node.add_input_list_opt('--injection-file', inj_xml_file)
     if veto_name is not None:
         node.add_input_opt('--veto-file', veto_file)
     node.add_opt('--segment-name', veto_name)
     node.new_output_file_opt(inj_xml_file[0].segment, '.hdf', '--output-file', 
                              tags=tags)
     return node
开发者ID:alex-nielsen,项目名称:pycbc,代码行数:12,代码来源:coincidence.py

示例4: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
 def create_node(self, trig_file, bank_file, veto_file, veto_name):
     node = Node(self)
     # Executable objects are initialized with ifo information
     node.add_opt('--ifo', self.ifo_string)
     node.add_input_opt('--trigger-file', trig_file)
     node.add_input_opt('--bank-file', bank_file)
     node.add_input_opt('--veto-file', veto_file)
     node.add_opt('--veto-segment-name', veto_name)
     node.new_output_file_opt(trig_file.segment, '.hdf', '--output')
     return node
开发者ID:josh-willis,项目名称:pycbc,代码行数:12,代码来源:coincidence.py

示例5: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
    def create_node(self, bank):
        """
        Set up a CondorDagmanNode class to run lalapps_splitbank code

        Parameters
        ----------
        bank : pycbc.workflow.core.File 
            The OutFile containing the template bank to be split

        Returns
        --------
        node : pycbc.workflow.core.Node
            The node to run the job
        """
        node = Node(self)
        # FIXME: This is a hack because SplitBank fails if given an input file
        # whose path contains the character '-' or if the input file is not in
        # the same directory as the output. Therefore we just set the path to
        # be the local path
        fullPath = bank.cache_entry.path
        bank.cache_entry.path = os.path.basename(fullPath)
        node.add_input_opt('--bank-file', bank)
        # FIXME: Set the path back to what it was. This is part of the hack
        #        above and should be removed if possible.
        bank.cache_entry.path = fullPath

        # Get the output (taken from inspiral.py)
        url_list = []
        x = bank.filename.split('-')
        if len(x) != 4:
            errMsg = "Input file name is not compatible with splitbank. Name "
            errMsg += "must follow the lal cache standard, for example "
            errMsg += "H1-TMPLTBANK-900000000-1000.xml. "
            errMsg += "Got %s." % (bank.filename, )
            raise ValueError(errMsg)
        for i in range(0, self.num_banks):
            out_file = "%s-%s_%2.2d-%s-%s" % (x[0], x[1], i, x[2], x[3])
            out_url = urlparse.urlunparse([
                'file', 'localhost',
                os.path.join(self.out_dir, out_file), None, None, None
            ])
            url_list.append(out_url)

            job_tag = bank.description + "_" + self.name.upper()
            out_file = File(
                bank.ifo,
                job_tag,
                bank.segment,
                file_url=out_url,
                tags=bank.tags,
                store_file=self.retain_files)
            node._add_output(out_file)
        return node
开发者ID:shinsei90,项目名称:pycbc,代码行数:55,代码来源:legacy_ihope.py

示例6: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
    def create_node(self, segment, coinc_file, tmpltbank_file, data_type, loudest_event_number):
        ''' Creates a node for the loudest_event_number-th loudest event in the
        coinc_file. '''

        # make a node
        node = Node(self)

        # add input files
        node.add_input_opt('--coinc-file', coinc_file)
        node.add_input_opt('--tmpltbank-file', tmpltbank_file)

        # add options
        node.add_opt('--data-type', data_type)
        node.add_opt('--loudest-event-number', loudest_event_number)

        # add output file
        node.new_output_file_opt(segment, '.html', '--output-file',
                                 store_file=self.retain_files)

        return node
开发者ID:alex-nielsen,项目名称:pycbc,代码行数:22,代码来源:minifollowups.py

示例7: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [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

示例8: create_node

# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_input_opt [as 别名]
 def create_node(self, raw_fit_file, bank_file):
     node = Node(self)
     node.add_input_opt('--template-fit-file', raw_fit_file)
     node.add_input_opt('--template-file', bank_file)
     node.new_output_file_opt(raw_fit_file.segment, '.hdf', '--output')
     return node
开发者ID:sfairhur,项目名称:pycbc,代码行数:8,代码来源:coincidence.py


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