diff --git a/modules/util/util.py b/modules/util/util.py index d21fc755d7188de7ffe298c4f1517e9b97b1f234..fd405d33f12935abd782d79eb9c52df5d96c708e 100644 --- a/modules/util/util.py +++ b/modules/util/util.py @@ -161,3 +161,13 @@ def is_night(solzen, test_angle=80.0, threshold=0.10): return True else: return False + + +# array solzen must be degrees, missing values must NaN. For small roughly 50x50km regions only +def is_day(solzen, test_angle=75.0): + solzen = solzen.flatten() + solzen = solzen[np.invert(np.isnan(solzen))] + if len(solzen) == 0 or np.sum(solzen <= test_angle) < len(solzen): + return False + else: + return True