diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index 8ee5510309cb9db795193b5fa8a11814b17b999b..49f53adae0aa3f32c56945144cb56a41c1b73134 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -268,7 +268,7 @@ class SRCNN: data_norm.append(tmp) # -------- tmp = input_data[:, label_idx, slc_y_2, slc_x_2] - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': tmp = normalize(tmp, label_param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) else: tmp = np.where(np.isnan(tmp), 0, tmp) @@ -280,7 +280,7 @@ class SRCNN: # ----------------------------------------------------- # ----------------------------------------------------- label = input_data[:, label_idx, slc_y, slc_x] - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': label = normalize(label, label_param, mean_std_dct) else: label = np.where(np.isnan(label), 0, label) @@ -730,7 +730,7 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): grd_c = get_grid_values_all(h5f, label_param) grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x] grd_c = grd_c[slc_y_2, slc_x_2] - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': grd_c = normalize(grd_c, label_param, mean_std_dct) grd_c = resample_2d_linear_one(x_2, y_2, grd_c, t, s) @@ -739,7 +739,7 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): nn = SRCNN() out_sr = nn.run_evaluate(data, ckpt_dir) - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': out_sr = denormalize(out_sr, label_param, mean_std_dct) if out_file is not None: np.save(out_file, out_sr) @@ -762,7 +762,7 @@ def run_evaluate_static_2(in_file, out_file, ckpt_dir): grd_c = nda[:, 3, :, :] grd_c = grd_c[:, slc_y_2, slc_x_2] - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': grd_c = normalize(grd_c, label_param, mean_std_dct) grd_c = resample_2d_linear(x_2, y_2, grd_c, t, s) @@ -771,7 +771,7 @@ def run_evaluate_static_2(in_file, out_file, ckpt_dir): nn = SRCNN() out_sr = nn.run_evaluate(data, ckpt_dir) - if label_param != 'cloud_fraction': + if label_param != 'cloud_probability': out_sr = denormalize(out_sr, label_param, mean_std_dct) pass if out_file is not None: @@ -780,7 +780,7 @@ def run_evaluate_static_2(in_file, out_file, ckpt_dir): return out_sr -def analyze(fpath='/Users/tomrink/clavrx_snpp_viirs.A2019080.0100.001.2019080064252.uwssec_B00038315.level2.h5', param='cloud_fraction'): +def analyze(fpath='/Users/tomrink/clavrx_snpp_viirs.A2019080.0100.001.2019080064252.uwssec_B00038315.level2.h5', param='cloud_probability'): h5f = h5py.File(fpath, 'r') grd = get_grid_values_all(h5f, param) grd = np.where(np.isnan(grd), 0, grd) @@ -796,7 +796,7 @@ def analyze(fpath='/Users/tomrink/clavrx_snpp_viirs.A2019080.0100.001.2019080064 leny, lenx = grd_lr.shape rnd = np.random.normal(loc=0, scale=0.001, size=grd_lr.size) grd_lr = grd_lr + rnd.reshape(grd_lr.shape) - if param == 'cloud_fraction': + if param == 'cloud_probability': grd_lr = np.where(grd_lr < 0, 0, grd_lr) grd_lr = np.where(grd_lr > 1, 1, grd_lr)