From 8e889acc2f81c19bfb445b65aaa22a7b2d45c0bc Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Thu, 21 Jul 2016 12:47:37 -0600
Subject: [PATCH] Do not try to set metadata when observatory is not known

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

diff --git a/geomagio/ObservatoryMetadata.py b/geomagio/ObservatoryMetadata.py
index a5218268..7cc75610 100644
--- a/geomagio/ObservatoryMetadata.py
+++ b/geomagio/ObservatoryMetadata.py
@@ -996,6 +996,8 @@ class ObservatoryMetadata(object):
         stats['channel'] = channel
         stats['data_interval'] = interval
         stats['data_type'] = type
+        if not observatory in self.metadata:
+            return
         # copy in standard metadata
         metadata = self.metadata[observatory]['metadata']
         for key in metadata:
-- 
GitLab