From 9f283cc6b513b9ddf7bdb04482f04978d0cb5d37 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Fri, 6 Oct 2023 13:21:39 -0500 Subject: [PATCH] snapshot... --- modules/util/util.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/util/util.py b/modules/util/util.py index f7abf1e3..4da16621 100644 --- a/modules/util/util.py +++ b/modules/util/util.py @@ -607,6 +607,24 @@ def scale2(data, lo, hi, copy=True): return data +def descale2(data, lo, hi, copy=True): + if copy: + data = data.copy() + + shape = data.shape + data = data.flatten() + + data *= (hi - lo) + data += lo + + not_valid = np.isnan(data) + data[not_valid] = 0 + + data = np.reshape(data, shape) + + return data + + def descale(data, param, mean_std_dict, copy=True): if copy: data = data.copy() -- GitLab