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

snapshot...

parent d09abe7e
No related branches found
No related tags found
No related merge requests found
...@@ -49,16 +49,17 @@ f.close() ...@@ -49,16 +49,17 @@ f.close()
mean_std_dct.update(mean_std_dct_l1b) mean_std_dct.update(mean_std_dct_l1b)
mean_std_dct.update(mean_std_dct_l2) mean_std_dct.update(mean_std_dct_l2)
emis_params = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13_3um_nom', 'temp_3_75um_nom', # emis_params = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13_3um_nom', 'temp_3_75um_nom',
'temp_6_7um_nom', 'temp_6_2um_nom', 'temp_7_3um_nom', 'temp_8_5um_nom', 'temp_9_7um_nom'] # 'temp_6_7um_nom', 'temp_6_2um_nom', 'temp_7_3um_nom', 'temp_8_5um_nom', 'temp_9_7um_nom']
l2_params = ['cloud_fraction', 'cld_temp_acha', 'cld_press_acha', 'cld_opd_acha', 'cld_reff_acha'] data_params = ['refl_0_65um_nom', 'temp_11_0um_nom', 'cld_temp_acha', 'cld_press_acha', 'cloud_fraction']
label_params = ['refl_0_65um_nom', 'temp_11_0um_nom', 'cld_temp_acha', 'cld_press_acha', 'cloud_fraction']
# -- Zero out params (Experimentation Only) ------------
zero_out_params = ['cld_reff_dcomp', 'cld_opd_dcomp', 'iwc_dcomp', 'lwc_dcomp']
DO_ZERO_OUT = False DO_ZERO_OUT = False
label_idx = 1 data_idx, label_idx = 1, 1
label_param = l2_params[label_idx] data_param = data_params[data_idx]
label_param = label_params[label_idx]
def build_conv2d_block(conv, num_filters, activation, block_name, padding='SAME'): def build_conv2d_block(conv, num_filters, activation, block_name, padding='SAME'):
...@@ -211,12 +212,12 @@ class ESPCN: ...@@ -211,12 +212,12 @@ class ESPCN:
self.n_chans = 1 self.n_chans = 1
# self.X_img = tf.keras.Input(shape=(None, None, self.n_chans)) self.X_img = tf.keras.Input(shape=(None, None, self.n_chans))
self.X_img = tf.keras.Input(shape=(36, 36, self.n_chans)) # self.X_img = tf.keras.Input(shape=(36, 36, self.n_chans))
self.inputs.append(self.X_img) self.inputs.append(self.X_img)
# self.inputs.append(tf.keras.Input(shape=(None, None, self.n_chans))) self.inputs.append(tf.keras.Input(shape=(None, None, self.n_chans)))
self.inputs.append(tf.keras.Input(shape=(36, 36, self.n_chans))) # self.inputs.append(tf.keras.Input(shape=(36, 36, self.n_chans)))
self.DISK_CACHE = False self.DISK_CACHE = False
...@@ -247,17 +248,24 @@ class ESPCN: ...@@ -247,17 +248,24 @@ class ESPCN:
label = label[:, label_idx, :, :] label = label[:, label_idx, :, :]
label = np.expand_dims(label, axis=3) label = np.expand_dims(label, axis=3)
data = data[:, data_idx, :, :]
data = np.expand_dims(data, axis=3)
data = data.astype(np.float32) data = data.astype(np.float32)
label = label.astype(np.float32) label = label.astype(np.float32)
data_norm = [] # data_norm = []
for k, param in enumerate(emis_params): # for k, param in enumerate(emis_params):
tmp = normalize(data[:, k, :, :], param, mean_std_dct) # tmp = normalize(data[:, k, :, :], param, mean_std_dct)
data_norm.append(tmp) # data_norm.append(tmp)
data = np.stack(data_norm, axis=3) # data = np.stack(data_norm, axis=3)
#
# if label_param != 'cloud_fraction':
# label = scale(label, label_param, mean_std_dct)
data = normalize(data, data_param, mean_std_dct)
if label_param != 'cloud_fraction': if label_param != 'cloud_fraction':
label = scale(label, label_param, mean_std_dct) label = normalize(label, label_param, mean_std_dct)
if is_training and DO_AUGMENT: if is_training and DO_AUGMENT:
data_ud = np.flip(data, axis=1) data_ud = np.flip(data, axis=1)
......
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