当前位置: 首页>>代码示例>>Python>>正文


Python EnKFMain.getObservations方法代码示例

本文整理汇总了Python中ert.enkf.enkf_main.EnKFMain.getObservations方法的典型用法代码示例。如果您正苦于以下问题:Python EnKFMain.getObservations方法的具体用法?Python EnKFMain.getObservations怎么用?Python EnKFMain.getObservations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ert.enkf.enkf_main.EnKFMain的用法示例。


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

示例1: test_observations

# 需要导入模块: from ert.enkf.enkf_main import EnKFMain [as 别名]
# 或者: from ert.enkf.enkf_main.EnKFMain import getObservations [as 别名]
    def test_observations(self):
        with TestAreaContext("enkf_test") as work_area:
            work_area.copy_directory(self.case_directory)

            main = EnKFMain("simple_config/minimum_config")

            count = 10
            summary_key = "test_key"
            observation_key = "test_obs_key"
            summary_observation_node = EnkfConfigNode.createSummaryConfigNode(summary_key, LoadFailTypeEnum.LOAD_FAIL_EXIT)
            observation_vector = ObsVector(EnkfObservationImplementationType.SUMMARY_OBS, observation_key, summary_observation_node, count)

            main.getObservations().addObservationVector(observation_vector)

            values = []
            for index in range(0, count):
                value = index * 10.5
                std = index / 10.0
                summary_observation_node = SummaryObservation(summary_key, observation_key, value, std)
                observation_vector.installNode(index, summary_observation_node)
                self.assertEqual(observation_vector.getNode(index), summary_observation_node)
                self.assertEqual(value, summary_observation_node.getValue())
                values.append((index, value, std))
            


            observations = main.getObservations()
            test_vector = observations[observation_key]
            index = 0
            for node in test_vector:
                self.assertTrue( isinstance( node , SummaryObservation ))
                self.assertEqual( node.getValue( ) , index * 10.5 )
                index += 1

                
            self.assertEqual(observation_vector, test_vector)
            for index, value, std in values:
                self.assertTrue(test_vector.isActive(index))

                summary_observation_node = test_vector.getNode(index)
                """@type: SummaryObservation"""

                self.assertEqual(value, summary_observation_node.getValue())
                self.assertEqual(std, summary_observation_node.getStandardDeviation())
                self.assertEqual(summary_key, summary_observation_node.getSummaryKey())


            main.free()
开发者ID:,项目名称:,代码行数:50,代码来源:

示例2: test_config

# 需要导入模块: from ert.enkf.enkf_main import EnKFMain [as 别名]
# 或者: from ert.enkf.enkf_main.EnKFMain import getObservations [as 别名]
    def test_config( self ):
        with TestAreaContext("enkf_test") as work_area:
            work_area.copy_directory(self.case_directory)

            main = EnKFMain("simple_config/minimum_config", self.site_config_file)

            self.assertIsInstance(main.ensembleConfig(), EnsConfig)
            self.assertIsInstance(main.analysisConfig(), AnalysisConfig)
            self.assertIsInstance(main.getModelConfig(), ModelConfig)
            #self.assertIsInstance(main.local_config(), LocalConfig) #warn: Should this be None?
            self.assertIsInstance(main.siteConfig(), SiteConfig)
            self.assertIsInstance(main.eclConfig(), EclConfig)
            self.assertIsInstance(main.plot_config(), PlotConfig)

            # self.main.load_obs(obs_config_file)
            self.assertIsInstance(main.getObservations(), EnkfObs)
            self.assertIsInstance(main.get_templates(), ErtTemplates)
            self.assertIsInstance(main.getEnkfFsManager().getFileSystem(), EnkfFs)
            # self.assertIsInstance(main.iget_member_config(0), MemberConfig)
            self.assertIsInstance(main.getMemberRunningState(0), EnKFState)

            main.free()
开发者ID:blattms,项目名称:ert,代码行数:24,代码来源:test_enkf.py


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