本文整理汇总了Python中pycbc.workflow.core.Node.add_profile方法的典型用法代码示例。如果您正苦于以下问题:Python Node.add_profile方法的具体用法?Python Node.add_profile怎么用?Python Node.add_profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycbc.workflow.core.Node
的用法示例。
在下文中一共展示了Node.add_profile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_profile [as 别名]
def create_node(self, parent=None, c_file=None, open_box=False,
seg_plot=None, tuning_tags=None, exclusion_tags=None,
html_dir=None, tags=[]):
node = Node(self)
node.add_opt('--grb-name', self.cp.get('workflow', 'trigger-name'))
node.add_opt('--start-time', self.cp.get('workflow', 'trigger-time'))
node.add_opt('--ra', self.cp.get('workflow', 'ra'))
node.add_opt('--dec', self.cp.get('workflow', 'dec'))
node.add_opt('--ifo-tag', self.ifos)
if tuning_tags is not None:
node.add_opt('--tuning-injections', ','.join(tuning_tags))
if exclusion_tags is not None:
node.add_opt('--exclusion-injections', ','.join(exclusion_tags))
if seg_plot is not None:
node.add_opt('--seg-plot', seg_plot.storage_path)
if open_box:
node.add_opt('--open-box')
if html_dir is not None:
node.add_opt('--html-path', html_dir)
# Set input / output options
node.add_opt('--config-file', '%s' % c_file.storage_path)
node.add_opt('--output-path', "%s/output" % self.out_dir)
node.add_profile('condor', 'request_cpus', self.num_threads)
return node
示例2: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_profile [as 别名]
def create_node(self, parent, tags=None):
import Pegasus.DAX3 as dax
if tags is None:
tags = []
node = Node(self)
# Set input / output options
node.add_opt('--trig-file', '%s' % parent.storage_path)
#node._dax_node.uses(parent, link=dax.Link.INPUT, register=False,
# transfer=False)
#node._inputs += [parent]
node.add_opt('--output-dir', self.out_dir)
node.add_profile('condor', 'request_cpus', self.num_threads)
# Adding output files as pycbc.workflow.core.File objects
out_file = File(self.ifos, 'INSPIRAL', parent.segment,
directory=self.out_dir, extension='xml.gz',
tags=[parent.tag_str, 'CLUSTERED'],
store_file=self.retain_files)
out_file.PFN(out_file.cache_entry.path, site="local")
#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)
return node, FileList([out_file])
示例3: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_profile [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
示例4: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_profile [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
示例5: create_node
# 需要导入模块: from pycbc.workflow.core import Node [as 别名]
# 或者: from pycbc.workflow.core.Node import add_profile [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 add_profile [as 别名]
def create_node(
self,
parent=None,
c_file=None,
open_box=False,
seg_plot=None,
tuning_tags=None,
exclusion_tags=None,
html_dir=None,
tags=[],
):
node = Node(self)
node.add_opt("--grb-name", self.cp.get("workflow", "trigger-name"))
node.add_opt("--start-time", self.cp.get("workflow", "trigger-time"))
node.add_opt("--ra", self.cp.get("workflow", "ra"))
node.add_opt("--dec", self.cp.get("workflow", "dec"))
node.add_opt("--ifo-tag", self.ifos)
if tuning_tags is not None:
node.add_opt("--tuning-injections", ",".join(tuning_tags))
if exclusion_tags is not None:
node.add_opt("--exclusion-injections", ",".join(exclusion_tags))
if seg_plot is not None:
node.add_opt("--seg-plot", seg_plot.storage_path)
if open_box:
node.add_opt("--open-box")
if html_dir is not None:
node.add_opt("--html-path", html_dir)
# Set input / output options
node.add_opt("--config-file", "%s" % c_file.storage_path)
node.add_opt("--output-path", "%s/output" % self.out_dir)
node.add_profile("condor", "request_cpus", self.num_threads)
return node