本文整理汇总了Python中diffpy.pdffit2.PdfFit.save_pdf方法的典型用法代码示例。如果您正苦于以下问题:Python PdfFit.save_pdf方法的具体用法?Python PdfFit.save_pdf怎么用?Python PdfFit.save_pdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类diffpy.pdffit2.PdfFit
的用法示例。
在下文中一共展示了PdfFit.save_pdf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from diffpy.pdffit2 import PdfFit [as 别名]
# 或者: from diffpy.pdffit2.PdfFit import save_pdf [as 别名]
# Set all temperature factors isotropic and equal to @4
for idx in range(1, 5):
pf.constrain(pf.u11(idx), '@4')
pf.constrain(pf.u22(idx), '@4')
pf.constrain(pf.u33(idx), '@4')
pf.setpar(4, pf.u11(1))
# Refine ---------------------------------------------------------------------
pf.pdfrange(1, 1.5, 19.99)
pf.refine()
# Save results ---------------------------------------------------------------
pf.save_pdf(1, "Ni_refinement.fgr")
pf.save_struct(1, "Ni_refinement.rstr")
pf.save_res("Ni_refinement.res")
# Plot results ---------------------------------------------------------------
# pylab is matplotlib interface with MATLAB-like plotting commands
import pylab
# obtain data from PdfFit calculator object
r = pf.getR()
Gobs = pf.getpdf_obs()
Gfit = pf.getpdf_fit()
# calculate difference curve, with pylab arrays it can be done
# without for loop
示例2: PdfFit
# 需要导入模块: from diffpy.pdffit2 import PdfFit [as 别名]
# 或者: from diffpy.pdffit2.PdfFit import save_pdf [as 别名]
#!/usr/bin/env python
'''Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr.
'''
from diffpy.pdffit2 import PdfFit
# create new PDF calculator object
P = PdfFit()
# load structure file in PDFFIT or DISCUS format
P.read_struct("Ni.stru")
radiation_type = 'X' # x-rays
qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A
qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay
rmin = 0.01 # minimum r-value
rmax = 30.0 # maximum r-value
npts = 3000 # number of points in the r-grid
# allocate and configure PDF calculation
P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts)
P.calc()
P.save_pdf(1, "Ni_calculation.cgr")