• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python simpleapi.SimulatedDensityOfStates类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mantid.simpleapi.SimulatedDensityOfStates的典型用法代码示例。如果您正苦于以下问题:Python SimulatedDensityOfStates类的具体用法?Python SimulatedDensityOfStates怎么用?Python SimulatedDensityOfStates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: test_lorentzian_function

 def test_lorentzian_function(self):
     wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                    Function='Lorentzian')
     self.assertEquals(wks.getNumberHistograms(), 2)
     v_axis_values = wks.getAxis(1).extractValues()
     self.assertEquals(v_axis_values[0], 'Lorentzian')
     self.assertEquals(v_axis_values[1], 'Stick')
开发者ID:mducle,项目名称:mantid,代码行数:7,代码来源:SimulatedDensityOfStatesTest.py


示例2: test_partial

    def test_partial(self):
        spec_type = 'DOS'

        ws = SimulatedDensityOfStates(File=self._file_name, SpectrumType=spec_type, Ions='H,C,O')

        workspaces = ws.getNames()
        self.assertEquals(len(workspaces), 3)
开发者ID:nimgould,项目名称:mantid,代码行数:7,代码来源:SimulatedDensityOfStatesTest.py


示例3: test_bond_table

    def test_bond_table(self):
        wks = SimulatedDensityOfStates(CASTEPFile=self._castep_file,
                                       SpectrumType='BondTable')

        self.assertTrue(isinstance(wks, ITableWorkspace))
        self.assertEqual(wks.columnCount(), 6)
        self.assertEqual(wks.rowCount(), 74)
开发者ID:mducle,项目名称:mantid,代码行数:7,代码来源:SimulatedDensityOfStatesTest.py


示例4: test_partial_cross_section_scale

    def test_partial_cross_section_scale(self):
        spec_type = 'DOS'

        ws = SimulatedDensityOfStates(File=self._file_name, SpectrumType=spec_type, Ions='H,C,O', ScaleByCrossSection='Incoherent')

        workspaces = ws.getNames()
        self.assertEquals(len(workspaces), 3)
开发者ID:nimgould,项目名称:mantid,代码行数:7,代码来源:SimulatedDensityOfStatesTest.py


示例5: test_ir_active

 def test_ir_active(self):
     spec_type = 'IR_Active'
     wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                    SpectrumType=spec_type)
     self.assertEquals(wks.getNumberHistograms(), 2)
     v_axis_values = wks.getAxis(1).extractValues()
     self.assertEquals(v_axis_values[0], 'Gaussian')
     self.assertEquals(v_axis_values[1], 'Stick')
开发者ID:mducle,项目名称:mantid,代码行数:8,代码来源:SimulatedDensityOfStatesTest.py


示例6: test_isotope_element_indices_loading

 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())
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:SimulatedDensityOfStatesTest.py


示例7: test_isotopes_are_parsed_correctly

 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())
开发者ID:mducle,项目名称:mantid,代码行数:10,代码来源:SimulatedDensityOfStatesTest.py


示例8: test_bin_width

    def test_bin_width(self):
        import math

        ref = SimulatedDensityOfStates(File=self._file_name)
        ws = SimulatedDensityOfStates(File=self._file_name, BinWidth=2)

        size = ws.blocksize()
        ref_size = ref.blocksize()

        self.assertEquals(size, math.ceil(ref_size/2.0))
开发者ID:nimgould,项目名称:mantid,代码行数:10,代码来源:SimulatedDensityOfStatesTest.py


示例9: test_zero_threshold

    def test_zero_threshold(self):
        import numpy as np

        ws = SimulatedDensityOfStates(File=self._file_name, ZeroThreshold=20)

        x = ws.readX(0)
        y = ws.readY(0)

        mask = np.where(x < 20)
        self.assertEquals(sum(y[mask]), 0)
开发者ID:nimgould,项目名称:mantid,代码行数:10,代码来源:SimulatedDensityOfStatesTest.py


