From 9b6b4f7eb789b14193968412fc71175d9e0329ba Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Tue, 30 Mar 2021 11:05:52 -0500
Subject: [PATCH] snapshot...

---
 modules/util/util.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/util/util.py b/modules/util/util.py
index 2ce16c6c..d21fc755 100644
--- a/modules/util/util.py
+++ b/modules/util/util.py
@@ -157,7 +157,7 @@ def value_to_index(nda, value):
 def is_night(solzen, test_angle=80.0, threshold=0.10):
     solzen = solzen.flatten()
     solzen = solzen[np.invert(np.isnan(solzen))]
-    if (np.sum(solzen > test_angle) / len(solzen)) > threshold:
+    if len(solzen) == 0 or (np.sum(solzen > test_angle) / len(solzen)) > threshold:
         return True
     else:
         return False
-- 
GitLab