diff --git a/modules/deeplearning/srcnn_cld_frac.py b/modules/deeplearning/srcnn_cld_frac.py index 44291292958d02b695b4155a55b01ad1d0f2d399..b5dc81f03eb19259441e8201da4e03d04160fbd3 100644 --- a/modules/deeplearning/srcnn_cld_frac.py +++ b/modules/deeplearning/srcnn_cld_frac.py @@ -37,8 +37,6 @@ NOISE_TRAINING = False NOISE_STDDEV = 0.01 DO_AUGMENT = True -DO_SMOOTH = False -SIGMA = 1.0 DO_ZERO_OUT = False DO_ESPCN = False # Note: If True, cannot do mixed resolution input fields (Adjust accordingly below) @@ -138,7 +136,7 @@ def upsample(tmp): return tmp -def upsample_nearest(grd): +def upsample_mean(grd): bsize, ylen, xlen = grd.shape grd = get_grid_cell_mean(grd) up = np.zeros(bsize, ylen, xlen) @@ -345,13 +343,13 @@ class SRCNN: tmp = input_data[:, label_idx, :, :] tmp = tmp.copy() tmp = np.where(np.isnan(tmp), 0, tmp) - if DO_SMOOTH: - tmp = smooth_2d(tmp, sigma=SIGMA) - # tmp = median_filter_2d(tmp) + if DO_ESPCN: tmp = tmp[:, slc_y_2, slc_x_2] else: # Half res upsampled to full res: - tmp = upsample(tmp) + # tmp = upsample(tmp) + tmp = upsample_mean(tmp) + tmp = tmp[:, slc_y, slc_x] if label_param != 'cloud_probability': tmp = normalize(tmp, label_param, mean_std_dct) if DO_ADD_NOISE: