本文整理汇总了Python中diffpy.Structure.Structure.pdffit["delta2"]方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.pdffit["delta2"]方法的具体用法?Python Structure.pdffit["delta2"]怎么用?Python Structure.pdffit["delta2"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类diffpy.Structure.Structure
的用法示例。
在下文中一共展示了Structure.pdffit["delta2"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_nometa
# 需要导入模块: from diffpy.Structure import Structure [as 别名]
# 或者: from diffpy.Structure.Structure import pdffit["delta2"] [as 别名]
def test_nometa(self):
"""check NoMetaStructureAdapter.
"""
r0, g0 = PDFCalculator()(nickel)
ni1 = Structure(nickel)
ni1.pdffit["scale"] = 2.0
r1, g1 = PDFCalculator()(ni1)
self.failUnless(numpy.array_equal(r0, r1))
self.failUnless(numpy.allclose(2 * g0, g1))
ni1nm = nometa(ni1)
self.failUnless(ni1nm is nometa(ni1nm))
r1nm, g1nm = PDFCalculator()(ni1nm)
self.failUnless(numpy.array_equal(r0, r1nm))
self.failUnless(numpy.allclose(g0, g1nm))
ni2 = Structure(nickel)
ni2.pdffit["delta2"] = 4
r2, g2 = PDFCalculator()(ni2)
r2, g2nm = PDFCalculator()(nometa(ni2))
self.failIf(numpy.allclose(g0, g2))
self.failUnless(numpy.allclose(g0, g2nm))
adpt2 = createStructureAdapter(ni2)
ra2, ga2 = PDFCalculator()(adpt2)
ra2, ga2nm = PDFCalculator()(nometa(adpt2))
self.failUnless(numpy.allclose(g2, ga2))
self.failUnless(numpy.allclose(g0, ga2nm))
return