Skip to content
Snippets Groups Projects
Commit f853bcd5 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent d86b257c
No related branches found
No related tags found
No related merge requests found
......@@ -519,6 +519,32 @@ def scale(data, param, mean_std_dict, copy=True):
return data
def descale(data, param, mean_std_dict, copy=True):
if copy:
data = data.copy()
if mean_std_dict.get(param) is None:
return data
shape = data.shape
data = data.flatten()
_, _, lo, hi = mean_std_dict.get(param)
data *= (hi - lo)
data += lo
data -= lo
data /= (hi - lo)
not_valid = np.isnan(data)
data[not_valid] = 0
data = np.reshape(data, shape)
return data
def scale2(data, lo, hi, copy=True):
if copy:
data = data.copy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment