diff --git a/modules/util/util.py b/modules/util/util.py index 2ce16c6ceeb10f78346447ac5655421f0fe342f8..d21fc755d7188de7ffe298c4f1517e9b97b1f234 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