當前位置: 首頁>>代碼示例>>Python>>正文


Python Load.getNumberOfEntries方法代碼示例

本文整理匯總了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)
開發者ID:mantidproject,項目名稱:systemtests,代碼行數:29,代碼來源:LoadTest.py

示例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())
開發者ID:liyulun,項目名稱:mantid,代碼行數:11,代碼來源:LoadTest.py

示例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())
開發者ID:mantidproject,項目名稱:systemtests,代碼行數:14,代碼來源:LoadTest.py

示例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
開發者ID:liyulun,項目名稱:mantid,代碼行數:18,代碼來源:LoadTest.py

示例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"
開發者ID:mantidproject,項目名稱:systemtests,代碼行數:20,代碼來源:LoadTest.py

示例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)
開發者ID:mantidproject,項目名稱:systemtests,代碼行數:25,代碼來源:LoadTest.py


注:本文中的mantid.simpleapi.Load.getNumberOfEntries方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。