本文整理汇总了Python中mantid.simpleapi.Load.getNumberOfEntries方法的典型用法代码示例。如果您正苦于以下问题:Python Load.getNumberOfEntries方法的具体用法?Python Load.getNumberOfEntries怎么用?Python Load.getNumberOfEntries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.simpleapi.Load
的用法示例。
在下文中一共展示了Load.getNumberOfEntries方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plus_operator_sums_multiple_set_files_to_give_group
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_plus_operator_sums_multiple_set_files_to_give_group(self):
summed_data = Load("TSC15352+15353.raw,TSC15352+15354.raw", OutputWorkspace=self.wsname)
self.assertTrue(isinstance(summed_data, WorkspaceGroup))
self.assertEquals(2, summed_data.getNumberOfEntries())
# First group
data = summed_data[0]
self.assertEquals(149, data.getNumberHistograms())
self.assertEquals(24974, data.blocksize())
self.assertAlmostEqual(9.0, data.readX(2)[1], places=DIFF_PLACES)
self.assertAlmostEqual(46352.0, data.readY(2)[1], places=DIFF_PLACES)
self.assertAlmostEqual(215.29514625276622, data.readE(2)[1], places=DIFF_PLACES)
# Second group
data = summed_data[1]
self.assertEquals(149, data.getNumberHistograms())
self.assertEquals(24974, data.blocksize())
self.assertAlmostEqual(9.0, data.readX(2)[1], places=DIFF_PLACES)
self.assertAlmostEqual(35640.0, data.readY(2)[1], places=DIFF_PLACES)
self.assertAlmostEqual(188.78559267062727, data.readE(2)[1], places=DIFF_PLACES)
deleted_names = ["TSC15352", "TSC15353", "TSC15354"]
for name in deleted_names:
self.assertTrue(name not in AnalysisDataService)
示例2: test_extra_properties_passed_to_loader_for_multiple_files
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_extra_properties_passed_to_loader_for_multiple_files(self):
data = Load("EQSANS_1466_event.nxs,EQSANS_3293_event.nxs", OutputWorkspace = self.wsname,
BankName = "bank1", SingleBankPixelsOnly = False)
self.assertTrue(isinstance(data, WorkspaceGroup))
self.assertEquals(2, data.getNumberOfEntries())
# Test number of events in each
self.assertEquals(740, data[0].getNumberEvents())
self.assertEquals(105666, data[1].getNumberEvents())
示例3: test_stepped_range_operator_loads_correct_number_of_files
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_stepped_range_operator_loads_correct_number_of_files(self):
data = Load("TSC15352:15354:2.raw", OutputWorkspace=self.wsname)
self.assertTrue(isinstance(data, WorkspaceGroup))
self.assertEquals(2, data.getNumberOfEntries())
self.assertTrue(isinstance(data[0], MatrixWorkspace))
self.assertTrue(isinstance(data[1], MatrixWorkspace))
# Cursory check that the correct ones were loaded
self.assertTrue("TO96_2" in data[0].getTitle())
self.assertTrue("TO96_4" in data[1].getTitle())
示例4: test_csv_list_with_same_instrument_produces_single_group
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_csv_list_with_same_instrument_produces_single_group(self):
data = Load("OFFSPEC10791,10792,10793.raw", OutputWorkspace = self.wsname)
self.assertTrue(isinstance(data, WorkspaceGroup))
self.assertEquals(6, data.getNumberOfEntries())
ads_names = ["OFFSPEC00010791_1", "OFFSPEC00010791_2",
"OFFSPEC00010792_1", "OFFSPEC00010792_2",
"OFFSPEC00010793_1", "OFFSPEC00010793_2"]
for name in ads_names:
self.assertTrue(name in AnalysisDataService)
deleted_names = ["OFFSPEC10791", "OFFSPEC10792", "OFFSPEC10793"]
for name in deleted_names:
self.assertTrue(name not in AnalysisDataService)
self.cleanup_names = ads_names
示例5: test_csv_list_with_different_instrument_produces_single_group
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_csv_list_with_different_instrument_produces_single_group(self):
# Combine test of different instruments with giving the output name
# the same name as one of the members of the group
self.wsname = "LOQ99631"
data = Load("LOQ99631.RAW, CSP85423.raw", OutputWorkspace=self.wsname)
self.assertTrue(isinstance(data, WorkspaceGroup))
self.assertEquals(3, data.getNumberOfEntries())
ads_names = ["LOQ99631", "CSP85423_1", "CSP85423_2"]
for name in ads_names:
self.assertTrue(name in AnalysisDataService)
deleted_names = ["CSP85423"]
for name in deleted_names:
self.assertTrue(name not in AnalysisDataService)
self.cleanup_names = ads_names
self.wsname = "__LoadTest"
示例6: test_plus_operator_for_input_groups
# 需要导入模块: from mantid.simpleapi import Load [as 别名]
# 或者: from mantid.simpleapi.Load import getNumberOfEntries [as 别名]
def test_plus_operator_for_input_groups(self):
summed_data = Load("OFFSPEC10791+10792.raw", OutputWorkspace=self.wsname)
self.assertTrue(isinstance(summed_data, WorkspaceGroup))
self.assertEquals(2, summed_data.getNumberOfEntries())
# First group
data = summed_data[0]
self.assertEquals(245, data.getNumberHistograms())
self.assertEquals(5000, data.blocksize())
self.assertAlmostEqual(25.0, data.readX(1)[1], places=DIFF_PLACES)
self.assertAlmostEqual(4.0, data.readY(1)[1], places=DIFF_PLACES)
self.assertAlmostEqual(2.0, data.readE(1)[1], places=DIFF_PLACES)
# Second group
data = summed_data[1]
self.assertEquals(245, data.getNumberHistograms())
self.assertEquals(5000, data.blocksize())
self.assertAlmostEqual(25.0, data.readX(1)[1], places=DIFF_PLACES)
self.assertAlmostEqual(1.0, data.readY(1)[1], places=DIFF_PLACES)
self.assertAlmostEqual(1.0, data.readE(1)[1], places=DIFF_PLACES)