Dirty fix for infection status indicator

Mean over the last 7 days was distored when data for current day was
missing. Fixed the issue by using mean of the last 7 days starting from
yesterday. Better fix would be to use the 7 day mean of the last 7
datapoints available, to get most actual result.
This commit is contained in:
sowieso
2021-08-07 11:58:55 +02:00
parent 48889af5b1
commit d8d4d7a440

View File

@@ -79,7 +79,7 @@ def plot(data, countries, pop, metadata={}, **kwargs):
warn_thresh = 500e-6 * pop[loc]['pop']/7
info_thresh = 50e-6 * pop[loc]['pop']/7
low_thresh = 5e-6 * pop[loc]['pop']/7
actual_level = np.mean(new_cases[-7:])
actual_level = np.mean(new_cases[-8:-2])
infection_level_indicator = "green"
if actual_level > low_thresh:
infection_level_indicator = "gold"