本文整理汇总了Python中pycbc.workflow.plotting.PlotExecutable.create_node方法的典型用法代码示例。如果您正苦于以下问题:Python PlotExecutable.create_node方法的具体用法?Python PlotExecutable.create_node怎么用?Python PlotExecutable.create_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycbc.workflow.plotting.PlotExecutable
的用法示例。
在下文中一共展示了PlotExecutable.create_node方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_inference_inj_plots
# 需要导入模块: from pycbc.workflow.plotting import PlotExecutable [as 别名]
# 或者: from pycbc.workflow.plotting.PlotExecutable import create_node [as 别名]
def make_inference_inj_plots(workflow, inference_files, output_dir,
parameters, name="inference_recovery",
analysis_seg=None, tags=None):
""" Sets up the recovered versus injected parameter plot in the workflow.
Parameters
----------
workflow: pycbc.workflow.Workflow
The core workflow instance we are populating
inference_files: pycbc.workflow.FileList
The files with posterior samples.
output_dir: str
The directory to store result plots and files.
parameters : list
A ``list`` of parameters. Each parameter gets its own plot.
name: str
The name in the [executables] section of the configuration file
to use.
analysis_segs: {None, ligo.segments.Segment}
The segment this job encompasses. If None then use the total analysis
time from the workflow.
tags: {None, optional}
Tags to add to the inference executables.
Returns
-------
pycbc.workflow.FileList
A list of result and output files.
"""
# default values
tags = [] if tags is None else tags
analysis_seg = workflow.analysis_time \
if analysis_seg is None else analysis_seg
output_files = FileList([])
# make the directory that will contain the output files
makedir(output_dir)
# add command line options
for (ii, param) in enumerate(parameters):
plot_exe = PlotExecutable(workflow.cp, name, ifos=workflow.ifos,
out_dir=output_dir,
tags=tags+['param{}'.format(ii)])
node = plot_exe.create_node()
node.add_input_list_opt("--input-file", inference_files)
node.new_output_file_opt(analysis_seg, ".png", "--output-file")
node.add_opt("--parameters", param)
workflow += node
output_files += node.output_files
return output_files