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


Python BoolVector.createActiveList方法代码示例

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


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

示例1: test_it

# 需要导入模块: from ert.util import BoolVector [as 别名]
# 或者: from ert.util.BoolVector import createActiveList [as 别名]
    def test_it(self):
        state_size = 10
        with ErtTestContext("update" , self.config_file) as tc: 
            analysis = self.createAnalysisModule()
            ert = tc.getErt()
            obs = ert.getObservations()
            local_obsdata = obs.createLocalObsdata("OBS")
            
            fs = ert.getEnkfFsManager().getCurrentFileSystem()
            state = EnkfStateType.FORECAST


            mask = BoolVector( initial_size = ert.getEnsembleSize() , default_value = True)
            meas_data = MeasData(mask)
            obs_data = ObsData()
            obs.getObservationAndMeasureData( fs , local_obsdata , state , mask.createActiveList() , meas_data , obs_data )
            update( self.rng , mask , analysis , ert , meas_data , obs_data , state_size)
            
            
            mask[0] = False
            mask[4] = False
            meas_data = MeasData(mask)
            obs_data = ObsData()
            obs.getObservationAndMeasureData( fs , local_obsdata , state , mask.createActiveList() , meas_data , obs_data )
            update( self.rng , mask , analysis , ert , meas_data , obs_data , state_size)
开发者ID:YingfangZhou,项目名称:ert,代码行数:27,代码来源:test_update.py

示例2: createActiveList

# 需要导入模块: from ert.util import BoolVector [as 别名]
# 或者: from ert.util.BoolVector import createActiveList [as 别名]
    def createActiveList(ert, fs):
        state_map = fs.getStateMap()
        ens_mask = BoolVector(False, ert.getEnsembleSize())
        state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA)
        active_list = BoolVector.createActiveList(ens_mask)

        return [iens for iens in active_list]
开发者ID:Ensembles,项目名称:ert,代码行数:9,代码来源:summary_collector.py

示例3: realizationList

# 需要导入模块: from ert.util import BoolVector [as 别名]
# 或者: from ert.util.BoolVector import createActiveList [as 别名]
    def realizationList(self , state_value):
        """
        Will create a list of all realisations with state equal to state_value.

        @type state_value: RealizationStateEnum
        @rtype: ert.util.IntVector
        """
        mask = BoolVector(False, len(self))
        self.selectMatching(mask, state_value)
        return BoolVector.createActiveList(mask)
开发者ID:YingfangZhou,项目名称:ert,代码行数:12,代码来源:state_map.py

示例4: calculatePrincipalComponent

# 需要导入模块: from ert.util import BoolVector [as 别名]
# 或者: from ert.util.BoolVector import createActiveList [as 别名]
    def calculatePrincipalComponent(self, fs, local_obsdata, truncation_or_ncomp=3):
        pc = Matrix(1, 1)
        pc_obs = Matrix(1, 1)
        singular_values = DoubleVector()

        state_map = fs.getStateMap()
        ens_mask = BoolVector(False, self.ert().getEnsembleSize())
        state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA)
        active_list = BoolVector.createActiveList(ens_mask)

        if len(active_list) > 0:
            state = EnkfStateType.FORECAST
            meas_data = MeasData(active_list)
            obs_data = ObsData()

            self.ert().getObservations().getObservationAndMeasureData(fs, local_obsdata, state, active_list, meas_data, obs_data)

            meas_data.deactivateZeroStdSamples(obs_data)

            active_size = len(obs_data)

            if active_size > 0:
                S = meas_data.createS(active_size)
                D_obs = obs_data.createDobs(active_size)

                truncation, ncomp = self.truncationOrNumberOfComponents(truncation_or_ncomp)

                obs_data.scale(S, D_obs=D_obs)
                EnkfLinalg.calculatePrincipalComponents(S, D_obs, truncation, ncomp, pc, pc_obs, singular_values)
                if self.__prior_singular_values is None:
                    self.__prior_singular_values = singular_values
                else:
                    for row in range(pc.rows()):
                        factor = singular_values[row]/self.__prior_singular_values[row]
                        pc.scaleRow( row , factor )
                        pc_obs.scaleRow( row , factor )


                return PcaPlotData(local_obsdata.getName(), pc , pc_obs , singular_values)
        return None
开发者ID:danielfmva,项目名称:ert,代码行数:42,代码来源:pca_fetcher.py


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