diff --git a/modules/deeplearning/cloud_opd_srcnn_viirs.py b/modules/deeplearning/cloud_opd_srcnn_viirs.py index 9c0d4e58d8b9f84ec1cd13e1f95db81501cf31c8..60c6333402ac3489b5d22da4f3175c2394a3a711 100644 --- a/modules/deeplearning/cloud_opd_srcnn_viirs.py +++ b/modules/deeplearning/cloud_opd_srcnn_viirs.py @@ -741,20 +741,20 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): # refl_hi = np.squeeze(refl_hi) # refl_avg = np.squeeze(refl_avg) - cld_opd = np.where(np.isnan(cld_opd), 0, cld_opd) - cld_opd = cld_opd[nn.slc_y_2, nn.slc_x_2] - cld_opd = np.expand_dims(cld_opd, axis=0) - cld_opd = nn.upsample(cld_opd) - cld_opd = smooth_2d(cld_opd) - cld_opd = normalize(cld_opd, label_param, mean_std_dct) - - # cld_opd = np.where(np.isnan(cld_opd_orig), 0, cld_opd_orig) - # cld_opd = cld_opd[nn.slc_y_m, nn.slc_x_m] + # cld_opd = np.where(np.isnan(cld_opd), 0, cld_opd) + # cld_opd = cld_opd[nn.slc_y_2, nn.slc_x_2] # cld_opd = np.expand_dims(cld_opd, axis=0) # cld_opd = nn.upsample(cld_opd) # cld_opd = smooth_2d(cld_opd) # cld_opd = normalize(cld_opd, label_param, mean_std_dct) + cld_opd = np.where(np.isnan(cld_opd_orig), 0, cld_opd_orig) + cld_opd = cld_opd[nn.slc_y_m, nn.slc_x_m] + cld_opd = np.expand_dims(cld_opd, axis=0) + cld_opd = nn.upsample(cld_opd) + cld_opd = smooth_2d(cld_opd) + cld_opd = normalize(cld_opd, label_param, mean_std_dct) + data = np.stack([bt, refl, cld_opd], axis=3) print('input data shape: ', data.shape) @@ -765,19 +765,19 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): # cld_opd_sres = descale(cld_opd_sres, label_param, mean_std_dct) _, ylen, xlen, _ = cld_opd_sres.shape - # cld_opd_sres_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) - # refl_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) - # cld_opd_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) - # - # cld_opd_sres_out[border:(border+ylen), border:(border+xlen)] = cld_opd_sres[0, :, :, 0] - # refl_out[0:(ylen+2*border), 0:(xlen+2*border)] = refl[0, :, :] - # cld_opd_out[0:(ylen+2*border), 0:(xlen+2*border)] = cld_opd[0, :, :] - - cld_opd_sres_out = cld_opd_sres[0, :, :, 0] - refl_out = refl[0, :, :] - cld_opd_out = cld_opd[0, :, :] - cld_opd_hres = cld_opd_hres - print(cld_opd_sres_out.shape, refl_out.shape, cld_opd_out.shape, cld_opd_hres.shape) + cld_opd_sres_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) + refl_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) + cld_opd_out = np.zeros((LEN_Y, LEN_X), dtype=np.float32) + + cld_opd_sres_out[border:(border+ylen), border:(border+xlen)] = cld_opd_sres[0, :, :, 0] + refl_out[0:(ylen+2*border), 0:(xlen+2*border)] = refl[0, :, :] + cld_opd_out[0:(ylen+2*border), 0:(xlen+2*border)] = cld_opd[0, :, :] + + # cld_opd_sres_out = cld_opd_sres[0, :, :, 0] + # refl_out = refl[0, :, :] + # cld_opd_out = cld_opd[0, :, :] + # cld_opd_hres = cld_opd_hres + # print(cld_opd_sres_out.shape, refl_out.shape, cld_opd_out.shape, cld_opd_hres.shape) refl_out = denormalize(refl_out, 'refl_0_65um_nom', mean_std_dct) cld_opd_out = denormalize(cld_opd_out, label_param, mean_std_dct)