From b9b99df8aa4ab3cc49694e3b8dc91cf96a8f8a11 Mon Sep 17 00:00:00 2001 From: Le Roux Erwan <erwan.le-roux@irstea.fr> Date: Tue, 5 Mar 2019 14:53:29 +0100 Subject: [PATCH] [SCM] to obtain daily time serie. take instateneous value at the beginning of each day instead of taking the mean. --- .../meteo_france_SCM_study/crocus/crocus_variables.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/experiment/meteo_france_SCM_study/crocus/crocus_variables.py b/experiment/meteo_france_SCM_study/crocus/crocus_variables.py index c8b1c120..387c07d2 100644 --- a/experiment/meteo_france_SCM_study/crocus/crocus_variables.py +++ b/experiment/meteo_france_SCM_study/crocus/crocus_variables.py @@ -15,11 +15,13 @@ class CrocusVariable(AbstractVariable): if self.altitude == 2400: time_serie_daily = time_serie_every_6_hours else: - # Take the mean over a full day (WARNING: by doing that I am potentially destroying some maxima) - # TODO: I could create a special mode where I take the maximum instead of the mean here nb_days = len(time_serie_every_6_hours) // 4 - time_serie_daily = np.array([np.mean(time_serie_every_6_hours[4 * i:4 * (i + 1)], axis=0) - for i in range(nb_days)]) + # The first value of each day is selected (in order to be comparable to an instantaneous value) + time_serie_daily = np.array([time_serie_every_6_hours[4 * i] for i in range(nb_days)]) + # Take the mean over a full day (WARNING: by doing that I am potentially destroying some maxima) + # (I could also create a special mode where I take the maximum instead of the mean here) + # time_serie_daily = np.array([np.mean(time_serie_every_6_hours[4 * i:4 * (i + 1)], axis=0) + # for i in range(nb_days)]) return time_serie_daily -- GitLab