Пример #1
0
    def run(self, job_config):
        facade = LibresFacade(self.ert())
        user_config = load_yaml(job_config)
        user_config = _insert_default_group(user_config)

        obs = facade.get_observations()
        obs_keys = [facade.get_observation_key(nr) for nr, _ in enumerate(obs)]
        obs_with_data = keys_with_data(
            obs,
            obs_keys,
            facade.get_ensemble_size(),
            facade.get_current_fs(),
        )
        default_values = _get_default_values(
            facade.get_alpha(), facade.get_std_cutoff()
        )
        for config_dict in user_config:
            config = ObsCorrConfig(config_dict, obs_keys, default_values)
            config.validate(obs_with_data)

            measured_data = _get_measured_data(
                facade,
                config.get_calculation_keys(),
                config.get_index_lists(),
                config.get_alpha(),
                config.get_std_cutoff(),
            )
            job = ObservationScaleFactor(self.reporter, measured_data)
            scale_factor = job.get_scaling_factor(config.get_threshold())
            logging.info(
                "Scaling factor calculated from keys: {}".format(
                    config.get_calculation_keys()
                )
            )
            scale_observations(obs, scale_factor, config.get_update_keys())
Пример #2
0
def _load_measured_record(enkf_main):
    facade = LibresFacade(enkf_main)
    obs_keys = [
        facade.get_observation_key(nr)
        for nr, _ in enumerate(facade.get_observations())
    ]
    measured_data = MeasuredData(facade, obs_keys)
    measured_data.remove_failed_realizations()
    measured_data.remove_inactive_observations()
    measured_data.filter_ensemble_mean_obs(facade.get_alpha())
    measured_data.filter_ensemble_std(facade.get_std_cutoff())
    return measured_data
    def run(self, job_config):
        facade = LibresFacade(self.ert())
        user_config = load_yaml(job_config)
        user_config = _insert_default_group(user_config)

        obs = facade.get_observations()
        obs_keys = [facade.get_observation_key(nr) for nr, _ in enumerate(obs)]
        obs_with_data = keys_with_data(
            obs,
            obs_keys,
            facade.get_ensemble_size(),
            facade.get_current_fs(),
        )
        default_values = _get_default_values(
            facade.get_alpha(), facade.get_std_cutoff()
        )
        for config in user_config:
            job = ScalingJob(
                obs_keys, obs, obs_with_data, config, self.reporter, default_values
            )
            measured_data = MeasuredData(
                facade, job.get_calc_keys(), job.get_index_lists()
            )
            job.scale(measured_data)