From 6e53da8ac9fc4b077d8bbe3f177761d37fdfb042 Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Wed, 12 Feb 2020 10:03:02 -0700
Subject: [PATCH] Update ObservatoryMetadata to check interval is defined
 before use

---
 geomagio/ObservatoryMetadata.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/geomagio/ObservatoryMetadata.py b/geomagio/ObservatoryMetadata.py
index d7bf9d0c..a35776b8 100644
--- a/geomagio/ObservatoryMetadata.py
+++ b/geomagio/ObservatoryMetadata.py
@@ -1063,5 +1063,6 @@ class ObservatoryMetadata(object):
             interval_specific = \
                 self.metadata[observatory]['interval_specific']
         # stats['data_interval_type'] = data_interval_type[interval]
-        for key in interval_specific[interval]:
-            stats[key] = interval_specific[interval][key]
+        if interval in interval_specific:
+            for key in interval_specific[interval]:
+                stats[key] = interval_specific[interval][key]
-- 
GitLab