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


Python Analyzer.create_distance_probability方法代码示例

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


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

示例1: atom_nodes_init

# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import create_distance_probability [as 别名]
from Spectroscopy import Spectroscopy#For Testing 
from init_relationships import relationships_init
from nodify import atom_nodes_init #For Testing
from Analyzer import Analyzer#For Testing
import sys #For Testing
import os #For Testing
import re #For Testing


xyz_file = sys.argv[1]
spectra_folder = sys.argv[2]	

#Init the nodes and relationships, like distances, dihedrals, etc.
graph = atom_nodes_init(xyz_file)
relationships_init(graph)

#Add the spectra to the graph
spectra_files = os.listdir(spectra_folder)
for spectrum in spectra_files:
	#spec_num = re.sub(r'(.*?)-.*', r'\1', spectrum)
	spec_num = int(re.sub(r'.*?([0-9]*)-.*', r'\1', spectrum))
	spec = Spectroscopy(spectra_folder + "/" + spectrum)
	graph.add_spectrum(spec_num, spec)
	
#Create the histogram
analyzer = Analyzer(graph)
histogram = analyzer.create_distance_probability("Distance S - S", .5, 0, 10)
#print graph
print histogram

开发者ID:arunjandaur,项目名称:xas_analysis,代码行数:31,代码来源:testing.py


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