From 9ed8db81ff0cd508c5edd796581a90392c877496 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Thu, 5 Mar 2020 15:03:27 +0100 Subject: [PATCH] simplified observation creation --- src/run_modules/post_processing.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/run_modules/post_processing.py b/src/run_modules/post_processing.py index 00d3d2d8..5105b5d8 100644 --- a/src/run_modules/post_processing.py +++ b/src/run_modules/post_processing.py @@ -195,19 +195,11 @@ class PostProcessing(RunEnvironment): getter = {"daily": "1D", "hourly": "1H"} return getter.get(self._sampling, None) - def _create_observation(self, data, observation, mean, std, transformation_method, normalised): - obs = data.observation.copy() + def _create_observation(self, data, _, mean, std, transformation_method, normalised): + obs = data.label.copy() if not normalised: obs = statistics.apply_inverse_transformation(obs, mean, std, transformation_method) - window_lead_time = self.data_store.get("window_lead_time", "general") - obs_w = [] - for w in range(window_lead_time): - obs_w.append(obs.shift(datetime=-(w+1))) - if observation is None: - observation = data.label.copy() - observation.values = np.concatenate(obs_w, axis=0) - return observation - + return obs def _create_ols_forecast(self, input_data, ols_prediction, mean, std, transformation_method, normalised): tmp_ols = self.ols_model.predict(input_data) -- GitLab