From 4c596cc874e7335198fc339b86c7e66bbb8762ef Mon Sep 17 00:00:00 2001
From: leufen1 <l.leufen@fz-juelich.de>
Date: Thu, 29 Apr 2021 15:45:51 +0200
Subject: [PATCH] small fix

---
 mlair/helpers/statistics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlair/helpers/statistics.py b/mlair/helpers/statistics.py
index 0ee95098..6e25a368 100644
--- a/mlair/helpers/statistics.py
+++ b/mlair/helpers/statistics.py
@@ -333,7 +333,7 @@ class SkillScores:
             skill_score.loc[["CASE II", "AII", "BII"], iahead] = np.stack(self._climatological_skill_score(
                 data, mu_type=2, forecast_name=forecast_name, observation_name=self.observation_name).values.flatten())
 
-            if self.external_data is not None:
+            if self.external_data is not None and self.observation_name in self.external_data.coords["type"]:
                 external_data = self.external_data.sel(ahead=iahead, type=[self.observation_name])
                 skill_score.loc[["CASE III", "AIII"], iahead] = np.stack(self._climatological_skill_score(
                     data, mu_type=3, forecast_name=forecast_name, observation_name=self.observation_name,
-- 
GitLab