本文整理汇总了Python中pycbc.workflow.core.Node.new_output_file_opt方法的典型用法代码示例。如果您正苦于以下问题:Python Node.new_output_file_opt方法的具体用法?Python Node.new_output_file_opt怎么用?Python Node.new_output_file_opt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycbc.workflow.core.Node
的用法示例。
在下文中一共展示了Node.new_output_file_opt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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
示例2: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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
示例3: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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
示例4: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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('--template-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
示例5: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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
示例6: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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
示例7: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import new_output_file_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