本文整理汇总了Python中mantid.simpleapi.SimulatedDensityOfStates.getItem方法的典型用法代码示例。如果您正苦于以下问题:Python SimulatedDensityOfStates.getItem方法的具体用法?Python SimulatedDensityOfStates.getItem怎么用?Python SimulatedDensityOfStates.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.simpleapi.SimulatedDensityOfStates
的用法示例。
在下文中一共展示了SimulatedDensityOfStates.getItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_isotopes_are_parsed_correctly
# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
def test_isotopes_are_parsed_correctly(self):
"""
Test that isotopes in the file in the format `element:P` are valid
"""
wks_grp = SimulatedDensityOfStates(PHONONFile=self._isotope_phonon,
SpectrumType='DOS',
Ions='H:P,C:P,O')
self.assertEqual(3, wks_grp.size())
self.assertEqual('wks_grp_C(13)', wks_grp.getItem(0).getName())
self.assertEqual('(C13)', wks_grp.getItem(0).sample().getMaterial().name())
示例2: test_non_isotpe_element_indices_loading
# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
def test_non_isotpe_element_indices_loading(self):
"""
Test that the individual indices for each element can be loaded seperately
Tests parse_chemical_and_ws_name for non-isotope + indices
"""
wks_grp = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
SpectrumType='DOS',
CalculateIonIndices=True,
Ions='H,C,O')
self.assertEqual(20, len(wks_grp))
self.assertEqual('wks_grp_H_0' , wks_grp.getItem(0).getName())
self.assertEqual('wks_grp_C_4' , wks_grp.getItem(4).getName())
self.assertEqual('wks_grp_O_12', wks_grp.getItem(12).getName())
示例3: test_isotope_element_indices_loading
# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
def test_isotope_element_indices_loading(self):
"""
"""
wks_grp = SimulatedDensityOfStates(PHONONFile=self._isotope_phonon,
SpectrumType='DOS',
CalculateIonIndices=True,
Ions='H:P,C:P')
self.assertEqual(2, len(wks_grp))
self.assertEqual('wks_grp_C(13)_0', wks_grp.getItem(0).getName())
self.assertEqual('wks_grp_H(2)_1' , wks_grp.getItem(1).getName())
示例4: test_bin_ranges_are_correct
# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
def test_bin_ranges_are_correct(self):
"""
Test that the bin ranges are correct when draw peak function is called
"""
bin_width = 3
wks_grp = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
SpectrumType='DOS',
BinWidth=bin_width,
Ions='H,C,O')
expected_x_min = -0.051481
for idx in range(wks_grp.getNumberOfEntries()):
ws = wks_grp.getItem(idx)
self.assertAlmostEqual(expected_x_min,ws.readX(0)[0])
self.assertAlmostEqual(bin_width,(ws.readX(0)[1] - ws.readX(0)[0]))