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

snapshot...

parent 742d34c8
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,11 @@ ds_range.update({'temp_3_9um_nom': 'actual_range'}) ...@@ -55,6 +55,11 @@ ds_range.update({'temp_3_9um_nom': 'actual_range'})
ds_range.update({'cloud_fraction': 'actual_range'}) ds_range.update({'cloud_fraction': 'actual_range'})
class MyGenericException(Exception):
def __init__(self, message):
self.message = message
def make_tf_callable_generator(the_generator): def make_tf_callable_generator(the_generator):
class MyCallable: class MyCallable:
def __init__(self, gen): def __init__(self, gen):
...@@ -522,7 +527,7 @@ def make_times(dt_str_0, dt_str_1=None, format_code='%Y-%m-%d_%H:%M', num_steps= ...@@ -522,7 +527,7 @@ def make_times(dt_str_0, dt_str_1=None, format_code='%Y-%m-%d_%H:%M', num_steps=
def normalize(data, param, mean_std_dict, copy=True): def normalize(data, param, mean_std_dict, copy=True):
if mean_std_dict.get(param) is None: if mean_std_dict.get(param) is None:
return data raise MyGenericException(param + ': not found in dictionary')
if copy: if copy:
data = data.copy() data = data.copy()
...@@ -547,7 +552,7 @@ def denormalize(data, param, mean_std_dict, copy=True): ...@@ -547,7 +552,7 @@ def denormalize(data, param, mean_std_dict, copy=True):
data = data.copy() data = data.copy()
if mean_std_dict.get(param) is None: if mean_std_dict.get(param) is None:
return data raise MyGenericException(param + ': not found in dictionary')
shape = data.shape shape = data.shape
data = data.flatten() data = data.flatten()
...@@ -566,7 +571,7 @@ def scale(data, param, mean_std_dict, copy=True): ...@@ -566,7 +571,7 @@ def scale(data, param, mean_std_dict, copy=True):
data = data.copy() data = data.copy()
if mean_std_dict.get(param) is None: if mean_std_dict.get(param) is None:
return data raise MyGenericException(param + ': not found in dictionary')
shape = data.shape shape = data.shape
data = data.flatten() data = data.flatten()
...@@ -589,7 +594,7 @@ def descale(data, param, mean_std_dict, copy=True): ...@@ -589,7 +594,7 @@ def descale(data, param, mean_std_dict, copy=True):
data = data.copy() data = data.copy()
if mean_std_dict.get(param) is None: if mean_std_dict.get(param) is None:
return data raise MyGenericException(param + ': not found in dictionary')
shape = data.shape shape = data.shape
data = data.flatten() data = data.flatten()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment