From 5da5f55a3c14b94c8a09daac0164adef37832258 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 19 Dec 2022 12:50:51 -0600 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 4331bd96..876207d6 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -2586,15 +2586,14 @@ def analyze(preds_file, labels, prob_avg, test_file): iint = np.where(iint == -1, 0, iint) iint = np.where(iint != 0, 1, iint) - nda[np.logical_and(nda >= 0, nda < 4000)] = 0 - nda[np.logical_and(nda >= 4000, nda < 15000)] = 1 - # nda[np.logical_and(nda >= 8000, nda < 15000)] = 2 + nda[np.logical_and(nda >= 0, nda < 2000)] = 0 + nda[np.logical_and(nda >= 2000, nda < 4000)] = 1 + nda[np.logical_and(nda >= 4000, nda < 15000)] = 2 - #print(np.sum(nda == 0), np.sum(nda == 1), np.sum(nda == 2)) - print(np.sum(nda == 0), np.sum(nda == 1)) - print('No icing: ', np.histogram(nda[iint == 0], bins=2)[0]) + print(np.sum(nda == 0), np.sum(nda == 1), np.sum(nda == 2)) + print('No icing: ', np.sum((iint == 0) & (nda == 0)), np.sum((iint == 0) & (nda == 1))) print('---------------------------') - print('Icing: ', np.histogram(nda[iint == 1], bins=2)[0]) + print('Icing: ', np.sum((iint == 1) & (nda == 0)), np.sum((iint == 1) & (nda == 1))) print('---------------------------') print('No Icing(Negative): mean cld_dz, cld_hgt') @@ -2630,9 +2629,9 @@ def analyze(preds_file, labels, prob_avg, test_file): false_no_ice = (labels == 1) & (preds == 0) print('Total (Positive/Icing Prediction: ') - print('True icing: ', np.histogram(nda[true_ice], bins=2)[0]) + print('True icing: ', np.sum(true_ice & (nda == 0)), np.sum(true_ice & (nda == 1))) print('-------------------------') - print('False no icing (False Negative/Miss): ', np.histogram(nda[false_no_ice], bins=2)[0]) + print('False no icing (False Negative/Miss): ', np.sum(false_no_ice & (nda == 0)), np.sum(false_no_ice & (nda == 1))) print('By flight level:') print('No Icing(Negative): mean cld_dz, cld_hgt') print('Icing(Positive): ", "') @@ -2655,9 +2654,9 @@ def analyze(preds_file, labels, prob_avg, test_file): print('---------------------------------------------------') print('Total (Negative/No Icing Prediction: ') - print('True no icing: ', np.histogram(nda[true_no_ice], bins=2)[0]) + print('True no icing: ', np.sum(true_no_ice & (nda == 0)), np.sum(true_no_ice & (nda == 1))) print('-------------------------') - print('* False icing (False Positive/False Alarm) *: ', np.histogram(nda[false_ice], bins=2)[0]) + print('* False icing (False Positive/False Alarm) *: ', np.sum(false_ice & (nda == 0)), np.sum(false_ice & (nda == 1))) print('-------------------------') print('level 0: ') -- GitLab