From 157d51eee3e19b0defaa4949322a092013145b2c Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Fri, 17 Feb 2023 13:52:31 -0600 Subject: [PATCH] snapshot... --- modules/deeplearning/cnn_cld_frac.py | 58 ++++++++++++++++++---------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/modules/deeplearning/cnn_cld_frac.py b/modules/deeplearning/cnn_cld_frac.py index 5c885ee4..34ff0e47 100644 --- a/modules/deeplearning/cnn_cld_frac.py +++ b/modules/deeplearning/cnn_cld_frac.py @@ -1041,32 +1041,50 @@ def analyze2(nda_m, nda_i): for j in range(1, 65): for i in range(1, 65): sum = nda_m[j-1:j+2, i-1:i+2] - cf_m[j-1, i-1] = sum/9 + # cf_m[j-1, i-1] = sum/9 + cf_m[j-1, i-1] = sum sum = nda_i[j*2-1:j*2+3, i*2-1:i*2+3] - cf_i[j-1, i-1] = sum/16 - - cat_0 = cf_m == 0 - cat_1 = (cf_m >= 0.1) & (cf_m < 0.13) - cat_2 = (cf_m >= 0.2) & (cf_m < 0.23) - cat_3 = (cf_m >= 0.3) & (cf_m < 0.34) - cat_4 = (cf_m >= 0.4) & (cf_m < 0.45) - cat_5 = (cf_m >= 0.5) & (cf_m < 0.56) - cat_6 = (cf_m >= 0.6) & (cf_m < 0.67) - cat_7 = (cf_m >= 0.7) & (cf_m < 0.78) - cat_8 = (cf_m >= 0.8) & (cf_m < 0.89) - cat_9 = cf_m == 1.0 + # cf_i[j-1, i-1] = sum/16 + cf_i[j-1, i-1] = sum + + # cat_0 = cf_m == 0 + # cat_1 = (cf_m >= 0.1) & (cf_m < 0.13) + # cat_2 = (cf_m >= 0.2) & (cf_m < 0.23) + # cat_3 = (cf_m >= 0.3) & (cf_m < 0.34) + # cat_4 = (cf_m >= 0.4) & (cf_m < 0.45) + # cat_5 = (cf_m >= 0.5) & (cf_m < 0.56) + # cat_6 = (cf_m >= 0.6) & (cf_m < 0.67) + # cat_7 = (cf_m >= 0.7) & (cf_m < 0.78) + # cat_8 = (cf_m >= 0.8) & (cf_m < 0.89) + # cat_9 = cf_m == 1.0 + # + # cf_m[cat_0] = 0 + # cf_m[cat_1] = 1 + # cf_m[cat_2] = 2 + # cf_m[cat_3] = 3 + # cf_m[cat_4] = 4 + # cf_m[cat_5] = 5 + # cf_m[cat_6] = 6 + # cf_m[cat_7] = 7 + # cf_m[cat_8] = 8 + # cf_m[cat_9] = 9 + + cat_0 = (cf_m == 0) + cat_1 = (cf_m > 0) & (cf_m < 9) + cat_2 = cf_m == 9 cf_m[cat_0] = 0 cf_m[cat_1] = 1 cf_m[cat_2] = 2 - cf_m[cat_3] = 3 - cf_m[cat_4] = 4 - cf_m[cat_5] = 5 - cf_m[cat_6] = 6 - cf_m[cat_7] = 7 - cf_m[cat_8] = 8 - cf_m[cat_9] = 9 + + cat_0 = (cf_i == 0) + cat_1 = (cf_i > 0) & (cf_i < 16) + cat_2 = cf_i == 16 + + cf_i[cat_0] = 0 + cf_i[cat_1] = 1 + cf_i[cat_2] = 2 if __name__ == "__main__": -- GitLab