示例10: test_isotopes_are_parsed_correctly

 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.assertTrue(_is_name_material_in_group(wks_group = wks_grp, \
                                                name_to_find = 'wks_grp_C(13)', material_to_find = '(C13)'))
开发者ID:DanNixon,项目名称:mantid,代码行数:10,代码来源:SimulatedDensityOfStatesTest.py


示例11: test_bin_width

    def test_bin_width(self):
        import math

        ref = SimulatedDensityOfStates(PHONONFile=self._phonon_file)
        wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                       BinWidth=2)

        size = wks.blocksize()
        ref_size = ref.blocksize()

        self.assertEquals(size, math.ceil(ref_size/2.0))
开发者ID:mducle,项目名称:mantid,代码行数:11,代码来源:SimulatedDensityOfStatesTest.py


示例12: test_zero_threshold

    def test_zero_threshold(self):
        import numpy as np

        wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                       ZeroThreshold=20)

        x_data = wks.readX(0)
        y_data = wks.readY(0)

        mask = np.where(x_data < 20)
        self.assertEquals(sum(y_data[mask]), 0)
开发者ID:mducle,项目名称:mantid,代码行数:11,代码来源:SimulatedDensityOfStatesTest.py


示例13: test_ion_table

    def test_ion_table(self):
        wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                       SpectrumType='IonTable')

        self.assertTrue(isinstance(wks, ITableWorkspace))
        self.assertEqual(wks.columnCount(), 10)
        self.assertEqual(wks.rowCount(), 20)

        all_species = wks.column('Species')

        self.assertEqual(all_species.count('H'), 4)
        self.assertEqual(all_species.count('C'), 8)
        self.assertEqual(all_species.count('O'), 8)
开发者ID:mducle,项目名称:mantid,代码行数:13,代码来源:SimulatedDensityOfStatesTest.py


示例14: test_non_isotpe_element_indices_loading

 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())
开发者ID:mducle,项目名称:mantid,代码行数:13,代码来源:SimulatedDensityOfStatesTest.py


示例15: test_bin_ranges_are_correct

 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]))
开发者ID:mducle,项目名称:mantid,代码行数:14,代码来源:SimulatedDensityOfStatesTest.py


示例16: test_peak_width_function

 def test_peak_width_function(self):
     wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                    PeakWidth='0.1*energy')
     self.assertEquals(wks.getNumberHistograms(), 2)
开发者ID:mducle,项目名称:mantid,代码行数:4,代码来源:SimulatedDensityOfStatesTest.py


示例17: test_temperature

 def test_temperature(self):
     ws = SimulatedDensityOfStates(File=self._file_name, Temperature=50)
     self.assertEquals(ws.getNumberHistograms(), 1)
开发者ID:nimgould,项目名称:mantid,代码行数:3,代码来源:SimulatedDensityOfStatesTest.py


示例18: test_peak_width_function

 def test_peak_width_function(self):
     ws = SimulatedDensityOfStates(File=self._file_name, PeakWidth='0.1*energy')
     self.assertEquals(ws.getNumberHistograms(), 1)
开发者ID:nimgould,项目名称:mantid,代码行数:3,代码来源:SimulatedDensityOfStatesTest.py


示例19: test_lorentzian_function

 def test_lorentzian_function(self):
     ws = SimulatedDensityOfStates(File=self._file_name, Function='Lorentzian')
     self.assertEquals(ws.getNumberHistograms(), 1)
开发者ID:nimgould,项目名称:mantid,代码行数:3,代码来源:SimulatedDensityOfStatesTest.py


示例20: test_ir_active

 def test_ir_active(self):
     spec_type = 'IR_Active'
     ws = SimulatedDensityOfStates(File=self._file_name, SpectrumType=spec_type)
     self.assertEquals(ws.getNumberHistograms(), 1)
开发者ID:nimgould,项目名称:mantid,代码行数:4,代码来源:SimulatedDensityOfStatesTest.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python proxies.new_proxy函数代码示例发布时间:2022-05-27
下一篇:
Python simpleapi.Load类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap