From 426da690a26b4bc93ec1a5b4cbf0b3c90a613c1b Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 8 Apr 2022 14:55:33 -0600 Subject: [PATCH 01/31] Per #2022: Added ANOM_CORR, ANOM_CORR_BCL, ANOM_CORR_BCU to vcnt_columns. SL --- met/src/basic/vx_util/stat_column_defs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/met/src/basic/vx_util/stat_column_defs.h b/met/src/basic/vx_util/stat_column_defs.h index 130f41bcb1..62f1f6dc9e 100644 --- a/met/src/basic/vx_util/stat_column_defs.h +++ b/met/src/basic/vx_util/stat_column_defs.h @@ -155,6 +155,7 @@ static const char * vcnt_columns [] = { "SPEED_ABSERR", "SPEED_ABSERR_BCL", "SPEED_ABSERR_BCU", "DIR_ERR", "DIR_ERR_BCL", "DIR_ERR_BCU", "DIR_ABSERR", "DIR_ABSERR_BCL", "DIR_ABSERR_BCU", + "ANOM_CORR", "ANOM_CORR_BCL", "ANOM_CORR_BCU", }; From 2cede27ac44c2d870a60c4531ca84ebeb384e821 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 8 Apr 2022 15:07:35 -0600 Subject: [PATCH 02/31] Per #2022: Added ANOM_CORR, ANOM_CORR_BCL, ANOM_CORR_BCU to write_vcnt_cols. SL --- met/src/libcode/vx_stat_out/stat_columns.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index c09d6aab51..fa348a9e02 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2953,6 +2953,7 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) // SPD_ABSERR, SPD_ABSERR_BCL, SPD_ABSERR_BCU, // DIR_ERR, DIR_ERR_BCL, DIR_ERR_BCU, // DIR_ABSERR, DIR_ABSERR_BCL, DIR_ABSERR_BCU, + // ANOM_CORR, ANOM_CORR_BCL, ANOM_CORR_BCU at.set_entry(r, c++, vcnt_info.vcount); // TOTAL @@ -3028,7 +3029,11 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) at.set_entry(r, c++, vcnt_info.DIR_ABSERR); // DIR_ABSERR at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCL at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCU - + + at.set_entry(r, c++, vcnt_info.ANOM_CORR); // ANOM_CORR + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU + // // // From dd969a83f5fee2f43ceb487a8f2de037dbb07648 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 8 Apr 2022 15:09:52 -0600 Subject: [PATCH 03/31] Per #2022: Added ANOM_CORR to VL1L2Info. SL --- met/src/libcode/vx_statistics/met_stats.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/met/src/libcode/vx_statistics/met_stats.h b/met/src/libcode/vx_statistics/met_stats.h index 77a245c6f4..99390c9cab 100644 --- a/met/src/libcode/vx_statistics/met_stats.h +++ b/met/src/libcode/vx_statistics/met_stats.h @@ -319,6 +319,8 @@ class VL1L2Info { double DIR_ERR; double DIR_ABSERR; + double ANOM_CORR; + // // extra VL1L2 quantities for NCEP // From afd53d217e064c6c4d6ec818ce07d99f289968e1 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Mon, 11 Apr 2022 11:54:19 -0600 Subject: [PATCH 04/31] Per #2022: updated the VL1L2Info functions to initialize and compute ANOM_CORR. SL --- met/src/libcode/vx_statistics/met_stats.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index a5eae44574..24e46a7fa1 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1420,6 +1420,8 @@ void VL1L2Info::zero_out() { DIR_ERR = 0.0; DIR_ABSERR = 0.0; + ANOM_CORR = 0.0; + vcount = 0; // @@ -1525,6 +1527,8 @@ void VL1L2Info::assign(const VL1L2Info &c) { DIR_ERR = c.DIR_ERR; DIR_ABSERR = c.DIR_ABSERR; + ANOM_CORR = c.ANOM_CORR; + return; } @@ -1569,6 +1573,8 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR = fabs(DIR_ERR); + ANOM_CORR = uvfoa_bar / (sqrt(uvffa_bar * uvooa_bar)); + return; } @@ -1708,6 +1714,8 @@ void VL1L2Info::set(const PairDataPoint &pd_u_all, DIR_ERR = bad_data_double; DIR_ABSERR = bad_data_double; + ANOM_CORR = bad_data_double; + } else { rmse = sqrt(mse); } @@ -1749,6 +1757,7 @@ double VL1L2Info::get_stat(const char *stat_name) { else if(strcmp(stat_name, "SPEED_ABSERR") == 0) v = SPEED_ABSERR; else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR; else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR; + else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR; else { mlog << Error << "\nVL1L2Info::get_stat() -> " << "unknown continuous statistic name \"" << stat_name From 2b109502a82124ae767771b6b950ee7bf4c80ebd Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Mon, 11 Apr 2022 15:47:07 -0600 Subject: [PATCH 05/31] Per #2022: in calc_ncep_stats modified calculation for ANOM_CORR to check for bad data in the denominator first. SL --- met/src/libcode/vx_statistics/met_stats.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 24e46a7fa1..719ecd6b56 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1573,7 +1573,14 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR = fabs(DIR_ERR); - ANOM_CORR = uvfoa_bar / (sqrt(uvffa_bar * uvooa_bar)); + // Anomaly Correlation Coefficient + // Check for bad data in the denominator first + if(!is_bad_data(uvffa_bar) && !is_bad_data(uvooa_bar)) { + double den = sqrt(uvffa_bar * uvooa_bar); + + if(!is_eq(den, 0.0)) + ANOM_CORR = uvfoa_bar / den; + } return; } From aa81251bd0d421b35b5de434e37bf1202c1d89f0 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 15 Apr 2022 12:25:57 -0600 Subject: [PATCH 06/31] Per #2022: for the VL1L2Info, changed all derived VCNT variables to be CIInfo objects (instead of doubles). SL --- met/src/libcode/vx_statistics/met_stats.h | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.h b/met/src/libcode/vx_statistics/met_stats.h index 99390c9cab..ddc2d201a3 100644 --- a/met/src/libcode/vx_statistics/met_stats.h +++ b/met/src/libcode/vx_statistics/met_stats.h @@ -266,13 +266,13 @@ class VL1L2Info { void calc_ncep_stats(); - // Filtering thresholds + // Filtering thresholds SingleThresh fthresh; SingleThresh othresh; SetLogic logic; - // VL1L2 Quantities + // VL1L2 Quantities double uf_bar; double vf_bar; @@ -283,47 +283,47 @@ class VL1L2Info { double uvff_bar; double uvoo_bar; - // New VL1L2 Quantities added from vector stats whitepaper + // New VL1L2 Quantities added from vector stats whitepaper double f_speed_bar; double o_speed_bar; - // New VL1L2 Quantities added from vector stats whitepaper + // New VL1L2 Quantities added from vector stats whitepaper - double FBAR; - double OBAR; + CIInfo FBAR; + CIInfo OBAR; - double FS_RMS; - double OS_RMS; + CIInfo FS_RMS; + CIInfo OS_RMS; - double MSVE; - double RMSVE; + CIInfo MSVE; + CIInfo RMSVE; - double FSTDEV; - double OSTDEV; + CIInfo FSTDEV; + CIInfo OSTDEV; - // double COV; + // CIInfo COV; - double FDIR; - double ODIR; + CIInfo FDIR; + CIInfo ODIR; - double FBAR_SPEED; - double OBAR_SPEED; + CIInfo FBAR_SPEED; + CIInfo OBAR_SPEED; - double VDIFF_SPEED; - double VDIFF_DIR; + CIInfo VDIFF_SPEED; + CIInfo VDIFF_DIR; - double SPEED_ERR; - double SPEED_ABSERR; + CIInfo SPEED_ERR; + CIInfo SPEED_ABSERR; - double DIR_ERR; - double DIR_ABSERR; + CIInfo DIR_ERR; + CIInfo DIR_ABSERR; - double ANOM_CORR; + CIInfo ANOM_CORR; - // - // extra VL1L2 quantities for NCEP - // + // + // extra VL1L2 quantities for NCEP + // double f_bar; // fcst wind speed double o_bar; // obs wind speed From ba3665f6a748eeeabeb65cd8957233259a744fbf Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 15 Apr 2022 14:08:55 -0600 Subject: [PATCH 07/31] Per #2022: making changes to VL1L2Info related to making all VCTN variables CIInfo objects. In progress. SL --- met/src/libcode/vx_statistics/met_stats.cc | 148 +++++++++++++-------- met/src/libcode/vx_statistics/met_stats.h | 16 ++- 2 files changed, 108 insertions(+), 56 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 719ecd6b56..ac43dd5402 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1304,6 +1304,8 @@ VL1L2Info::~VL1L2Info() { VL1L2Info::VL1L2Info(const VL1L2Info &c) { + alpha = (double *) 0; + init_from_scratch(); assign(c); @@ -1393,35 +1395,6 @@ void VL1L2Info::zero_out() { rmse = 0.0; speed_bias = 0.0; - FBAR = 0.0; - OBAR = 0.0; - - FS_RMS = 0.0; - OS_RMS = 0.0; - - MSVE = 0.0; - RMSVE = 0.0; - - FSTDEV = 0.0; - OSTDEV = 0.0; - - FDIR = 0.0; - ODIR = 0.0; - - FBAR_SPEED = 0.0; - OBAR_SPEED = 0.0; - - VDIFF_SPEED = 0.0; - VDIFF_DIR = 0.0; - - SPEED_ERR = 0.0; - SPEED_ABSERR = 0.0; - - DIR_ERR = 0.0; - DIR_ABSERR = 0.0; - - ANOM_CORR = 0.0; - vcount = 0; // @@ -1445,10 +1418,34 @@ void VL1L2Info::zero_out() { void VL1L2Info::clear() { + n = 0; + n_alpha = 0; + if(alpha) { delete [] alpha; alpha = (double *) 0; } + fthresh.clear(); othresh.clear(); logic = SetLogic_None; + FBAR.clear(); + OBAR.clear(); + FS_RMS.clear(); + OS_RMS.clear(); + MSVE.clear(); + RMSVE.clear(); + FSTDEV.clear(); + OSTDEV.clear(); + FDIR.clear(); + ODIR.clear(); + FBAR_SPEED.clear(); + OBAR_SPEED.clear(); + VDIFF_SPEED.clear(); + VDIFF_DIR.clear(); + SPEED_ERR.clear(); + SPEED_ABSERR.clear(); + DIR_ERR.clear(); + DIR_ABSERR.clear(); + ANOM_CORR.clear(); + zero_out(); return; @@ -1464,6 +1461,10 @@ void VL1L2Info::assign(const VL1L2Info &c) { othresh = c.othresh; logic = c.logic; + n = c.n; + allocate_n_alpha(c.n_alpha); + for(i=0; i 0) { + + alpha = new double [n_alpha]; + + if(!alpha) { + mlog << Error << "\nVL1L2Info::allocate_n_alpha() -> " + << "Memory allocation error!\n\n"; + exit(1); + } + + FBAR.allocate_n_alpha(n_alpha); + OBAR.allocate_n_alpha(n_alpha); + FS_RMS.allocate_n_alpha(n_alpha); + OS_RMS.allocate_n_alpha(n_alpha); + MSVE.allocate_n_alpha(n_alpha); + RMSVE.allocate_n_alpha(n_alpha); + FSTDEV.allocate_n_alpha(n_alpha); + OSTDEV.allocate_n_alpha(n_alpha); + FDIR.allocate_n_alpha(n_alpha); + ODIR.allocate_n_alpha(n_alpha); + FBAR_SPEED.allocate_n_alpha(n_alpha); + OBAR_SPEED.allocate_n_alpha(n_alpha); + VDIFF_SPEED.allocate_n_alpha(n_alpha); + VDIFF_DIR.allocate_n_alpha(n_alpha); + SPEED_ERR.allocate_n_alpha(n_alpha); + SPEED_ABSERR.allocate_n_alpha(n_alpha); + DIR_ERR.allocate_n_alpha(n_alpha); + DIR_ABSERR.allocate_n_alpha(n_alpha); + ANOM_CORR.allocate_n_alpha(n_alpha); + } + + return; +} + +//////////////////////////////////////////////////////////////////////// + + void VL1L2Info::calc_ncep_stats() { double u_diff, v_diff; int n = vcount; @@ -1694,34 +1736,34 @@ void VL1L2Info::set(const PairDataPoint &pd_u_all, rmse = bad_data_double; speed_bias = bad_data_double; - FBAR = bad_data_double; - OBAR = bad_data_double; + //FBAR = bad_data_double; + //OBAR = bad_data_double; - FS_RMS = bad_data_double; - OS_RMS = bad_data_double; + //FS_RMS = bad_data_double; + //OS_RMS = bad_data_double; - MSVE = bad_data_double; - RMSVE = bad_data_double; + //MSVE = bad_data_double; + //RMSVE = bad_data_double; - FSTDEV = bad_data_double; - OSTDEV = bad_data_double; + //FSTDEV = bad_data_double; + //OSTDEV = bad_data_double; - FDIR = bad_data_double; - ODIR = bad_data_double; + //FDIR = bad_data_double; + //ODIR = bad_data_double; - FBAR_SPEED = bad_data_double; - OBAR_SPEED = bad_data_double; + //FBAR_SPEED = bad_data_double; + //OBAR_SPEED = bad_data_double; - VDIFF_SPEED = bad_data_double; - VDIFF_DIR = bad_data_double; + //VDIFF_SPEED = bad_data_double; + //VDIFF_DIR = bad_data_double; - SPEED_ERR = bad_data_double; - SPEED_ABSERR = bad_data_double; + //SPEED_ERR = bad_data_double; + //SPEED_ABSERR = bad_data_double; - DIR_ERR = bad_data_double; - DIR_ABSERR = bad_data_double; + //DIR_ERR = bad_data_double; + //DIR_ABSERR = bad_data_double; - ANOM_CORR = bad_data_double; + //ANOM_CORR = bad_data_double; } else { rmse = sqrt(mse); diff --git a/met/src/libcode/vx_statistics/met_stats.h b/met/src/libcode/vx_statistics/met_stats.h index ddc2d201a3..d4101afc4e 100644 --- a/met/src/libcode/vx_statistics/met_stats.h +++ b/met/src/libcode/vx_statistics/met_stats.h @@ -264,14 +264,19 @@ class VL1L2Info { VL1L2Info & operator=(const VL1L2Info &); VL1L2Info & operator+=(const VL1L2Info &); - void calc_ncep_stats(); - // Filtering thresholds SingleThresh fthresh; SingleThresh othresh; SetLogic logic; + // Confidence interval alpha values + int n_alpha; + double *alpha; + + // Number of points + int n; + // VL1L2 Quantities double uf_bar; @@ -352,8 +357,13 @@ class VL1L2Info { // Compute sums void set(const PairDataPoint &, const PairDataPoint &); - void zero_out(); + // Calc stats + void calc_ncep_stats(); + void clear(); + void zero_out(); + void allocate_n_alpha(int); + void compute_ci(); double get_stat(const char *); }; From ab949fa5e776062889bea4fa84b6fd9ce2d41ae6 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 15 Apr 2022 14:33:57 -0600 Subject: [PATCH 08/31] Per #2022: Added ANOM_CORR_UNCNTR. SL --- met/src/libcode/vx_statistics/met_stats.cc | 6 +++++- met/src/libcode/vx_statistics/met_stats.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index ac43dd5402..066e8e272a 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1445,6 +1445,7 @@ void VL1L2Info::clear() { DIR_ERR.clear(); DIR_ABSERR.clear(); ANOM_CORR.clear(); + ANOM_CORR_UNCNTR.clear(); zero_out(); @@ -1529,6 +1530,7 @@ void VL1L2Info::assign(const VL1L2Info &c) { DIR_ABSERR = c.DIR_ABSERR; ANOM_CORR = c.ANOM_CORR; + ANOM_CORR_UNCNTR = c.ANOM_CORR_UNCNTR; return; } @@ -1569,6 +1571,7 @@ void VL1L2Info::allocate_n_alpha(int i) { DIR_ERR.allocate_n_alpha(n_alpha); DIR_ABSERR.allocate_n_alpha(n_alpha); ANOM_CORR.allocate_n_alpha(n_alpha); + ANOM_CORR_UNCNTR.allocate_n_alpha(n_alpha); } return; @@ -1621,7 +1624,7 @@ void VL1L2Info::calc_ncep_stats() { double den = sqrt(uvffa_bar * uvooa_bar); if(!is_eq(den, 0.0)) - ANOM_CORR = uvfoa_bar / den; + ANOM_CORR_UNCNTR = uvfoa_bar / den; } return; @@ -1807,6 +1810,7 @@ double VL1L2Info::get_stat(const char *stat_name) { else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR; else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR; else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR; + else if(strcmp(stat_name, "ANOM_CORR_UNCNTR" ) == 0) v = ANOM_CORR_UNCNTR; else { mlog << Error << "\nVL1L2Info::get_stat() -> " << "unknown continuous statistic name \"" << stat_name diff --git a/met/src/libcode/vx_statistics/met_stats.h b/met/src/libcode/vx_statistics/met_stats.h index d4101afc4e..1515c8df12 100644 --- a/met/src/libcode/vx_statistics/met_stats.h +++ b/met/src/libcode/vx_statistics/met_stats.h @@ -325,7 +325,8 @@ class VL1L2Info { CIInfo DIR_ABSERR; CIInfo ANOM_CORR; - + CIInfo ANOM_CORR_UNCNTR; + // // extra VL1L2 quantities for NCEP // From 53ada14c54699152416057da5428fe28a06e25de Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 12:25:37 -0600 Subject: [PATCH 09/31] Per issue 2022: Modified functions in the VL1L2Info class to set the NCEP stat variables correctly since they are now CIInfo class memembers. SL --- met/src/libcode/vx_statistics/met_stats.cc | 134 +++++++++++---------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 066e8e272a..027924a3a2 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1455,7 +1455,8 @@ void VL1L2Info::clear() { //////////////////////////////////////////////////////////////////////// void VL1L2Info::assign(const VL1L2Info &c) { - + int i; + clear(); fthresh = c.fthresh; @@ -1587,45 +1588,47 @@ void VL1L2Info::calc_ncep_stats() { u_diff = uf_bar - uo_bar; v_diff = vf_bar - vo_bar; - FBAR = f_speed_bar; - OBAR = o_speed_bar; + FBAR.v = f_speed_bar; + OBAR.v = o_speed_bar; - FS_RMS = sqrt(uvff_bar); - OS_RMS = sqrt(uvoo_bar); + FS_RMS.v = sqrt(uvff_bar); + OS_RMS.v = sqrt(uvoo_bar); - MSVE = uvff_bar - 2.0*uvfo_bar + uvoo_bar; + MSVE.v = uvff_bar - 2.0*uvfo_bar + uvoo_bar; - RMSVE = sqrt(MSVE); + RMSVE.v = sqrt(MSVE.v); - FSTDEV = compute_stdev(f_speed_bar*n, uvff_bar*n, n); - OSTDEV = compute_stdev(o_speed_bar*n, uvoo_bar*n, n); + FSTDEV.v = compute_stdev(f_speed_bar*n, uvff_bar*n, n); + OSTDEV.v = compute_stdev(o_speed_bar*n, uvoo_bar*n, n); - FDIR = convert_u_v_to_wdir(uf_bar, vf_bar); - ODIR = convert_u_v_to_wdir(uo_bar, vo_bar); + FDIR.v = convert_u_v_to_wdir(uf_bar, vf_bar); + ODIR.v = convert_u_v_to_wdir(uo_bar, vo_bar); - FBAR_SPEED = convert_u_v_to_wind(uf_bar, vf_bar); - OBAR_SPEED = convert_u_v_to_wind(uo_bar, vo_bar); + FBAR_SPEED.v = convert_u_v_to_wind(uf_bar, vf_bar); + OBAR_SPEED.v = convert_u_v_to_wind(uo_bar, vo_bar); - VDIFF_SPEED = convert_u_v_to_wind(u_diff, v_diff); + VDIFF_SPEED.v = convert_u_v_to_wind(u_diff, v_diff); - VDIFF_DIR = convert_u_v_to_wdir(u_diff, v_diff); + VDIFF_DIR.v = convert_u_v_to_wdir(u_diff, v_diff); - SPEED_ERR = FBAR_SPEED - OBAR_SPEED; + SPEED_ERR.v = FBAR_SPEED.v - OBAR_SPEED.v; - SPEED_ABSERR = fabs(SPEED_ERR); + SPEED_ABSERR.v = fabs(SPEED_ERR.v); - DIR_ERR = atan2d(vf_bar*uo_bar - uf_bar*vo_bar, uf_bar*uo_bar + vf_bar*vo_bar); + DIR_ERR.v = atan2d(vf_bar*uo_bar - uf_bar*vo_bar, uf_bar*uo_bar + vf_bar*vo_bar); - DIR_ABSERR = fabs(DIR_ERR); + DIR_ABSERR.v = fabs(DIR_ERR.v); + ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); + // Anomaly Correlation Coefficient // Check for bad data in the denominator first - if(!is_bad_data(uvffa_bar) && !is_bad_data(uvooa_bar)) { - double den = sqrt(uvffa_bar * uvooa_bar); - - if(!is_eq(den, 0.0)) - ANOM_CORR_UNCNTR = uvfoa_bar / den; - } + //if(!is_bad_data(uvffa_bar) && !is_bad_data(uvooa_bar)) { + // double den = sqrt(uvffa_bar * uvooa_bar); + // + // if(!is_eq(den, 0.0)) + // ANOM_CORR_UNCNTR = uvfoa_bar / den; + //} return; } @@ -1739,34 +1742,35 @@ void VL1L2Info::set(const PairDataPoint &pd_u_all, rmse = bad_data_double; speed_bias = bad_data_double; - //FBAR = bad_data_double; - //OBAR = bad_data_double; + FBAR.v = bad_data_double; + OBAR.v = bad_data_double; - //FS_RMS = bad_data_double; - //OS_RMS = bad_data_double; + FS_RMS.v = bad_data_double; + OS_RMS.v = bad_data_double; - //MSVE = bad_data_double; - //RMSVE = bad_data_double; + MSVE.v = bad_data_double; + RMSVE.v = bad_data_double; - //FSTDEV = bad_data_double; - //OSTDEV = bad_data_double; + FSTDEV.v = bad_data_double; + OSTDEV.v = bad_data_double; - //FDIR = bad_data_double; - //ODIR = bad_data_double; + FDIR.v = bad_data_double; + ODIR.v = bad_data_double; - //FBAR_SPEED = bad_data_double; - //OBAR_SPEED = bad_data_double; + FBAR_SPEED.v = bad_data_double; + OBAR_SPEED.v = bad_data_double; - //VDIFF_SPEED = bad_data_double; - //VDIFF_DIR = bad_data_double; - - //SPEED_ERR = bad_data_double; - //SPEED_ABSERR = bad_data_double; + VDIFF_SPEED.v = bad_data_double; + VDIFF_DIR.v = bad_data_double; + + SPEED_ERR.v = bad_data_double; + SPEED_ABSERR.v = bad_data_double; - //DIR_ERR = bad_data_double; - //DIR_ABSERR = bad_data_double; + DIR_ERR.v = bad_data_double; + DIR_ABSERR.v = bad_data_double; - //ANOM_CORR = bad_data_double; + ANOM_CORR.v = bad_data_double; + ANOM_CORR_UNCNTR.v = bad_data_double; } else { rmse = sqrt(mse); @@ -1791,26 +1795,26 @@ double VL1L2Info::get_stat(const char *stat_name) { double v = bad_data_double; if(strcmp(stat_name, "TOTAL" ) == 0) v = vcount; - else if(strcmp(stat_name, "FBAR" ) == 0) v = FBAR; - else if(strcmp(stat_name, "OBAR" ) == 0) v = OBAR; - else if(strcmp(stat_name, "FS_RMS" ) == 0) v = FS_RMS; - else if(strcmp(stat_name, "OS_RMS" ) == 0) v = OS_RMS; - else if(strcmp(stat_name, "MSVE" ) == 0) v = MSVE; - else if(strcmp(stat_name, "RMSVE" ) == 0) v = RMSVE; - else if(strcmp(stat_name, "FSTDEV" ) == 0) v = FSTDEV; - else if(strcmp(stat_name, "OSTDEV" ) == 0) v = OSTDEV; - else if(strcmp(stat_name, "FDIR" ) == 0) v = FDIR; - else if(strcmp(stat_name, "ODIR" ) == 0) v = ODIR; - else if(strcmp(stat_name, "FBAR_SPEED" ) == 0) v = FBAR_SPEED; - else if(strcmp(stat_name, "OBAR_SPEED" ) == 0) v = OBAR_SPEED; - else if(strcmp(stat_name, "VDIFF_SPEED" ) == 0) v = VDIFF_SPEED; - else if(strcmp(stat_name, "VDIFF_DIR" ) == 0) v = VDIFF_DIR; - else if(strcmp(stat_name, "SPEED_ERR" ) == 0) v = SPEED_ERR; - else if(strcmp(stat_name, "SPEED_ABSERR") == 0) v = SPEED_ABSERR; - else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR; - else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR; - else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR; - else if(strcmp(stat_name, "ANOM_CORR_UNCNTR" ) == 0) v = ANOM_CORR_UNCNTR; + else if(strcmp(stat_name, "FBAR" ) == 0) v = FBAR.v; + else if(strcmp(stat_name, "OBAR" ) == 0) v = OBAR.v; + else if(strcmp(stat_name, "FS_RMS" ) == 0) v = FS_RMS.v; + else if(strcmp(stat_name, "OS_RMS" ) == 0) v = OS_RMS.v; + else if(strcmp(stat_name, "MSVE" ) == 0) v = MSVE.v; + else if(strcmp(stat_name, "RMSVE" ) == 0) v = RMSVE.v; + else if(strcmp(stat_name, "FSTDEV" ) == 0) v = FSTDEV.v; + else if(strcmp(stat_name, "OSTDEV" ) == 0) v = OSTDEV.v; + else if(strcmp(stat_name, "FDIR" ) == 0) v = FDIR.v; + else if(strcmp(stat_name, "ODIR" ) == 0) v = ODIR.v; + else if(strcmp(stat_name, "FBAR_SPEED" ) == 0) v = FBAR_SPEED.v; + else if(strcmp(stat_name, "OBAR_SPEED" ) == 0) v = OBAR_SPEED.v; + else if(strcmp(stat_name, "VDIFF_SPEED" ) == 0) v = VDIFF_SPEED.v; + else if(strcmp(stat_name, "VDIFF_DIR" ) == 0) v = VDIFF_DIR.v; + else if(strcmp(stat_name, "SPEED_ERR" ) == 0) v = SPEED_ERR.v; + else if(strcmp(stat_name, "SPEED_ABSERR") == 0) v = SPEED_ABSERR.v; + else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR.v; + else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR.v; + else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR.v; + else if(strcmp(stat_name, "ANOM_CORR_UNCNTR" ) == 0) v = ANOM_CORR_UNCNTR.v; else { mlog << Error << "\nVL1L2Info::get_stat() -> " << "unknown continuous statistic name \"" << stat_name From 53d1785e8d755451939d2e13f1dd1a6b104fb14f Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 12:37:54 -0600 Subject: [PATCH 10/31] Per issue 2022: Added ANOM_CORR_UNCNTR (_BCL, _BCU). SL --- met/src/basic/vx_util/stat_column_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/met/src/basic/vx_util/stat_column_defs.h b/met/src/basic/vx_util/stat_column_defs.h index 62f1f6dc9e..993b15a573 100644 --- a/met/src/basic/vx_util/stat_column_defs.h +++ b/met/src/basic/vx_util/stat_column_defs.h @@ -156,7 +156,7 @@ static const char * vcnt_columns [] = { "DIR_ERR", "DIR_ERR_BCL", "DIR_ERR_BCU", "DIR_ABSERR", "DIR_ABSERR_BCL", "DIR_ABSERR_BCU", "ANOM_CORR", "ANOM_CORR_BCL", "ANOM_CORR_BCU", - + "ANOM_CORR_UNCNTR", "ANOM_CORR_UNCNTR_BCL", "ANOM_CORR_UNCNTR_BCU", }; static const char * pct_columns [] = { From 6423081afca90a96d4cdcdf471081fa7e62f33a8 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 12:44:22 -0600 Subject: [PATCH 11/31] Per issue 2022: modified write_vcnt_cols(), added ANOM_CORR_UNCNTR (_BCL, _BCU). SL --- met/src/libcode/vx_stat_out/stat_columns.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index fa348a9e02..131bf46fb1 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2954,6 +2954,7 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) // DIR_ERR, DIR_ERR_BCL, DIR_ERR_BCU, // DIR_ABSERR, DIR_ABSERR_BCL, DIR_ABSERR_BCU, // ANOM_CORR, ANOM_CORR_BCL, ANOM_CORR_BCU + // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU at.set_entry(r, c++, vcnt_info.vcount); // TOTAL @@ -3034,6 +3035,10 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU + at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR); // ANOM_CORR_UNCNTR + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCU + // // // From c6d0fd6cb64142f875109916fb1402b493f1a53a Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 15:03:11 -0600 Subject: [PATCH 12/31] Per issue #2022: updated write_vcnt_cols. VCNT variables are now CIInfo objects to have to .v for the value. SL --- met/src/libcode/vx_stat_out/stat_columns.cc | 40 ++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index 131bf46fb1..6ca5d1c3f0 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2959,83 +2959,83 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) at.set_entry(r, c++, vcnt_info.vcount); // TOTAL - at.set_entry(r, c++, vcnt_info.FBAR); // FBAR + at.set_entry(r, c++, vcnt_info.FBAR.v); // FBAR at.set_entry(r, c++, (string)na_str); // FBAR_BCL at.set_entry(r, c++, (string)na_str); // FBAR_BCU - at.set_entry(r, c++, vcnt_info.OBAR); // OBAR + at.set_entry(r, c++, vcnt_info.OBAR.v); // OBAR at.set_entry(r, c++, (string)na_str); // OBAR_BCL at.set_entry(r, c++, (string)na_str); // OBAR_BCU - at.set_entry(r, c++, vcnt_info.FS_RMS); // FS_RMS + at.set_entry(r, c++, vcnt_info.FS_RMS.v); // FS_RMS at.set_entry(r, c++, (string)na_str); // FS_RMS_BCL at.set_entry(r, c++, (string)na_str); // FS_RMS_BCU - at.set_entry(r, c++, vcnt_info.OS_RMS); // OS_RMS + at.set_entry(r, c++, vcnt_info.OS_RMS.v); // OS_RMS at.set_entry(r, c++, (string)na_str); // OS_RMS_BCL at.set_entry(r, c++, (string)na_str); // OS_RMS_BCU - at.set_entry(r, c++, vcnt_info.MSVE); // MSVE + at.set_entry(r, c++, vcnt_info.MSVE.v); // MSVE at.set_entry(r, c++, (string)na_str); // MSVE_BCL at.set_entry(r, c++, (string)na_str); // MSVE_BCU - at.set_entry(r, c++, vcnt_info.RMSVE); // RMSVE + at.set_entry(r, c++, vcnt_info.RMSVE.v); // RMSVE at.set_entry(r, c++, (string)na_str); // RMSVE_BCL at.set_entry(r, c++, (string)na_str); // RMSVE_BCU - at.set_entry(r, c++, vcnt_info.FSTDEV); // FSTDEV + at.set_entry(r, c++, vcnt_info.FSTDEV.v); // FSTDEV at.set_entry(r, c++, (string)na_str); // FSTDEV_BCL at.set_entry(r, c++, (string)na_str); // FSTDEV_BCU - at.set_entry(r, c++, vcnt_info.OSTDEV); // OSTDEV + at.set_entry(r, c++, vcnt_info.OSTDEV.v); // OSTDEV at.set_entry(r, c++, (string)na_str); // OSTDEV_BCL at.set_entry(r, c++, (string)na_str); // OSTDEV_BCU - at.set_entry(r, c++, vcnt_info.FDIR); // FDIR + at.set_entry(r, c++, vcnt_info.FDIR.v); // FDIR at.set_entry(r, c++, (string)na_str); // FDIR_BCL at.set_entry(r, c++, (string)na_str); // FDIR_BCU - at.set_entry(r, c++, vcnt_info.ODIR); // ODIR + at.set_entry(r, c++, vcnt_info.ODIR.v); // ODIR at.set_entry(r, c++, (string)na_str); // ODIR_BCL at.set_entry(r, c++, (string)na_str); // ODIR_BCU - at.set_entry(r, c++, vcnt_info.FBAR_SPEED); // FBAR_SPEED + at.set_entry(r, c++, vcnt_info.FBAR_SPEED.v); // FBAR_SPEED at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCL at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCU - at.set_entry(r, c++, vcnt_info.OBAR_SPEED); // OBAR_SPEED + at.set_entry(r, c++, vcnt_info.OBAR_SPEED.v); // OBAR_SPEED at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCL at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCU - at.set_entry(r, c++, vcnt_info.VDIFF_SPEED); // VDIFF_SPEED + at.set_entry(r, c++, vcnt_info.VDIFF_SPEED.v); // VDIFF_SPEED at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCL at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCU - at.set_entry(r, c++, vcnt_info.VDIFF_DIR); // VDIFF_DIR + at.set_entry(r, c++, vcnt_info.VDIFF_DIR.v); // VDIFF_DIR at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCL at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCU - at.set_entry(r, c++, vcnt_info.SPEED_ERR); // SPEED_ERR + at.set_entry(r, c++, vcnt_info.SPEED_ERR.v); // SPEED_ERR at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCL at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCU - at.set_entry(r, c++, vcnt_info.SPEED_ABSERR); // SPEED_ABSERR + at.set_entry(r, c++, vcnt_info.SPEED_ABSERR.v); // SPEED_ABSERR at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCL at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCU - at.set_entry(r, c++, vcnt_info.DIR_ERR); // DIR_ERR + at.set_entry(r, c++, vcnt_info.DIR_ERR.v); // DIR_ERR at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCL at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCU - at.set_entry(r, c++, vcnt_info.DIR_ABSERR); // DIR_ABSERR + at.set_entry(r, c++, vcnt_info.DIR_ABSERR.v); // DIR_ABSERR at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCL at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCU - at.set_entry(r, c++, vcnt_info.ANOM_CORR); // ANOM_CORR + at.set_entry(r, c++, vcnt_info.ANOM_CORR.v); // ANOM_CORR at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU - at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR); // ANOM_CORR_UNCNTR + at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR.v); // ANOM_CORR_UNCNTR at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCL at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCU From d447537d7fd5d75818d3b5625fb87a143a1cd16b Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 15:24:30 -0600 Subject: [PATCH 13/31] Per issue #2022: In calc_ncep_stats, put in place-holder for ANOM_CORR.v value SL --- met/src/libcode/vx_statistics/met_stats.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 027924a3a2..911cbb2770 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1619,16 +1619,11 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR.v = fabs(DIR_ERR.v); - ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); + // Place holde for now + ANOM_CORR.v = bad_data_double;; + //ANOM_CORR.v = compute_corr(); - // Anomaly Correlation Coefficient - // Check for bad data in the denominator first - //if(!is_bad_data(uvffa_bar) && !is_bad_data(uvooa_bar)) { - // double den = sqrt(uvffa_bar * uvooa_bar); - // - // if(!is_eq(den, 0.0)) - // ANOM_CORR_UNCNTR = uvfoa_bar / den; - //} + ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); return; } From 41361c77f169977edd90a329e32a20179c55c48a Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Thu, 28 Apr 2022 15:40:08 -0600 Subject: [PATCH 14/31] Per issue #2022: in calc_ncep_stats(), changed placeholder for ANOM_CORR. SL --- met/src/libcode/vx_statistics/met_stats.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 911cbb2770..5219a64dfc 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1619,11 +1619,11 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR.v = fabs(DIR_ERR.v); - // Place holde for now - ANOM_CORR.v = bad_data_double;; - //ANOM_CORR.v = compute_corr(); - ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); + + // Place holder for now + ANOM_CORR.v = ANOM_CORR_UNCNTR.v; + //ANOM_CORR.v = compute_corr(); return; } From 0d06de7547666b18b3d1cd3b797ad99986aab170 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 29 Apr 2022 09:32:22 -0600 Subject: [PATCH 15/31] Per issue #2022: moved alpha initialization to the init_from_scratch() function. SL --- met/src/libcode/vx_statistics/met_stats.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 5219a64dfc..583429cac1 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1304,8 +1304,6 @@ VL1L2Info::~VL1L2Info() { VL1L2Info::VL1L2Info(const VL1L2Info &c) { - alpha = (double *) 0; - init_from_scratch(); assign(c); @@ -1364,6 +1362,8 @@ VL1L2Info & VL1L2Info::operator+=(const VL1L2Info &c) { void VL1L2Info::init_from_scratch() { + alpha = (double *) 0; + clear(); return; From 822c4cc3e00f94b7fd2271ecac92a165dc43670b Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 29 Apr 2022 10:27:20 -0600 Subject: [PATCH 16/31] Per issue #2022: in calc_ncep_stats(), set ANOM_CORR to bad_data_double as a placeholder for now. SL --- met/src/libcode/vx_statistics/met_stats.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 583429cac1..8e557e8da0 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -1620,10 +1620,9 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR.v = fabs(DIR_ERR.v); ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); - - // Place holder for now - ANOM_CORR.v = ANOM_CORR_UNCNTR.v; - //ANOM_CORR.v = compute_corr(); + + // Placeholder. JHG will add correct input variable and call compute_corr() + ANOM_CORR.v = bad_data_double; return; } From e06e7ff0fafc3d754af9f6ca184b08a77a6aae90 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 29 Apr 2022 10:33:48 -0600 Subject: [PATCH 17/31] Per issue #2022: in vcnt_cols(), added ANOM_CORR_NCL/NCU. SL --- met/src/basic/vx_util/stat_column_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/met/src/basic/vx_util/stat_column_defs.h b/met/src/basic/vx_util/stat_column_defs.h index 993b15a573..64da8d011e 100644 --- a/met/src/basic/vx_util/stat_column_defs.h +++ b/met/src/basic/vx_util/stat_column_defs.h @@ -155,8 +155,8 @@ static const char * vcnt_columns [] = { "SPEED_ABSERR", "SPEED_ABSERR_BCL", "SPEED_ABSERR_BCU", "DIR_ERR", "DIR_ERR_BCL", "DIR_ERR_BCU", "DIR_ABSERR", "DIR_ABSERR_BCL", "DIR_ABSERR_BCU", - "ANOM_CORR", "ANOM_CORR_BCL", "ANOM_CORR_BCU", - "ANOM_CORR_UNCNTR", "ANOM_CORR_UNCNTR_BCL", "ANOM_CORR_UNCNTR_BCU", + "ANOM_CORR", "ANOM_CORR_NCL", "ANOM_CORR_NCU", "ANOM_CORR_BCL", "ANOM_CORR_BCU", + "ANOM_CORR_UNCNTR", "ANOM_CORR_UNCNTR_BCL", "ANOM_CORR_UNCNTR_BCU", }; static const char * pct_columns [] = { From 99dab3c9de09f523372108c16d4420d7318e3cd6 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 29 Apr 2022 10:40:45 -0600 Subject: [PATCH 18/31] Per issue #2022: in write_vcnt_cols(), added ANOM_CORR_NCL/NCU variables. SL --- met/src/libcode/vx_stat_out/stat_columns.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index 6ca5d1c3f0..4479db84e7 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2953,10 +2953,10 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) // SPD_ABSERR, SPD_ABSERR_BCL, SPD_ABSERR_BCU, // DIR_ERR, DIR_ERR_BCL, DIR_ERR_BCU, // DIR_ABSERR, DIR_ABSERR_BCL, DIR_ABSERR_BCU, - // ANOM_CORR, ANOM_CORR_BCL, ANOM_CORR_BCU - // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU - + // ANOM_CORR, ANOM_CORR_NCL, ANOM_CORR_NCU ANOM_CORR_BCL, ANOM_CORR_BCU + // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU + at.set_entry(r, c++, vcnt_info.vcount); // TOTAL at.set_entry(r, c++, vcnt_info.FBAR.v); // FBAR @@ -3032,10 +3032,12 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCU at.set_entry(r, c++, vcnt_info.ANOM_CORR.v); // ANOM_CORR + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCU at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU - at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR.v); // ANOM_CORR_UNCNTR + at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR.v); // ANOM_CORR_UNCNTR at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCL at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCU From 22cd537736a2e2da3db6609daa5a71af14094769 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 29 Apr 2022 15:27:48 -0600 Subject: [PATCH 19/31] Per #2022, adding new VCNT columns to the header table files, User's Guide documentation, and lining some code up more consistently. --- .../table_files/met_header_columns_V11.0.txt | 2 +- met/docs/Users_Guide/point-stat.rst | 80 ++++---- met/src/basic/vx_util/stat_column_defs.h | 41 ++-- met/src/libcode/vx_stat_out/stat_columns.cc | 181 +++++++++--------- test/hdr/met_11_0.hdr | 2 +- 5 files changed, 152 insertions(+), 154 deletions(-) diff --git a/met/data/table_files/met_header_columns_V11.0.txt b/met/data/table_files/met_header_columns_V11.0.txt index 0c30295879..a68153be26 100644 --- a/met/data/table_files/met_header_columns_V11.0.txt +++ b/met/data/table_files/met_header_columns_V11.0.txt @@ -27,7 +27,7 @@ V11.0 : STAT : SL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V11.0 : STAT : SSVAR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_BIN BIN_i BIN_N VAR_MIN VAR_MAX VAR_MEAN FBAR OBAR FOBAR FFBAR OOBAR FBAR_NCL FBAR_NCU FSTDEV FSTDEV_NCL FSTDEV_NCU OBAR_NCL OBAR_NCU OSTDEV OSTDEV_NCL OSTDEV_NCU PR_CORR PR_CORR_NCL PR_CORR_NCU ME ME_NCL ME_NCU ESTDEV ESTDEV_NCL ESTDEV_NCU MBIAS MSE BCMSE RMSE V11.0 : STAT : VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR V11.0 : STAT : VL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFBAR VFBAR UOBAR VOBAR UVFOBAR UVFFBAR UVOOBAR F_SPEED_BAR O_SPEED_BAR -V11.0 : STAT : VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU +V11.0 : STAT : VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU ANOM_CORR ANOM_CORR_NCL ANOM_CORR_NCU ANOM_CORR_BCL ANOM_CORR_BCU ANOM_CORR_UNCNTR ANOM_CORR_UNCNTR_BCL ANOM_CORR_UNCNTR_BCU V11.0 : STAT : GENMPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX STORM_ID PROB_LEAD PROB_VAL AGEN_INIT AGEN_FHR AGEN_LAT AGEN_LON AGEN_DLAND BGEN_LAT BGEN_LON BGEN_DLAND GEN_DIST GEN_TDIFF INIT_TDIFF DEV_CAT OPS_CAT V11.0 : STAT : SSIDX : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE FCST_MODEL REF_MODEL N_INIT N_TERM N_VLD SS_INDEX diff --git a/met/docs/Users_Guide/point-stat.rst b/met/docs/Users_Guide/point-stat.rst index 8ee096b946..abff166853 100644 --- a/met/docs/Users_Guide/point-stat.rst +++ b/met/docs/Users_Guide/point-stat.rst @@ -1300,7 +1300,7 @@ The first set of header columns are common to all of the output files generated .. _table_PS_format_info_VCNT: -.. list-table:: Format information for VCNT (Vector Continuous Statistics) output line type. Note that each statistic (except TOTAL) is followed by two columns giving bootstrap confidence intervals. These confidence intervals are not currently calculated for this release of MET, but will be in future releases. +.. list-table:: Format information for VCNT (Vector Continuous Statistics) output line type. Note that the bootstrap confidence intervals columns ending with BCL and BCU are not currently calculated for this release of MET, but will be in future releases. :widths: auto :header-rows: 2 @@ -1317,59 +1317,65 @@ The first set of header columns are common to all of the output files generated - TOTAL - Total number of data points * - 26-28 - - FBAR - - Mean value of forecast wind speed + - FBAR, :raw-html:`
` FBAR_BCL, :raw-html:`
` FBAR_BCU + - Mean value of forecast wind speed including bootstrap upper and lower confidence limits * - 29-31 - - OBAR - - Mean value of observed wind speed + - OBAR, :raw-html:`
` OBAR_BCL, :raw-html:`
` OBAR_BCU + - Mean value of observed wind speed including bootstrap upper and lower confidence limits * - 32-34 - - FS_RMS - - Root mean square forecast wind speed + - FS_RMS, :raw-html:`
` FS_RMS_BCL, :raw-html:`
` FS_RMS_BCU + - Root mean square forecast wind speed including bootstrap upper and lower confidence limits * - 35-37 - - OS_RMS - - Root mean square observed wind speed + - OS_RMS, :raw-html:`
` OS_RMS_BCL, :raw-html:`
` OS_RMS_BCU + - Root mean square observed wind speed including bootstrap upper and lower confidence limits * - 38-40 - - MSVE - - Mean squared length of the vector difference between the forecast and observed winds + - MSVE, :raw-html:`
` MSVE_BCL, :raw-html:`
` MSVE_BCU + - Mean squared length of the vector difference between the forecast and observed winds including bootstrap upper and lower confidence limits * - 41-43 - - RMSVE - - Square root of MSVE + - RMSVE, :raw-html:`
` RMSVE_BCL, :raw-html:`
` RMSVE_BCU + - Square root of MSVE including bootstrap upper and lower confidence limits * - 45-46 - - FSTDEV - - Standard deviation of the forecast wind speed + - FSTDEV, :raw-html:`
` FSTDEV_BCL, :raw-html:`
` FSTDEV_BCU + - Standard deviation of the forecast wind speed including bootstrap upper and lower confidence limits * - 47-49 - - OSTDEV - - Standard deviation of the observed wind field + - OSTDEV, :raw-html:`
` OSTDEV_BCL, :raw-html:`
` OSTDEV_BCU + - Standard deviation of the observed wind field including bootstrap upper and lower confidence limits * - 50-52 - - FDIR - - Direction of the average forecast wind vector + - FDIR, :raw-html:`
` FDIR_BCL, :raw-html:`
` FDIR_BCU + - Direction of the average forecast wind vector including bootstrap upper and lower confidence limits * - 53-55 - - ODIR - - Direction of the average observed wind vector + - ODIR, :raw-html:`
` ODIR_BCL, :raw-html:`
` ODIR_BCU + - Direction of the average observed wind vector including bootstrap upper and lower confidence limits * - 56-58 - - FBAR_SPEED - - Length (speed) of the average forecast wind vector + - FBAR_SPEED, :raw-html:`
` FBAR_SPEED_BCL, :raw-html:`
` FBAR_SPEED_BCU + - Length (speed) of the average forecast wind vector including bootstrap upper and lower confidence limits * - 59-61 - - OBAR_SPEED - - Length (speed) of the average observed wind vector + - OBAR_SPEED, :raw-html:`
` OBAR_SPEED_BCL, :raw-html:`
` OBAR_SPEED_BCU + - Length (speed) of the average observed wind vector including bootstrap upper and lower confidence limits * - 62-64 - - VDIFF_SPEED - - Length (speed) of the vector difference between the average forecast and average observed wind vectors + - VDIFF_SPEED, :raw-html:`
` VDIFF_SPEED_BCL, :raw-html:`
` VDIFF_SPEED_BCU + - Length (speed) of the vector difference between the average forecast and average observed wind vectors including bootstrap upper and lower confidence limits * - 65-67 - - VDIFF_DIR - - Direction of the vector difference between the average forecast and average wind vectors + - VDIFF_DIR, :raw-html:`
` VDIFF_DIR_BCL, :raw-html:`
` VDIFF_DIR_BCU + - Direction of the vector difference between the average forecast and average wind vectors including bootstrap upper and lower confidence limits * - 68-70 - - SPEED_ERR - - Difference between the length of the average forecast wind vector and the average observed wind vector (in the sense F - O) + - SPEED_ERR, :raw-html:`
` SPEED_ERR_BCL, :raw-html:`
` SPEED_ERR_BCU + - Difference between the length of the average forecast wind vector and the average observed wind vector (in the sense F - O) including bootstrap upper and lower confidence limits * - 71-73 - - SPEED_ABSERR - - Absolute value of SPEED_ERR + - SPEED_ABSERR, :raw-html:`
` SPEED_ABSERR_BCL, :raw-html:`
` SPEED_ABSERR_BCU + - Absolute value of SPEED_ERR including bootstrap upper and lower confidence limits * - 74-76 - - DIR_ERR - - Signed angle between the directions of the average forecast and observed wing vectors. Positive if the forecast wind vector is counterclockwise from the observed wind vector + - DIR_ERR, :raw-html:`
` DIR_ERR_BCL, :raw-html:`
` DIR_ERR_BCU + - Signed angle between the directions of the average forecast and observed wing vectors. Positive if the forecast wind vector is counterclockwise from the observed wind vector including bootstrap upper and lower confidence limits * - 77-79 - - DIR_ABSERR - - Absolute value of DIR_ABSERR + - DIR_ABSERR, :raw-html:`
` DIR_ABSERR_BCL, :raw-html:`
` DIR_ABSERR_BCU + - Absolute value of DIR_ABSERR including bootstrap upper and lower confidence limits + * - 80-84 + - ANOM_CORR, :raw-html:`
` ANOM_CORR_NCL, :raw-html:`
` ANOM_CORR_NCU, :raw-html:`
` ANOM_CORR_BCL, :raw-html:`
` ANOM_CORR_BCU + - Vector Anomaly Correlation including mean error with normal and bootstrap upper and lower confidence limits + * - 85-87 + - ANOM_CORR_UNCNTR, :raw-html:`
` ANOM_CORR_UNCNTR_BCL, :raw-html:`
` ANOM_CORR_UNCNTR_BCU + - Uncentered vector Anomaly Correlation excluding mean error including bootstrap upper and lower confidence limits .. _table_PS_format_info_MPR: diff --git a/met/src/basic/vx_util/stat_column_defs.h b/met/src/basic/vx_util/stat_column_defs.h index 64da8d011e..28e7b77031 100644 --- a/met/src/basic/vx_util/stat_column_defs.h +++ b/met/src/basic/vx_util/stat_column_defs.h @@ -136,27 +136,26 @@ static const char * val1l2_columns [] = { static const char * vcnt_columns [] = { "TOTAL", - - "FBAR", "FBAR_BCL", "FBAR_BCU", - "OBAR", "OBAR_BCL", "OBAR_BCU", - "FS_RMS", "FS_RMS_BCL", "FS_RMS_BCU", - "OS_RMS", "OS_RMS_BCL", "OS_RMS_BCU", - "MSVE", "MSVE_BCL", "MSVE_BCU", - "RMSVE", "RMSVE_BCL", "RMSVE_BCU", - "FSTDEV", "FSTDEV_BCL", "FSTDEV_BCU", - "OSTDEV", "OSTDEV_BCL", "OSTDEV_BCU", - "FDIR", "FDIR_BCL", "FDIR_BCU", - "ODIR", "ODIR_BCL", "ODIR_BCU", - "FBAR_SPEED", "FBAR_SPEED_BCL", "FBAR_SPEED_BCU", - "OBAR_SPEED", "OBAR_SPEED_BCL", "OBAR_SPEED_BCU", - "VDIFF_SPEED", "VDIFF_SPEED_BCL", "VDIFF_SPEED_BCU", - "VDIFF_DIR", "VDIFF_DIR_BCL", "VDIFF_DIR_BCU", - "SPEED_ERR", "SPEED_ERR_BCL", "SPEED_ERR_BCU", - "SPEED_ABSERR", "SPEED_ABSERR_BCL", "SPEED_ABSERR_BCU", - "DIR_ERR", "DIR_ERR_BCL", "DIR_ERR_BCU", - "DIR_ABSERR", "DIR_ABSERR_BCL", "DIR_ABSERR_BCU", - "ANOM_CORR", "ANOM_CORR_NCL", "ANOM_CORR_NCU", "ANOM_CORR_BCL", "ANOM_CORR_BCU", - "ANOM_CORR_UNCNTR", "ANOM_CORR_UNCNTR_BCL", "ANOM_CORR_UNCNTR_BCU", + "FBAR", "FBAR_BCL", "FBAR_BCU", + "OBAR", "OBAR_BCL", "OBAR_BCU", + "FS_RMS", "FS_RMS_BCL", "FS_RMS_BCU", + "OS_RMS", "OS_RMS_BCL", "OS_RMS_BCU", + "MSVE", "MSVE_BCL", "MSVE_BCU", + "RMSVE", "RMSVE_BCL", "RMSVE_BCU", + "FSTDEV", "FSTDEV_BCL", "FSTDEV_BCU", + "OSTDEV", "OSTDEV_BCL", "OSTDEV_BCU", + "FDIR", "FDIR_BCL", "FDIR_BCU", + "ODIR", "ODIR_BCL", "ODIR_BCU", + "FBAR_SPEED", "FBAR_SPEED_BCL", "FBAR_SPEED_BCU", + "OBAR_SPEED", "OBAR_SPEED_BCL", "OBAR_SPEED_BCU", + "VDIFF_SPEED", "VDIFF_SPEED_BCL", "VDIFF_SPEED_BCU", + "VDIFF_DIR", "VDIFF_DIR_BCL", "VDIFF_DIR_BCU", + "SPEED_ERR", "SPEED_ERR_BCL", "SPEED_ERR_BCU", + "SPEED_ABSERR", "SPEED_ABSERR_BCL", "SPEED_ABSERR_BCU", + "DIR_ERR", "DIR_ERR_BCL", "DIR_ERR_BCU", + "DIR_ABSERR", "DIR_ABSERR_BCL", "DIR_ABSERR_BCU", + "ANOM_CORR", "ANOM_CORR_NCL", "ANOM_CORR_NCU", "ANOM_CORR_BCL", "ANOM_CORR_BCU", + "ANOM_CORR_UNCNTR", "ANOM_CORR_UNCNTR_BCL", "ANOM_CORR_UNCNTR_BCU", }; static const char * pct_columns [] = { diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index 4479db84e7..b685b149f2 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2930,123 +2930,116 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, AsciiTable &at, int r, int c) { // - // VCNT Line Type + // Vector Continuous Statistics Line Type (VCNT) + // Dump out the VCNT line: + // TOTAL, + // FBAR, FBAR_BCL, FBAR_BCU, + // OBAR, OBAR_BCL, OBAR_BCU, + // FS_RMS, FS_RMS_BCL, FS_RMS_BCU, + // OS_RMS, OS_RMS_BCL, OS_RMS_BCU, + // MSVE, MSVE_BCL, MSVE_BCU, + // RMSVE, RMSVE_BCL, RMSVE_BCU, + // FSTDEV, FSTDEV_BCL, FSTDEV_BCU, + // OSTDEV, OSTDEV_BCL, OSTDEV_BCU, + // FDIR, FDIR_BCL, FDIR_BCU, + // ODIR, ODIR_BCL, ODIR_BCU, + // FBAR_SPEED, FBAR_SPEED_BCL, FBAR_SPEED_BCU, + // OBAR_SPEED, OBAR_SPEED_BCL, OBAR_SPEED_BCU, + // VDIFF_SPEED, VDIFF_SPEED_BCL, VDIFF_SPEED_BCU, + // VDIFF_DIR, VDIFF_DIR_BCL, VDIFF_DIR_BCU, + // SPD_ERR, SPD_ERR_BCL, SPD_ERR_BCU, + // SPD_ABSERR, SPD_ABSERR_BCL, SPD_ABSERR_BCU, + // DIR_ERR, DIR_ERR_BCL, DIR_ERR_BCU, + // DIR_ABSERR, DIR_ABSERR_BCL, DIR_ABSERR_BCU, + // ANOM_CORR, ANOM_CORR_NCL, ANOM_CORR_NCU, ANOM_CORR_BCL, ANOM_CORR_BCU + // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU // - // TOTAL, - // - // FBAR, FBAR_BCL, FBAR_BCU, - // OBAR, OBAR_BCL, OBAR_BCU, - // FS_RMS, FS_RMS_BCL, FS_RMS_BCU, - // OS_RMS, OS_RMS_BCL, OS_RMS_BCU, - // MSVE, MSVE_BCL, MSVE_BCU, - // RMSVE, RMSVE_BCL, RMSVE_BCU, - // FSTDEV, FSTDEV_BCL, FSTDEV_BCU, - // OSTDEV, OSTDEV_BCL, OSTDEV_BCU, - // FDIR, FDIR_BCL, FDIR_BCU, - // ODIR, ODIR_BCL, ODIR_BCU, - // FBAR_SPEED, FBAR_SPEED_BCL, FBAR_SPEED_BCU, - // OBAR_SPEED, OBAR_SPEED_BCL, OBAR_SPEED_BCU, - // VDIFF_SPEED, VDIFF_SPEED_BCL, VDIFF_SPEED_BCU, - // VDIFF_DIR, VDIFF_DIR_BCL, VDIFF_DIR_BCU, - // SPD_ERR, SPD_ERR_BCL, SPD_ERR_BCU, - // SPD_ABSERR, SPD_ABSERR_BCL, SPD_ABSERR_BCU, - // DIR_ERR, DIR_ERR_BCL, DIR_ERR_BCU, - // DIR_ABSERR, DIR_ABSERR_BCL, DIR_ABSERR_BCU, - // ANOM_CORR, ANOM_CORR_NCL, ANOM_CORR_NCU ANOM_CORR_BCL, ANOM_CORR_BCU - // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU - - - at.set_entry(r, c++, vcnt_info.vcount); // TOTAL + at.set_entry(r, c++, vcnt_info.vcount); // TOTAL - at.set_entry(r, c++, vcnt_info.FBAR.v); // FBAR - at.set_entry(r, c++, (string)na_str); // FBAR_BCL - at.set_entry(r, c++, (string)na_str); // FBAR_BCU + at.set_entry(r, c++, vcnt_info.FBAR.v); // FBAR + at.set_entry(r, c++, (string)na_str); // FBAR_BCL + at.set_entry(r, c++, (string)na_str); // FBAR_BCU - at.set_entry(r, c++, vcnt_info.OBAR.v); // OBAR - at.set_entry(r, c++, (string)na_str); // OBAR_BCL - at.set_entry(r, c++, (string)na_str); // OBAR_BCU + at.set_entry(r, c++, vcnt_info.OBAR.v); // OBAR + at.set_entry(r, c++, (string)na_str); // OBAR_BCL + at.set_entry(r, c++, (string)na_str); // OBAR_BCU - at.set_entry(r, c++, vcnt_info.FS_RMS.v); // FS_RMS - at.set_entry(r, c++, (string)na_str); // FS_RMS_BCL - at.set_entry(r, c++, (string)na_str); // FS_RMS_BCU + at.set_entry(r, c++, vcnt_info.FS_RMS.v); // FS_RMS + at.set_entry(r, c++, (string)na_str); // FS_RMS_BCL + at.set_entry(r, c++, (string)na_str); // FS_RMS_BCU - at.set_entry(r, c++, vcnt_info.OS_RMS.v); // OS_RMS - at.set_entry(r, c++, (string)na_str); // OS_RMS_BCL - at.set_entry(r, c++, (string)na_str); // OS_RMS_BCU + at.set_entry(r, c++, vcnt_info.OS_RMS.v); // OS_RMS + at.set_entry(r, c++, (string)na_str); // OS_RMS_BCL + at.set_entry(r, c++, (string)na_str); // OS_RMS_BCU - at.set_entry(r, c++, vcnt_info.MSVE.v); // MSVE - at.set_entry(r, c++, (string)na_str); // MSVE_BCL - at.set_entry(r, c++, (string)na_str); // MSVE_BCU + at.set_entry(r, c++, vcnt_info.MSVE.v); // MSVE + at.set_entry(r, c++, (string)na_str); // MSVE_BCL + at.set_entry(r, c++, (string)na_str); // MSVE_BCU - at.set_entry(r, c++, vcnt_info.RMSVE.v); // RMSVE - at.set_entry(r, c++, (string)na_str); // RMSVE_BCL - at.set_entry(r, c++, (string)na_str); // RMSVE_BCU + at.set_entry(r, c++, vcnt_info.RMSVE.v); // RMSVE + at.set_entry(r, c++, (string)na_str); // RMSVE_BCL + at.set_entry(r, c++, (string)na_str); // RMSVE_BCU - at.set_entry(r, c++, vcnt_info.FSTDEV.v); // FSTDEV - at.set_entry(r, c++, (string)na_str); // FSTDEV_BCL - at.set_entry(r, c++, (string)na_str); // FSTDEV_BCU + at.set_entry(r, c++, vcnt_info.FSTDEV.v); // FSTDEV + at.set_entry(r, c++, (string)na_str); // FSTDEV_BCL + at.set_entry(r, c++, (string)na_str); // FSTDEV_BCU - at.set_entry(r, c++, vcnt_info.OSTDEV.v); // OSTDEV - at.set_entry(r, c++, (string)na_str); // OSTDEV_BCL - at.set_entry(r, c++, (string)na_str); // OSTDEV_BCU + at.set_entry(r, c++, vcnt_info.OSTDEV.v); // OSTDEV + at.set_entry(r, c++, (string)na_str); // OSTDEV_BCL + at.set_entry(r, c++, (string)na_str); // OSTDEV_BCU - at.set_entry(r, c++, vcnt_info.FDIR.v); // FDIR - at.set_entry(r, c++, (string)na_str); // FDIR_BCL - at.set_entry(r, c++, (string)na_str); // FDIR_BCU + at.set_entry(r, c++, vcnt_info.FDIR.v); // FDIR + at.set_entry(r, c++, (string)na_str); // FDIR_BCL + at.set_entry(r, c++, (string)na_str); // FDIR_BCU - at.set_entry(r, c++, vcnt_info.ODIR.v); // ODIR - at.set_entry(r, c++, (string)na_str); // ODIR_BCL - at.set_entry(r, c++, (string)na_str); // ODIR_BCU + at.set_entry(r, c++, vcnt_info.ODIR.v); // ODIR + at.set_entry(r, c++, (string)na_str); // ODIR_BCL + at.set_entry(r, c++, (string)na_str); // ODIR_BCU - at.set_entry(r, c++, vcnt_info.FBAR_SPEED.v); // FBAR_SPEED - at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCL - at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCU + at.set_entry(r, c++, vcnt_info.FBAR_SPEED.v); // FBAR_SPEED + at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCL + at.set_entry(r, c++, (string)na_str); // FBAR_SPEED_BCU - at.set_entry(r, c++, vcnt_info.OBAR_SPEED.v); // OBAR_SPEED - at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCL - at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCU + at.set_entry(r, c++, vcnt_info.OBAR_SPEED.v); // OBAR_SPEED + at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCL + at.set_entry(r, c++, (string)na_str); // OBAR_SPEED_BCU - at.set_entry(r, c++, vcnt_info.VDIFF_SPEED.v); // VDIFF_SPEED - at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCL - at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCU + at.set_entry(r, c++, vcnt_info.VDIFF_SPEED.v); // VDIFF_SPEED + at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCL + at.set_entry(r, c++, (string)na_str); // VDIFF_SPEED_BCU - at.set_entry(r, c++, vcnt_info.VDIFF_DIR.v); // VDIFF_DIR - at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCL - at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCU + at.set_entry(r, c++, vcnt_info.VDIFF_DIR.v); // VDIFF_DIR + at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCL + at.set_entry(r, c++, (string)na_str); // VDIFF_DIR_BCU - at.set_entry(r, c++, vcnt_info.SPEED_ERR.v); // SPEED_ERR - at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCL - at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCU + at.set_entry(r, c++, vcnt_info.SPEED_ERR.v); // SPEED_ERR + at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCL + at.set_entry(r, c++, (string)na_str); // SPEED_ERR_BCU - at.set_entry(r, c++, vcnt_info.SPEED_ABSERR.v); // SPEED_ABSERR - at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCL - at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCU + at.set_entry(r, c++, vcnt_info.SPEED_ABSERR.v); // SPEED_ABSERR + at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCL + at.set_entry(r, c++, (string)na_str); // SPEED_ABSERR_BCU - at.set_entry(r, c++, vcnt_info.DIR_ERR.v); // DIR_ERR - at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCL - at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCU + at.set_entry(r, c++, vcnt_info.DIR_ERR.v); // DIR_ERR + at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCL + at.set_entry(r, c++, (string)na_str); // DIR_ERR_BCU - at.set_entry(r, c++, vcnt_info.DIR_ABSERR.v); // DIR_ABSERR - at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCL - at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCU + at.set_entry(r, c++, vcnt_info.DIR_ABSERR.v); // DIR_ABSERR + at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCL + at.set_entry(r, c++, (string)na_str); // DIR_ABSERR_BCU - at.set_entry(r, c++, vcnt_info.ANOM_CORR.v); // ANOM_CORR - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCL - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCU - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU + at.set_entry(r, c++, vcnt_info.ANOM_CORR.v); // ANOM_CORR + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_NCU + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_BCU - at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR.v); // ANOM_CORR_UNCNTR - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCL - at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCU - - // - // - // - -return; + at.set_entry(r, c++, vcnt_info.ANOM_CORR_UNCNTR.v); // ANOM_CORR_UNCNTR + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCL + at.set_entry(r, c++, (string)na_str); // ANOM_CORR_UNCNTR_BCU + return; } diff --git a/test/hdr/met_11_0.hdr b/test/hdr/met_11_0.hdr index 84f5b5a950..7f4f1f8b49 100644 --- a/test/hdr/met_11_0.hdr +++ b/test/hdr/met_11_0.hdr @@ -27,7 +27,7 @@ SL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_L SSVAR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_BIN BIN_i BIN_N VAR_MIN VAR_MAX VAR_MEAN FBAR OBAR FOBAR FFBAR OOBAR FBAR_NCL FBAR_NCU FSTDEV FSTDEV_NCL FSTDEV_NCU OBAR_NCL OBAR_NCU OSTDEV OSTDEV_NCL OSTDEV_NCU PR_CORR PR_CORR_NCL PR_CORR_NCU ME ME_NCL ME_NCU ESTDEV ESTDEV_NCL ESTDEV_NCU MBIAS MSE BCMSE RMSE VL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFBAR VFBAR UOBAR VOBAR UVFOBAR UVFFBAR UVOOBAR F_SPEED_BAR O_SPEED_BAR VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR -VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU +VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU ANOM_CORR ANOM_CORR_NCL ANOM_CORR_NCU ANOM_CORR_BCL ANOM_CORR_BCU ANOM_CORR_UNCNTR ANOM_CORR_UNCNTR_BCL ANOM_CORR_UNCNTR_BCU GENMPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX STORM_ID PROB_LEAD PROB_VAL AGEN_INIT AGEN_FHR AGEN_LAT AGEN_LON AGEN_DLAND BGEN_LAT BGEN_LON BGEN_DLAND GEN_DIST GEN_TDIFF INIT_TDIFF DEV_CAT OPS_CAT SSIDX : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE FCST_MODEL REF_MODEL N_INIT N_TERM N_VLD SS_INDEX MODE_SOA : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE N_VALID GRID_RES OBJECT_ID OBJECT_CAT CENTROID_X CENTROID_Y CENTROID_LAT CENTROID_LON AXIS_ANG LENGTH WIDTH AREA AREA_THRESH CURVATURE CURVATURE_X CURVATURE_Y COMPLEXITY INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_50 INTENSITY_SUM From 4a32edb53b046e0250b03b27fa8350ed485161e9 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 29 Apr 2022 18:00:16 -0600 Subject: [PATCH 20/31] Per #2022, added FA_SPEED_BAR and OA_SPEEED_BAR to the VAL1L2 line type. Added code to compute the ANOM_CORR confidence interval. However, I still need to update the writing of the VCNT line type to set the alpha value and actually write the computed CI's. --- .../table_files/met_header_columns_V11.0.txt | 2 +- met/docs/Users_Guide/point-stat.rst | 6 + met/src/basic/vx_util/stat_column_defs.h | 6 +- met/src/libcode/vx_stat_out/stat_columns.cc | 10 +- .../libcode/vx_statistics/.met_stats.h.swp | Bin 0 -> 16384 bytes met/src/libcode/vx_statistics/met_stats.cc | 491 ++++++++++-------- met/src/libcode/vx_statistics/met_stats.h | 19 +- .../core/stat_analysis/parse_stat_line.cc | 22 +- test/hdr/met_11_0.hdr | 2 +- 9 files changed, 326 insertions(+), 232 deletions(-) create mode 100644 met/src/libcode/vx_statistics/.met_stats.h.swp diff --git a/met/data/table_files/met_header_columns_V11.0.txt b/met/data/table_files/met_header_columns_V11.0.txt index a68153be26..86f6887d7e 100644 --- a/met/data/table_files/met_header_columns_V11.0.txt +++ b/met/data/table_files/met_header_columns_V11.0.txt @@ -25,7 +25,7 @@ V11.0 : STAT : RELP : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V11.0 : STAT : SAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FABAR OABAR FOABAR FFABAR OOABAR MAE V11.0 : STAT : SL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR OBAR FOBAR FFBAR OOBAR MAE V11.0 : STAT : SSVAR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_BIN BIN_i BIN_N VAR_MIN VAR_MAX VAR_MEAN FBAR OBAR FOBAR FFBAR OOBAR FBAR_NCL FBAR_NCU FSTDEV FSTDEV_NCL FSTDEV_NCU OBAR_NCL OBAR_NCU OSTDEV OSTDEV_NCL OSTDEV_NCU PR_CORR PR_CORR_NCL PR_CORR_NCU ME ME_NCL ME_NCU ESTDEV ESTDEV_NCL ESTDEV_NCU MBIAS MSE BCMSE RMSE -V11.0 : STAT : VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR +V11.0 : STAT : VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR FA_SPEED_BAR OA_SPEED_BAR V11.0 : STAT : VL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFBAR VFBAR UOBAR VOBAR UVFOBAR UVFFBAR UVOOBAR F_SPEED_BAR O_SPEED_BAR V11.0 : STAT : VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU ANOM_CORR ANOM_CORR_NCL ANOM_CORR_NCU ANOM_CORR_BCL ANOM_CORR_BCU ANOM_CORR_UNCNTR ANOM_CORR_UNCNTR_BCL ANOM_CORR_UNCNTR_BCU V11.0 : STAT : GENMPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX STORM_ID PROB_LEAD PROB_VAL AGEN_INIT AGEN_FHR AGEN_LAT AGEN_LON AGEN_DLAND BGEN_LAT BGEN_LON BGEN_DLAND GEN_DIST GEN_TDIFF INIT_TDIFF DEV_CAT OPS_CAT diff --git a/met/docs/Users_Guide/point-stat.rst b/met/docs/Users_Guide/point-stat.rst index abff166853..37d8a9175c 100644 --- a/met/docs/Users_Guide/point-stat.rst +++ b/met/docs/Users_Guide/point-stat.rst @@ -1297,6 +1297,12 @@ The first set of header columns are common to all of the output files generated * - 32 - UVOOABAR - Mean((uo-uc)²+(vo-vc)²) + * - 33 + - FA_SPEED_BAR + - Mean forecast wind speed anomaly + * - 34 + - OA_SPEED_BAR + - Mean observed wind speed anomaly .. _table_PS_format_info_VCNT: diff --git a/met/src/basic/vx_util/stat_column_defs.h b/met/src/basic/vx_util/stat_column_defs.h index 28e7b77031..98aadcbd44 100644 --- a/met/src/basic/vx_util/stat_column_defs.h +++ b/met/src/basic/vx_util/stat_column_defs.h @@ -123,18 +123,18 @@ static const char * vl1l2_columns [] = { "TOTAL", "UFBAR", "VFBAR", "UOBAR", "VOBAR", "UVFOBAR", "UVFFBAR", "UVOOBAR", "F_SPEED_BAR", - "O_SPEED_BAR", + "O_SPEED_BAR" }; static const char * val1l2_columns [] = { "TOTAL", "UFABAR", "VFABAR", "UOABAR", "VOABAR", "UVFOABAR", - "UVFFABAR", "UVOOABAR" + "UVFFABAR", "UVOOABAR", "FA_SPEED_BAR", + "OA_SPEED_BAR" }; static const char * vcnt_columns [] = { - "TOTAL", "FBAR", "FBAR_BCL", "FBAR_BCU", "OBAR", "OBAR_BCL", "OBAR_BCU", diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index b685b149f2..89538529c8 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -2893,7 +2893,8 @@ void write_val1l2_cols(const VL1L2Info &vl1l2_info, AsciiTable &at, int r, int c // Dump out the VAL1L2 line: // TOTAL, UFABAR, VFABAR, // UOABAR, VOABAR, UVFOABAR, - // UVFFABAR, UVOOABAR + // UVFFABAR, UVOOABAR, FA_SPEED_BAR, + // OA_SPEED_BAR // at.set_entry(r, c+0, // Total Anomaly Count @@ -2919,6 +2920,13 @@ void write_val1l2_cols(const VL1L2Info &vl1l2_info, AsciiTable &at, int r, int c at.set_entry(r, c+7, // UVOOABAR vl1l2_info.uvooa_bar); + + at.set_entry(r, c+8, // FA_SPEED_BAR + vl1l2_info.fa_speed_bar); + + at.set_entry(r, c+9, // OA_SPEED_BAR + vl1l2_info.oa_speed_bar); + return; } diff --git a/met/src/libcode/vx_statistics/.met_stats.h.swp b/met/src/libcode/vx_statistics/.met_stats.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..27f34ca9cc86634ec5227c6c1e129dea5b8b62e1 GIT binary patch literal 16384 zcmeI2ONZzXDo!N)r`beza{Y}r* zSM_!Ezw4{2?yh2Hd;cI^+ucjB-9<=smRmgKZXo*{LUzltS1u{T)LW$*3g$jKbtYKT z+ofBr@Gx!nr2Rnd=2jG@2cO6*3O28CSNaw1MR8h%N9i!I(yl04(&p*f-a;6$NQ9BF z!ZfV$&#=2Z?O{y@qkvH$R$viX)7z6#UptmRM3*eyW^^$M7zK<1MggOMQNSo*6fg=H z1^!10ME*RoALlzupYtKTzoljWyWWoL^jBK!ziIoMI(?OPkodW-?T5AflNS50+OF!N zwjH`cN%?EqzNl^{ms;#P+3bu0MggOMQNSo*6fg=H1&jhl0i%FXz$jo8m_Pw$6LL4w zxw@am`~T$r|J;2ii6yakSc!(bN}0MCH= z;OcFJTn68Q?gUfSp?%*Q00M3GU!9lPCJP&%nePAw_1Fp=*wFB>flVCp> z1-ro}a6kAFZRI>T0S*8G9H82e4cfPT8wicJniMv*WW}#WykLpWl@l7&LXWV;#%#OO zmer!mQ*`3}cwg=L$J;}!Adyiy;9ISbVJX;pIl{hlK!v#b;?4}&m_KMEWPB_1>~j;&&>r#^#3#WuUHbYjm* zFA`pfd)7#vK}w1hI1T4@RcTjT>7)ee9v?`bOOl*UQ}}X(4Og5Z6Ax<4rEyV;Z&e;9 zCpVbO55=dqf=ZtUERw-St$5Sa&?iZnJjZAwOM4+LsgGtNto2C^;zq~9P?WsM-Nu=O zC!&HA$Vwr!P*ba{8=)VF8m=fjS}q*Xqzd#!MBEH*aD;!Fiw_V<8bT;e2di!*R_Ac= zk_<+a=*b17^(&Z@RWAxD^K3fQSRYmQH8T|>q!GQkg_QK-D=nr~W&!PLw&wp%jNf!5 zy3)20f-+En$ko>{{^YiZzltOdbmTfLNKq?-0_5|%dZ>S?kivR8Xz?dubF9d$Q2c33YQ)6n8*#(-qx86j@@~j&^ zmM4RX8t&AA_KFIYrAn{mXf@%CIfLyi5Uf5_I&PeuI?O^3PaP163P%qUh~}uN>s%Y> z1H&qn4voslo%Hp|VbwtGHO6w?FSQT3iJ=)V@!TVcu=+%#Ir|x{=Wkxj=5KX*rVp=H zhc^~o_0lsRT-F40mm&sIJM5ld3}#KWana-14c#N6G8GtjUAcz`@$g&qF}<1Dk+(yj zaaL_kmt*;JDG+vdc{v%ESdE0+mKdL2NhOcT>@yL>ky-F18q4@XC=sa%VO(Zr<_(z6 zkPe$W!sC<{3Tln_P(GUHHM`=h0Sdn&a%?_;8xi-h? zXa_m0RL7N9@tch*GW5#`V2d`qbZ*XNwN2J%ylqV3ob*Qm zQ7T7NrP5AoCGAdhqkvJsC}0#Y3K#{90!9I&fKk9G00n07(E|5ufd>c_4-8tL zF3jLz_+H%Pd+H6BdK#I$xeS;$tRI;@j%S@)T!x1nD^hgakL0mqDlV;_sS)i>TM} 0) { - v_info.ufa_bar = (ufa_bar*vacount + c.ufa_bar*c.vacount) /v_info.vacount; - v_info.vfa_bar = (vfa_bar*vacount + c.vfa_bar*c.vacount) /v_info.vacount; - v_info.uoa_bar = (uoa_bar*vacount + c.uoa_bar*c.vacount) /v_info.vacount; - v_info.voa_bar = (voa_bar*vacount + c.voa_bar*c.vacount) /v_info.vacount; - v_info.uvfoa_bar = (uvfoa_bar*vacount + c.uvfoa_bar*c.vacount)/v_info.vacount; - v_info.uvffa_bar = (uvffa_bar*vacount + c.uvffa_bar*c.vacount)/v_info.vacount; - v_info.uvooa_bar = (uvooa_bar*vacount + c.uvooa_bar*c.vacount)/v_info.vacount; + v_info.ufa_bar = (ufa_bar*vacount + c.ufa_bar*c.vacount) /v_info.vacount; + v_info.vfa_bar = (vfa_bar*vacount + c.vfa_bar*c.vacount) /v_info.vacount; + v_info.uoa_bar = (uoa_bar*vacount + c.uoa_bar*c.vacount) /v_info.vacount; + v_info.voa_bar = (voa_bar*vacount + c.voa_bar*c.vacount) /v_info.vacount; + v_info.uvfoa_bar = (uvfoa_bar*vacount + c.uvfoa_bar*c.vacount)/v_info.vacount; + v_info.uvffa_bar = (uvffa_bar*vacount + c.uvffa_bar*c.vacount)/v_info.vacount; + v_info.uvooa_bar = (uvooa_bar*vacount + c.uvooa_bar*c.vacount)/v_info.vacount; + v_info.fa_speed_bar = (fa_speed_bar*vcount + c.fa_speed_bar*c.vcount)/v_info.vcount; + v_info.oa_speed_bar = (oa_speed_bar*vcount + c.oa_speed_bar*c.vcount)/v_info.vcount; } - v_info.calc_ncep_stats(); + v_info.compute_stats(); assign(v_info); @@ -1371,7 +1373,6 @@ void VL1L2Info::init_from_scratch() { //////////////////////////////////////////////////////////////////////// - void VL1L2Info::zero_out() { // @@ -1401,15 +1402,17 @@ void VL1L2Info::zero_out() { // VAL1L2 Quantities // - ufa_bar = 0.0; - vfa_bar = 0.0; - uoa_bar = 0.0; - voa_bar = 0.0; - uvfoa_bar = 0.0; - uvffa_bar = 0.0; - uvooa_bar = 0.0; + ufa_bar = 0.0; + vfa_bar = 0.0; + uoa_bar = 0.0; + voa_bar = 0.0; + uvfoa_bar = 0.0; + uvffa_bar = 0.0; + uvooa_bar = 0.0; + fa_speed_bar = 0.0; + oa_speed_bar = 0.0; - vacount = 0; + vacount = 0; return; } @@ -1478,29 +1481,29 @@ void VL1L2Info::assign(const VL1L2Info &c) { f_speed_bar = c.f_speed_bar; o_speed_bar = c.o_speed_bar; - f_bar = c.f_bar; - o_bar = c.o_bar; - - me = c.me; - - mse = c.mse; - - speed_bias = c.speed_bias; + f_bar = c.f_bar; + o_bar = c.o_bar; + me = c.me; + mse = c.mse; + speed_bias = c.speed_bias; - vcount = c.vcount; + vcount = c.vcount; // VAL1L2 Quantities - ufa_bar = c.ufa_bar; - vfa_bar = c.vfa_bar; - uoa_bar = c.uoa_bar; - voa_bar = c.voa_bar; - uvfoa_bar = c.uvfoa_bar; - uvffa_bar = c.uvffa_bar; - uvooa_bar = c.uvooa_bar; - vacount = c.vacount; + ufa_bar = c.ufa_bar; + vfa_bar = c.vfa_bar; + uoa_bar = c.uoa_bar; + voa_bar = c.voa_bar; + uvfoa_bar = c.uvfoa_bar; + uvffa_bar = c.uvffa_bar; + uvooa_bar = c.uvooa_bar; + fa_speed_bar = c.fa_speed_bar; + oa_speed_bar = c.oa_speed_bar; + + vacount = c.vacount; // - // NCEP stats + // Statistics // FBAR = c.FBAR; @@ -1538,6 +1541,165 @@ void VL1L2Info::assign(const VL1L2Info &c) { //////////////////////////////////////////////////////////////////////// +void VL1L2Info::set(const PairDataPoint &pd_u_all, + const PairDataPoint &pd_v_all) { + int i; + double uf, vf, uo, vo, uc, vc, wgt, wgt_sum; + double u_diff, v_diff; + PairDataPoint pd_u, pd_v; + + // Initialize + zero_out(); + + // Check that the number of pairs are the same + if(pd_u_all.f_na.n() != pd_u_all.o_na.n() || + pd_u_all.f_na.n() != pd_v_all.f_na.n() || + pd_v_all.f_na.n() != pd_v_all.o_na.n()) { + mlog << Error << "\nVL1L2Info::set() -> " + << "unequal number of UGRD and VGRD pairs (" + << pd_u_all.f_na.n() << " != " << pd_u_all.o_na.n() + << ")\n\n"; + exit(1); + } + + // Apply wind speed filtering thresholds to subset pairs + subset_wind_pairs(pd_u_all, pd_v_all, fthresh, othresh, logic, pd_u, pd_v); + + // Check for no matched pairs to process + if(pd_u.n_obs == 0) return; + + // Get the sum of the weights + wgt_sum = pd_u.wgt_na.sum(); + + // Loop through the filtered pair data compute partial sums + for(i=0; i 0) compute_stats(); + + // Check for 0 points + if(vcount == 0) { + + uf_bar = bad_data_double; + vf_bar = bad_data_double; + uo_bar = bad_data_double; + vo_bar = bad_data_double; + uvfo_bar = bad_data_double; + uvff_bar = bad_data_double; + uvoo_bar = bad_data_double; + f_speed_bar = bad_data_double; + o_speed_bar = bad_data_double; + + me = bad_data_double; + mse = bad_data_double; + rmse = bad_data_double; + speed_bias = bad_data_double; + + FBAR.v = bad_data_double; + OBAR.v = bad_data_double; + + FS_RMS.v = bad_data_double; + OS_RMS.v = bad_data_double; + + MSVE.v = bad_data_double; + RMSVE.v = bad_data_double; + + FSTDEV.v = bad_data_double; + OSTDEV.v = bad_data_double; + + FDIR.v = bad_data_double; + ODIR.v = bad_data_double; + + FBAR_SPEED.v = bad_data_double; + OBAR_SPEED.v = bad_data_double; + + VDIFF_SPEED.v = bad_data_double; + VDIFF_DIR.v = bad_data_double; + + SPEED_ERR.v = bad_data_double; + SPEED_ABSERR.v = bad_data_double; + + DIR_ERR.v = bad_data_double; + DIR_ABSERR.v = bad_data_double; + + ANOM_CORR.v = bad_data_double; + ANOM_CORR_UNCNTR.v = bad_data_double; + } + else { + rmse = sqrt(mse); + } + + if(vacount == 0) { + ufa_bar = bad_data_double; + vfa_bar = bad_data_double; + uoa_bar = bad_data_double; + voa_bar = bad_data_double; + uvfoa_bar = bad_data_double; + uvffa_bar = bad_data_double; + uvooa_bar = bad_data_double; + fa_speed_bar = bad_data_double; + oa_speed_bar = bad_data_double; + } + + return; +} + +//////////////////////////////////////////////////////////////////////// void VL1L2Info::allocate_n_alpha(int i) { @@ -1580,13 +1742,12 @@ void VL1L2Info::allocate_n_alpha(int i) { //////////////////////////////////////////////////////////////////////// - -void VL1L2Info::calc_ncep_stats() { +void VL1L2Info::compute_stats() { double u_diff, v_diff; int n = vcount; - u_diff = uf_bar - uo_bar; - v_diff = vf_bar - vo_bar; + u_diff = uf_bar - uo_bar; + v_diff = vf_bar - vo_bar; FBAR.v = f_speed_bar; OBAR.v = o_speed_bar; @@ -1619,196 +1780,112 @@ void VL1L2Info::calc_ncep_stats() { DIR_ABSERR.v = fabs(DIR_ERR.v); - ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); - - // Placeholder. JHG will add correct input variable and call compute_corr() - ANOM_CORR.v = bad_data_double; - - return; -} - -//////////////////////////////////////////////////////////////////////// - -void VL1L2Info::set(const PairDataPoint &pd_u_all, - const PairDataPoint &pd_v_all) { - int i; - double uf, vf, uo, vo, uc, vc, wgt, wgt_sum; - double u_diff, v_diff; - PairDataPoint pd_u, pd_v; + if(vacount > 0) { - // Initialize - zero_out(); + // Check for bad data since new are not present for previous versions + if(is_bad_data(fa_speed_bar) || is_bad_data(oa_speed_bar)) { + ANOM_CORR.v = bad_data_double; + } + else { + ANOM_CORR.v = compute_corr(fa_speed_bar*n, oa_speed_bar*n, + uvffa_bar*n, uvooa_bar*n, + uvfoa_bar*n, n); + } - // Check that the number of pairs are the same - if(pd_u_all.f_na.n() != pd_u_all.o_na.n() || - pd_u_all.f_na.n() != pd_v_all.f_na.n() || - pd_v_all.f_na.n() != pd_v_all.o_na.n()) { - mlog << Error << "\nVL1L2Info::set() -> " - << "unequal number of UGRD and VGRD pairs (" - << pd_u_all.f_na.n() << " != " << pd_u_all.o_na.n() - << ")\n\n"; - exit(1); + ANOM_CORR_UNCNTR.v = compute_anom_corr_uncntr(uvffa_bar, uvooa_bar, uvfoa_bar); } - // Apply wind speed filtering thresholds to subset pairs - subset_wind_pairs(pd_u_all, pd_v_all, fthresh, othresh, logic, pd_u, pd_v); - - // Check for no matched pairs to process - if(pd_u.n_obs == 0) return; - - // Get the sum of the weights - wgt_sum = pd_u.wgt_na.sum(); - - // Loop through the filtered pair data compute partial sums - for(i=0; i 0) calc_ncep_stats(); - - // Check for 0 points - if(vcount == 0) { - - uf_bar = bad_data_double; - vf_bar = bad_data_double; - uo_bar = bad_data_double; - vo_bar = bad_data_double; - uvfo_bar = bad_data_double; - uvff_bar = bad_data_double; - uvoo_bar = bad_data_double; - - me = bad_data_double; - mse = bad_data_double; - rmse = bad_data_double; - speed_bias = bad_data_double; - - FBAR.v = bad_data_double; - OBAR.v = bad_data_double; - - FS_RMS.v = bad_data_double; - OS_RMS.v = bad_data_double; - - MSVE.v = bad_data_double; - RMSVE.v = bad_data_double; - - FSTDEV.v = bad_data_double; - OSTDEV.v = bad_data_double; - - FDIR.v = bad_data_double; - ODIR.v = bad_data_double; - - FBAR_SPEED.v = bad_data_double; - OBAR_SPEED.v = bad_data_double; - - VDIFF_SPEED.v = bad_data_double; - VDIFF_DIR.v = bad_data_double; - - SPEED_ERR.v = bad_data_double; - SPEED_ABSERR.v = bad_data_double; - - DIR_ERR.v = bad_data_double; - DIR_ABSERR.v = bad_data_double; + // + // Compute the critical values for the Normal or Student's-T distribution + // based on the sample size + // + if(n >= large_sample_threshold) { + cv_normal_l = normal_cdf_inv(alpha[i]/2.0, 0.0, 1.0); + cv_normal_u = normal_cdf_inv(1.0 - (alpha[i]/2.0), 0.0, 1.0); + } + // + // If the number of samples is less than the large sample threshold, + // use the T-distribution + // + else { + cv_normal_l = students_t_cdf_inv(alpha[i]/2.0, n-1); + cv_normal_u = students_t_cdf_inv(1.0 - (alpha[i]/2.0), n-1); + } - ANOM_CORR.v = bad_data_double; - ANOM_CORR_UNCNTR.v = bad_data_double; - - } else { - rmse = sqrt(mse); - } + // + // Compute confidence interval for the anomaly correlation coefficient + // + if(is_bad_data(ANOM_CORR.v) || n <= 3 || + is_eq(ANOM_CORR.v, 1.0) || is_eq(ANOM_CORR.v, -1.0)) { + ANOM_CORR.v_ncl[i] = bad_data_double; + ANOM_CORR.v_ncu[i] = bad_data_double; + } + else { + v = 0.5*log((1 + ANOM_CORR.v)/(1 - ANOM_CORR.v)); + cl = v + cv_normal_l/sqrt((double) (n-3)); + cu = v + cv_normal_u/sqrt((double) (n-3)); + ANOM_CORR.v_ncl[i] = (pow(vx_math_e, 2*cl) - 1)/(pow(vx_math_e, 2*cl) + 1); + ANOM_CORR.v_ncu[i] = (pow(vx_math_e, 2*cu) - 1)/(pow(vx_math_e, 2*cu) + 1); + } - if(vacount == 0) { - ufa_bar = bad_data_double; - vfa_bar = bad_data_double; - uoa_bar = bad_data_double; - voa_bar = bad_data_double; - uvfoa_bar = bad_data_double; - uvffa_bar = bad_data_double; - uvooa_bar = bad_data_double; - } + } // end for i return; } + //////////////////////////////////////////////////////////////////////// double VL1L2Info::get_stat(const char *stat_name) { double v = bad_data_double; - if(strcmp(stat_name, "TOTAL" ) == 0) v = vcount; - else if(strcmp(stat_name, "FBAR" ) == 0) v = FBAR.v; - else if(strcmp(stat_name, "OBAR" ) == 0) v = OBAR.v; - else if(strcmp(stat_name, "FS_RMS" ) == 0) v = FS_RMS.v; - else if(strcmp(stat_name, "OS_RMS" ) == 0) v = OS_RMS.v; - else if(strcmp(stat_name, "MSVE" ) == 0) v = MSVE.v; - else if(strcmp(stat_name, "RMSVE" ) == 0) v = RMSVE.v; - else if(strcmp(stat_name, "FSTDEV" ) == 0) v = FSTDEV.v; - else if(strcmp(stat_name, "OSTDEV" ) == 0) v = OSTDEV.v; - else if(strcmp(stat_name, "FDIR" ) == 0) v = FDIR.v; - else if(strcmp(stat_name, "ODIR" ) == 0) v = ODIR.v; - else if(strcmp(stat_name, "FBAR_SPEED" ) == 0) v = FBAR_SPEED.v; - else if(strcmp(stat_name, "OBAR_SPEED" ) == 0) v = OBAR_SPEED.v; - else if(strcmp(stat_name, "VDIFF_SPEED" ) == 0) v = VDIFF_SPEED.v; - else if(strcmp(stat_name, "VDIFF_DIR" ) == 0) v = VDIFF_DIR.v; - else if(strcmp(stat_name, "SPEED_ERR" ) == 0) v = SPEED_ERR.v; - else if(strcmp(stat_name, "SPEED_ABSERR") == 0) v = SPEED_ABSERR.v; - else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR.v; - else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR.v; - else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR.v; - else if(strcmp(stat_name, "ANOM_CORR_UNCNTR" ) == 0) v = ANOM_CORR_UNCNTR.v; + if(strcmp(stat_name, "TOTAL" ) == 0) v = vcount; + else if(strcmp(stat_name, "FBAR" ) == 0) v = FBAR.v; + else if(strcmp(stat_name, "OBAR" ) == 0) v = OBAR.v; + else if(strcmp(stat_name, "FS_RMS" ) == 0) v = FS_RMS.v; + else if(strcmp(stat_name, "OS_RMS" ) == 0) v = OS_RMS.v; + else if(strcmp(stat_name, "MSVE" ) == 0) v = MSVE.v; + else if(strcmp(stat_name, "RMSVE" ) == 0) v = RMSVE.v; + else if(strcmp(stat_name, "FSTDEV" ) == 0) v = FSTDEV.v; + else if(strcmp(stat_name, "OSTDEV" ) == 0) v = OSTDEV.v; + else if(strcmp(stat_name, "FDIR" ) == 0) v = FDIR.v; + else if(strcmp(stat_name, "ODIR" ) == 0) v = ODIR.v; + else if(strcmp(stat_name, "FBAR_SPEED" ) == 0) v = FBAR_SPEED.v; + else if(strcmp(stat_name, "OBAR_SPEED" ) == 0) v = OBAR_SPEED.v; + else if(strcmp(stat_name, "VDIFF_SPEED" ) == 0) v = VDIFF_SPEED.v; + else if(strcmp(stat_name, "VDIFF_DIR" ) == 0) v = VDIFF_DIR.v; + else if(strcmp(stat_name, "SPEED_ERR" ) == 0) v = SPEED_ERR.v; + else if(strcmp(stat_name, "SPEED_ABSERR" ) == 0) v = SPEED_ABSERR.v; + else if(strcmp(stat_name, "DIR_ERR" ) == 0) v = DIR_ERR.v; + else if(strcmp(stat_name, "DIR_ABSERR" ) == 0) v = DIR_ABSERR.v; + else if(strcmp(stat_name, "ANOM_CORR" ) == 0) v = ANOM_CORR.v; + else if(strcmp(stat_name, "ANOM_CORR_UNCNTR") == 0) v = ANOM_CORR_UNCNTR.v; else { mlog << Error << "\nVL1L2Info::get_stat() -> " << "unknown continuous statistic name \"" << stat_name diff --git a/met/src/libcode/vx_statistics/met_stats.h b/met/src/libcode/vx_statistics/met_stats.h index 1515c8df12..7ba5247e8a 100644 --- a/met/src/libcode/vx_statistics/met_stats.h +++ b/met/src/libcode/vx_statistics/met_stats.h @@ -288,12 +288,10 @@ class VL1L2Info { double uvff_bar; double uvoo_bar; - // New VL1L2 Quantities added from vector stats whitepaper - double f_speed_bar; double o_speed_bar; - // New VL1L2 Quantities added from vector stats whitepaper + // Vector continuous statistics derived from VL1L2 and VAL1L2 partial sums CIInfo FBAR; CIInfo OBAR; @@ -307,8 +305,6 @@ class VL1L2Info { CIInfo FSTDEV; CIInfo OSTDEV; - // CIInfo COV; - CIInfo FDIR; CIInfo ODIR; @@ -326,9 +322,9 @@ class VL1L2Info { CIInfo ANOM_CORR; CIInfo ANOM_CORR_UNCNTR; - + // - // extra VL1L2 quantities for NCEP + // Extra VL1L2 quantities // double f_bar; // fcst wind speed @@ -349,21 +345,24 @@ class VL1L2Info { double vfa_bar; double uoa_bar; double voa_bar; + double uvfoa_bar; double uvffa_bar; double uvooa_bar; + double fa_speed_bar; + double oa_speed_bar; + int vacount; // Compute sums void set(const PairDataPoint &, const PairDataPoint &); - - // Calc stats - void calc_ncep_stats(); void clear(); void zero_out(); + void allocate_n_alpha(int); + void compute_stats(); void compute_ci(); double get_stat(const char *); diff --git a/met/src/tools/core/stat_analysis/parse_stat_line.cc b/met/src/tools/core/stat_analysis/parse_stat_line.cc index 2a5ff8d0d5..8fb4fbc672 100644 --- a/met/src/tools/core/stat_analysis/parse_stat_line.cc +++ b/met/src/tools/core/stat_analysis/parse_stat_line.cc @@ -230,7 +230,7 @@ void parse_vl1l2_line(STATLine &l, VL1L2Info &v_info) { v_info.f_speed_bar = atof(l.get_item("F_SPEED_BAR")); v_info.o_speed_bar = atof(l.get_item("O_SPEED_BAR")); - v_info.calc_ncep_stats(); + v_info.compute_stats(); return; } @@ -241,14 +241,18 @@ void parse_val1l2_line(STATLine &l, VL1L2Info &v_info) { v_info.clear(); - v_info.vacount = atoi(l.get_item("TOTAL")); - v_info.ufa_bar = atof(l.get_item("UFABAR")); - v_info.vfa_bar = atof(l.get_item("VFABAR")); - v_info.uoa_bar = atof(l.get_item("UOABAR")); - v_info.voa_bar = atof(l.get_item("VOABAR")); - v_info.uvfoa_bar = atof(l.get_item("UVFOABAR")); - v_info.uvffa_bar = atof(l.get_item("UVFFABAR")); - v_info.uvooa_bar = atof(l.get_item("UVOOABAR")); + v_info.vacount = atoi(l.get_item("TOTAL")); + v_info.ufa_bar = atof(l.get_item("UFABAR")); + v_info.vfa_bar = atof(l.get_item("VFABAR")); + v_info.uoa_bar = atof(l.get_item("UOABAR")); + v_info.voa_bar = atof(l.get_item("VOABAR")); + v_info.uvfoa_bar = atof(l.get_item("UVFOABAR")); + v_info.uvffa_bar = atof(l.get_item("UVFFABAR")); + v_info.uvooa_bar = atof(l.get_item("UVOOABAR")); + v_info.fa_speed_bar = atof(l.get_item("FA_SPEED_BAR")); + v_info.oa_speed_bar = atof(l.get_item("OA_SPEED_BAR")); + + v_info.compute_stats(); return; } diff --git a/test/hdr/met_11_0.hdr b/test/hdr/met_11_0.hdr index 7f4f1f8b49..4b5bf6272a 100644 --- a/test/hdr/met_11_0.hdr +++ b/test/hdr/met_11_0.hdr @@ -26,7 +26,7 @@ SAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_L SL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR OBAR FOBAR FFBAR OOBAR MAE SSVAR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_BIN BIN_i BIN_N VAR_MIN VAR_MAX VAR_MEAN FBAR OBAR FOBAR FFBAR OOBAR FBAR_NCL FBAR_NCU FSTDEV FSTDEV_NCL FSTDEV_NCU OBAR_NCL OBAR_NCU OSTDEV OSTDEV_NCL OSTDEV_NCU PR_CORR PR_CORR_NCL PR_CORR_NCU ME ME_NCL ME_NCU ESTDEV ESTDEV_NCL ESTDEV_NCU MBIAS MSE BCMSE RMSE VL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFBAR VFBAR UOBAR VOBAR UVFOBAR UVFFBAR UVOOBAR F_SPEED_BAR O_SPEED_BAR -VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR +VAL1L2 : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL UFABAR VFABAR UOABAR VOABAR UVFOABAR UVFFABAR UVOOABAR FA_SPEED_BAR OA_SPEED_BAR VCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBAR FBAR_BCL FBAR_BCU OBAR OBAR_BCL OBAR_BCU FS_RMS FS_RMS_BCL FS_RMS_BCU OS_RMS OS_RMS_BCL OS_RMS_BCU MSVE MSVE_BCL MSVE_BCU RMSVE RMSVE_BCL RMSVE_BCU FSTDEV FSTDEV_BCL FSTDEV_BCU OSTDEV OSTDEV_BCL OSTDEV_BCU FDIR FDIR_BCL FDIR_BCU ODIR ODIR_BCL ODIR_BCU FBAR_SPEED FBAR_SPEED_BCL FBAR_SPEED_BCU OBAR_SPEED OBAR_SPEED_BCL OBAR_SPEED_BCU VDIFF_SPEED VDIFF_SPEED_BCL VDIFF_SPEED_BCU VDIFF_DIR VDIFF_DIR_BCL VDIFF_DIR_BCU SPEED_ERR SPEED_ERR_BCL SPEED_ERR_BCU SPEED_ABSERR SPEED_ABSERR_BCL SPEED_ABSERR_BCU DIR_ERR DIR_ERR_BCL DIR_ERR_BCU DIR_ABSERR DIR_ABSERR_BCL DIR_ABSERR_BCU ANOM_CORR ANOM_CORR_NCL ANOM_CORR_NCU ANOM_CORR_BCL ANOM_CORR_BCU ANOM_CORR_UNCNTR ANOM_CORR_UNCNTR_BCL ANOM_CORR_UNCNTR_BCU GENMPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX STORM_ID PROB_LEAD PROB_VAL AGEN_INIT AGEN_FHR AGEN_LAT AGEN_LON AGEN_DLAND BGEN_LAT BGEN_LON BGEN_DLAND GEN_DIST GEN_TDIFF INIT_TDIFF DEV_CAT OPS_CAT SSIDX : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE FCST_MODEL REF_MODEL N_INIT N_TERM N_VLD SS_INDEX From 8eb94c7dd97dcf0219971dd6fca99dcaa2372a00 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 29 Apr 2022 18:28:40 -0600 Subject: [PATCH 21/31] Per #2022, update the writing of the VCNT output line to write the alpha value and anomaly correlation CI's. --- met/src/libcode/vx_stat_out/stat_columns.cc | 55 +++++++++--------- met/src/libcode/vx_stat_out/stat_columns.h | 2 +- .../libcode/vx_statistics/.met_stats.h.swp | Bin 16384 -> 0 bytes .../core/stat_analysis/aggr_stat_line.cc | 26 ++++++++- .../core/stat_analysis/stat_analysis_job.cc | 9 +-- 5 files changed, 60 insertions(+), 32 deletions(-) delete mode 100644 met/src/libcode/vx_statistics/.met_stats.h.swp diff --git a/met/src/libcode/vx_stat_out/stat_columns.cc b/met/src/libcode/vx_stat_out/stat_columns.cc index 89538529c8..2a9785d704 100644 --- a/met/src/libcode/vx_stat_out/stat_columns.cc +++ b/met/src/libcode/vx_stat_out/stat_columns.cc @@ -954,11 +954,11 @@ void write_val1l2_row(StatHdrColumns &shc, const VL1L2Info &vl1l2_info, //////////////////////////////////////////////////////////////////////// - void write_vcnt_row(StatHdrColumns &shc, const VL1L2Info &vcnt_info, STATOutputType out_type, AsciiTable &stat_at, int &stat_row, AsciiTable &txt_at, int &txt_row) { + int i; // VL1L2 line type shc.set_line_type(stat_vcnt_str); @@ -970,24 +970,30 @@ void write_vcnt_row(StatHdrColumns &shc, const VL1L2Info &vcnt_info, // Not Applicable shc.set_cov_thresh(na_str); - shc.set_alpha(bad_data_double); - // Write the header columns - write_header_cols(shc, stat_at, stat_row); + // Write a line for each alpha value + for(i=0; iZzXDo!N)r`beza{Y}r* zSM_!Ezw4{2?yh2Hd;cI^+ucjB-9<=smRmgKZXo*{LUzltS1u{T)LW$*3g$jKbtYKT z+ofBr@Gx!nr2Rnd=2jG@2cO6*3O28CSNaw1MR8h%N9i!I(yl04(&p*f-a;6$NQ9BF z!ZfV$&#=2Z?O{y@qkvH$R$viX)7z6#UptmRM3*eyW^^$M7zK<1MggOMQNSo*6fg=H z1^!10ME*RoALlzupYtKTzoljWyWWoL^jBK!ziIoMI(?OPkodW-?T5AflNS50+OF!N zwjH`cN%?EqzNl^{ms;#P+3bu0MggOMQNSo*6fg=H1&jhl0i%FXz$jo8m_Pw$6LL4w zxw@am`~T$r|J;2ii6yakSc!(bN}0MCH= z;OcFJTn68Q?gUfSp?%*Q00M3GU!9lPCJP&%nePAw_1Fp=*wFB>flVCp> z1-ro}a6kAFZRI>T0S*8G9H82e4cfPT8wicJniMv*WW}#WykLpWl@l7&LXWV;#%#OO zmer!mQ*`3}cwg=L$J;}!Adyiy;9ISbVJX;pIl{hlK!v#b;?4}&m_KMEWPB_1>~j;&&>r#^#3#WuUHbYjm* zFA`pfd)7#vK}w1hI1T4@RcTjT>7)ee9v?`bOOl*UQ}}X(4Og5Z6Ax<4rEyV;Z&e;9 zCpVbO55=dqf=ZtUERw-St$5Sa&?iZnJjZAwOM4+LsgGtNto2C^;zq~9P?WsM-Nu=O zC!&HA$Vwr!P*ba{8=)VF8m=fjS}q*Xqzd#!MBEH*aD;!Fiw_V<8bT;e2di!*R_Ac= zk_<+a=*b17^(&Z@RWAxD^K3fQSRYmQH8T|>q!GQkg_QK-D=nr~W&!PLw&wp%jNf!5 zy3)20f-+En$ko>{{^YiZzltOdbmTfLNKq?-0_5|%dZ>S?kivR8Xz?dubF9d$Q2c33YQ)6n8*#(-qx86j@@~j&^ zmM4RX8t&AA_KFIYrAn{mXf@%CIfLyi5Uf5_I&PeuI?O^3PaP163P%qUh~}uN>s%Y> z1H&qn4voslo%Hp|VbwtGHO6w?FSQT3iJ=)V@!TVcu=+%#Ir|x{=Wkxj=5KX*rVp=H zhc^~o_0lsRT-F40mm&sIJM5ld3}#KWana-14c#N6G8GtjUAcz`@$g&qF}<1Dk+(yj zaaL_kmt*;JDG+vdc{v%ESdE0+mKdL2NhOcT>@yL>ky-F18q4@XC=sa%VO(Zr<_(z6 zkPe$W!sC<{3Tln_P(GUHHM`=h0Sdn&a%?_;8xi-h? zXa_m0RL7N9@tch*GW5#`V2d`qbZ*XNwN2J%ylqV3ob*Qm zQ7T7NrP5AoCGAdhqkvJsC}0#Y3K#{90!9I&fKk9G00n07(E|5ufd>c_4-8tL zF3jLz_+H%Pd+H6BdK#I$xeS;$tRI;@j%S@)T!x1nD^hgakL0mqDlV;_sS)i>TM}second.vl1l2_info, job.stat_at, + write_vcnt_cols(it->second.vl1l2_info, 0, job.stat_at, job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"VCNT:"); write_case_cols(it->first, at, r, c); - write_vcnt_cols(it->second.vl1l2_info, at, r++, c); + write_vcnt_cols(it->second.vl1l2_info, 0, at, r++, c); } } // @@ -3428,13 +3429,13 @@ void write_job_aggr_mpr_wind(STATAnalysisJob &job, STATLineType lt, // else if(lt == stat_vcnt) { if(job.stat_out) { - write_vcnt_cols(it->second.vl1l2_info, job.stat_at, + write_vcnt_cols(it->second.vl1l2_info, 0, job.stat_at, job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "VCNT:"); write_case_cols(it->first, at, r, c); - write_vcnt_cols(it->second.vl1l2_info, at, r++, c); + write_vcnt_cols(it->second.vl1l2_info, 0, at, r++, c); } } // From e53bf20d9fbe58d2ce962817ba746423e5c70489 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Thu, 19 May 2022 15:44:49 -0600 Subject: [PATCH 22/31] Per #2022, update point_stat and grid_stat to allocate alpha values for VL1L2Info objects to store CI's. --- src/tools/core/grid_stat/grid_stat.cc | 7 ++++++- src/tools/core/point_stat/point_stat.cc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tools/core/grid_stat/grid_stat.cc b/src/tools/core/grid_stat/grid_stat.cc index fbbdfbc773..cb3ad48ffe 100644 --- a/src/tools/core/grid_stat/grid_stat.cc +++ b/src/tools/core/grid_stat/grid_stat.cc @@ -2155,7 +2155,7 @@ void do_cnt_sl1l2(const GridStatVxOpt &vx_opt, const PairDataPoint *pd_ptr) { void do_vl1l2(VL1L2Info *&v_info, int i_vx, const PairDataPoint *pd_u_ptr, const PairDataPoint *pd_v_ptr) { - int i; + int i, j; // Check that the number of pairs are the same if(pd_u_ptr->n_obs != pd_v_ptr->n_obs) { @@ -2178,6 +2178,11 @@ void do_vl1l2(VL1L2Info *&v_info, int i_vx, v_info[i].fthresh = conf_info.vx_opt[i_vx].fwind_ta[i]; v_info[i].othresh = conf_info.vx_opt[i_vx].owind_ta[i]; v_info[i].logic = conf_info.vx_opt[i_vx].wind_logic; + v_info[i].allocate_n_alpha(conf_info.vx_opt[i_vx].get_n_ci_alpha()); + + for(j=0; j Date: Thu, 19 May 2022 16:00:56 -0600 Subject: [PATCH 23/31] Per #2022, call VL1L2Info::zero_out() instead of clear() so that we don't throw away allocated alpha values. --- src/tools/core/stat_analysis/parse_stat_line.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/core/stat_analysis/parse_stat_line.cc b/src/tools/core/stat_analysis/parse_stat_line.cc index 8fb4fbc672..b95718f547 100644 --- a/src/tools/core/stat_analysis/parse_stat_line.cc +++ b/src/tools/core/stat_analysis/parse_stat_line.cc @@ -217,7 +217,7 @@ void parse_sal1l2_line(STATLine &l, SL1L2Info &s_info) { void parse_vl1l2_line(STATLine &l, VL1L2Info &v_info) { - v_info.clear(); + v_info.zero_out(); v_info.vcount = atoi(l.get_item("TOTAL")); v_info.uf_bar = atof(l.get_item("UFBAR")); From 2b07df37ad06ea70969c176b747f6dbdc4cd213a Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 May 2022 10:35:13 -0600 Subject: [PATCH 24/31] Per #2022, update the Point-Stat and Grid-Stat logic to include the number of alpha values when deciding how many VCNT lines to write. --- src/tools/core/grid_stat/grid_stat_conf_info.cc | 10 +++++++++- src/tools/core/point_stat/point_stat_conf_info.cc | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.cc b/src/tools/core/grid_stat/grid_stat_conf_info.cc index f0c31c115f..7cdae0c351 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.cc +++ b/src/tools/core/grid_stat/grid_stat_conf_info.cc @@ -1036,7 +1036,6 @@ int GridStatVxOpt::n_txt_row(int i_txt_row) const { case(i_vl1l2): case(i_val1l2): - case(i_vcnt): // Number of VL1L2 or VAL1L2 lines = // Masks * (Smoothing Methods + Fourier Waves) * Thresholds n = (!vect_flag ? 0 : @@ -1044,6 +1043,15 @@ int GridStatVxOpt::n_txt_row(int i_txt_row) const { get_n_wind_thresh()); break; + case(i_vcnt): + // Number of VCNT lines = + // Masks * (Smoothing Methods + Fourier Waves) * Thresholds * + // Alphas + n = (!vect_flag ? 0 : + get_n_mask() * (get_n_interp() + get_n_wave_1d()) * + get_n_wind_thresh() * get_n_ci_alpha()); + break; + case(i_nbrctc): // Number of NBRCTC lines = // Masks * Thresholds * Neighborhoods * Frac Thresholds diff --git a/src/tools/core/point_stat/point_stat_conf_info.cc b/src/tools/core/point_stat/point_stat_conf_info.cc index 49f1de8a9c..f2eb3cb06a 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.cc +++ b/src/tools/core/point_stat/point_stat_conf_info.cc @@ -1173,13 +1173,20 @@ int PointStatVxOpt::n_txt_row(int i_txt_row) const { case(i_vl1l2): case(i_val1l2): - case(i_vcnt): // Number of VL1L2 or VAL1L2 lines = // Message Types * Masks * Interpolations * Thresholds n = (!vect_flag ? 0 : n_pd * get_n_wind_thresh()); break; + case(i_vcnt): + // Number of VCNT lines = + // Message Types * Masks * Interpolations * Thresholds * + // Alphas + n = (!vect_flag ? 0 : n_pd * + get_n_wind_thresh() * get_n_ci_alpha()); + break; + case(i_pct): case(i_pjc): case(i_prc): From bb8f6e5173bb5fd3d5ac6600e7c129e586b61acc Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 May 2022 11:06:53 -0600 Subject: [PATCH 25/31] Per #2022, update the VL1L2Info::operator+= logic to copy over the allocated alpha values. --- src/libcode/vx_statistics/met_stats.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcode/vx_statistics/met_stats.cc b/src/libcode/vx_statistics/met_stats.cc index b3d47ca8c1..638cfbc4f3 100644 --- a/src/libcode/vx_statistics/met_stats.cc +++ b/src/libcode/vx_statistics/met_stats.cc @@ -1325,6 +1325,10 @@ VL1L2Info & VL1L2Info::operator=(const VL1L2Info &c) { VL1L2Info & VL1L2Info::operator+=(const VL1L2Info &c) { VL1L2Info v_info; + // Store alpha values + v_info.allocate_n_alpha(n_alpha); + for(int i=0; i 0) { From 722e2e06d9bda8a36818e74fc98fd85aa931e98a Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 May 2022 11:52:38 -0600 Subject: [PATCH 26/31] Per #2022, enhance stat_analysis to support an aggregate_stat job type for VAL1L2->VCNT. This writes ANOM_CORR and ANOM_CORR_UNCNTR output columns. However, there are still things to address. The other stats should be written as NA instead of 0. Recommend changing the VL1L2Info::zero_out() function to intialize stat values to NA instead of 0. Need to update the docs to reflect this support. Also need to actually compute the parametric CI's for ANOM_CORR. Big picture, we should store the VCNT stats in a new VCNTInfo class... just like the SL1L2Info/CNTInfo setup. Storing the sums AND stats in the same VL1L2Info class is unnecessarily confusing. --- src/libcode/vx_stat_out/stat_columns.cc | 3 ++- src/libcode/vx_statistics/met_stats.cc | 2 ++ src/tools/core/stat_analysis/parse_stat_line.cc | 2 +- src/tools/core/stat_analysis/stat_analysis_job.cc | 8 ++++---- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libcode/vx_stat_out/stat_columns.cc b/src/libcode/vx_stat_out/stat_columns.cc index 2a9785d704..4ca1718ba8 100644 --- a/src/libcode/vx_stat_out/stat_columns.cc +++ b/src/libcode/vx_stat_out/stat_columns.cc @@ -2966,7 +2966,8 @@ void write_vcnt_cols(const VL1L2Info &vcnt_info, int i, // ANOM_CORR_UNCNTR, ANOM_CORR_UNCNTR_BCL, ANOM_CORR_UNCNTR_BCU // - at.set_entry(r, c++, vcnt_info.vcount); // TOTAL + at.set_entry(r, c++, max(vcnt_info.vcount, // TOTAL + vcnt_info.vacount)); at.set_entry(r, c++, vcnt_info.FBAR.v); // FBAR at.set_entry(r, c++, (string)na_str); // FBAR_BCL diff --git a/src/libcode/vx_statistics/met_stats.cc b/src/libcode/vx_statistics/met_stats.cc index 638cfbc4f3..ac78ccc336 100644 --- a/src/libcode/vx_statistics/met_stats.cc +++ b/src/libcode/vx_statistics/met_stats.cc @@ -1786,6 +1786,8 @@ void VL1L2Info::compute_stats() { if(vacount > 0) { + n = vacount; + // Check for bad data since new are not present for previous versions if(is_bad_data(fa_speed_bar) || is_bad_data(oa_speed_bar)) { ANOM_CORR.v = bad_data_double; diff --git a/src/tools/core/stat_analysis/parse_stat_line.cc b/src/tools/core/stat_analysis/parse_stat_line.cc index b95718f547..f09772d16a 100644 --- a/src/tools/core/stat_analysis/parse_stat_line.cc +++ b/src/tools/core/stat_analysis/parse_stat_line.cc @@ -239,7 +239,7 @@ void parse_vl1l2_line(STATLine &l, VL1L2Info &v_info) { void parse_val1l2_line(STATLine &l, VL1L2Info &v_info) { - v_info.clear(); + v_info.zero_out(); v_info.vacount = atoi(l.get_item("TOTAL")); v_info.ufa_bar = atof(l.get_item("UFABAR")); diff --git a/src/tools/core/stat_analysis/stat_analysis_job.cc b/src/tools/core/stat_analysis/stat_analysis_job.cc index 13b9f54b86..025d10af1d 100644 --- a/src/tools/core/stat_analysis/stat_analysis_job.cc +++ b/src/tools/core/stat_analysis/stat_analysis_job.cc @@ -724,10 +724,11 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // // Sum the vector partial sum line types: - // VL1L2 -> VCNT + // VL1L2, VAL1L2 -> VCNT // - else if(in_lt == stat_vl1l2 && - has_line_type(out_lt, stat_vcnt)) { + else if((in_lt == stat_vl1l2 || + in_lt == stat_val1l2) && + has_line_type(out_lt, stat_vcnt)) { aggr_psum_lines(f, job, psum_map, n_in, n_out); for(it=out_lt.begin(); it!=out_lt.end(); it++) { write_job_aggr_psum(job, *it, psum_map, out_at); @@ -1863,7 +1864,6 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, // VCNT output line // else if(lt == stat_vcnt) { - if(job.stat_out) { write_vcnt_cols(it->second.vl1l2_info, 0, job.stat_at, job.stat_row++, n_header_columns); From dc00933d81286705a07b91989e1b79fe03a5b97f Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 May 2022 11:55:29 -0600 Subject: [PATCH 27/31] Per #2022, update Stat-Analysis docs to list VAL1L2 -> VCNT as a supported conversion type. --- docs/Users_Guide/stat-analysis.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Users_Guide/stat-analysis.rst b/docs/Users_Guide/stat-analysis.rst index b398827234..05b9fae218 100644 --- a/docs/Users_Guide/stat-analysis.rst +++ b/docs/Users_Guide/stat-analysis.rst @@ -45,7 +45,7 @@ The Stat-Analysis "aggregate" job aggregates values from multiple STAT lines of Aggregate STAT lines and produce aggregated statistics ------------------------------------------------------ -The Stat-Analysis "aggregate-stat" job aggregates multiple STAT lines of the same type together and produces relevant statistics from the aggregated line. This may be done in the same manner listed above in :numref:`StA_Aggregated-values-from`. However, rather than writing out the aggregated STAT line itself, the relevant statistics generated from that aggregated line are provided in the output. Specifically, if a contingency table line type (FHO, CTC, PCT, MCTC, or NBRCTC) has been aggregated, contingency table statistics (CTS, ECLV, PSTD, MCTS, or NBRCTS) line types can be computed. If a partial sums line type (SL1L2 or SAL1L2) has been aggregated, the continuous statistics (CNT) line type can be computed. If a vector partial sums line type (VL1L2) has been aggregated, the vector continuous statistics (VCNT) line type can be computed. For ensembles, the ORANK line type can be accumulated into ECNT, RPS, RHIST, PHIST, RELP, or SSVAR output. If the matched pair line type (MPR) has been aggregated, may output line types (FHO, CTC, CTS, CNT, MCTC, MCTS, SL1L2, SAL1L2, VL1L2, VCNT, WDIR, PCT, PSTD, PJC, PRC, or ECLV) can be computed. Multiple output line types may be specified for each "aggregate-stat" job, as long as each output is derivable from the input. +The Stat-Analysis "aggregate-stat" job aggregates multiple STAT lines of the same type together and produces relevant statistics from the aggregated line. This may be done in the same manner listed above in :numref:`StA_Aggregated-values-from`. However, rather than writing out the aggregated STAT line itself, the relevant statistics generated from that aggregated line are provided in the output. Specifically, if a contingency table line type (FHO, CTC, PCT, MCTC, or NBRCTC) has been aggregated, contingency table statistics (CTS, ECLV, PSTD, MCTS, or NBRCTS) line types can be computed. If a partial sums line type (SL1L2 or SAL1L2) has been aggregated, the continuous statistics (CNT) line type can be computed. If a vector partial sums line type (VL1L2 or VAL1L2) has been aggregated, the vector continuous statistics (VCNT) line type can be computed. For ensembles, the ORANK line type can be accumulated into ECNT, RPS, RHIST, PHIST, RELP, or SSVAR output. If the matched pair line type (MPR) has been aggregated, may output line types (FHO, CTC, CTS, CNT, MCTC, MCTS, SL1L2, SAL1L2, VL1L2, VCNT, WDIR, PCT, PSTD, PJC, PRC, or ECLV) can be computed. Multiple output line types may be specified for each "aggregate-stat" job, as long as each output is derivable from the input. When aggregating the matched pair line type (MPR), additional required job command options are determined by the requested output line type(s). For example, the "-out_thresh" (or "-out_fcst_thresh" and "-out_obs_thresh" options) are required to compute contingnecy table counts (FHO, CTC) or statistics (CTS). Those same job command options can also specify filtering thresholds when computing continuous partial sums (SL1L2, SAL1L2) or statistics (CNT). Output is written for each threshold specified. @@ -777,7 +777,7 @@ This job is similar to the "**aggregate**" job listed above, however the format * - SL1L2 or SAL1L2 - CNT * - VL1L2 or VAL1L2 - - WDIR (wind direction) + - WDIR (wind direction), VCNT * - PCT - PSTD, PJC, PRC * - NBRCTC From 30cb0a3efdfc10e3df58be925fbe6f9b38b8c3dd Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 20 May 2022 12:08:43 -0600 Subject: [PATCH 28/31] Per #2022, when computing VL1L2Info CI's, n should be set to vacount rather than the number of input pairs. --- src/libcode/vx_statistics/met_stats.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcode/vx_statistics/met_stats.cc b/src/libcode/vx_statistics/met_stats.cc index ac78ccc336..e13628b46e 100644 --- a/src/libcode/vx_statistics/met_stats.cc +++ b/src/libcode/vx_statistics/met_stats.cc @@ -1815,10 +1815,12 @@ void VL1L2Info::compute_ci() { double v, cl, cu; // - // Compute the confidence interval for each alpha value specified. + // Compute the confidence interval for each alpha value specified // for(i=0; i Date: Fri, 20 May 2022 12:14:45 -0600 Subject: [PATCH 29/31] Per #2022, add a new call to Stat-Analysis to exercise the VAL1L2 to VCNT conversion. --- .../test_unit/xml/unit_climatology_1.5deg.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/test_unit/xml/unit_climatology_1.5deg.xml b/internal/test_unit/xml/unit_climatology_1.5deg.xml index 52dd69897b..cd1a86b353 100644 --- a/internal/test_unit/xml/unit_climatology_1.5deg.xml +++ b/internal/test_unit/xml/unit_climatology_1.5deg.xml @@ -47,7 +47,7 @@ - + &MET_BIN;/stat_analysis OUTPUT_DIR &OUTPUT_DIR;/climatology_1.5deg @@ -62,6 +62,21 @@ + + &MET_BIN;/stat_analysis + + OUTPUT_DIR &OUTPUT_DIR;/climatology_1.5deg + + \ + -lookin &OUTPUT_DIR;/climatology_1.5deg/point_stat_WMO_CLIMO_1.5DEG_120000L_20120409_120000V.stat \ + -job aggregate_stat -line_type VAL1L2 -out_line_type VCNT -by FCST_LEV \ + -out_stat &OUTPUT_DIR;/climatology_1.5deg/stat_analysis_WMO_1.5DEG_VAL1L2_to_VCNT_out.stat + + + &OUTPUT_DIR;/climatology_1.5deg/stat_analysis_WMO_1.5DEG_VAL1L2_to_VCNT_out.stat + + + &MET_BIN;/stat_analysis From a347a83c7599fbfefac85a04ffa32eb8c719c03e Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Thu, 26 May 2022 14:33:05 -0600 Subject: [PATCH 30/31] Per #2022, ci-run-unit fix an aggregation bug in VL1L2Info::operator+=(). --- src/libcode/vx_statistics/met_stats.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcode/vx_statistics/met_stats.cc b/src/libcode/vx_statistics/met_stats.cc index e13628b46e..1a68aa22b1 100644 --- a/src/libcode/vx_statistics/met_stats.cc +++ b/src/libcode/vx_statistics/met_stats.cc @@ -1353,8 +1353,8 @@ VL1L2Info & VL1L2Info::operator+=(const VL1L2Info &c) { v_info.uvfoa_bar = (uvfoa_bar*vacount + c.uvfoa_bar*c.vacount)/v_info.vacount; v_info.uvffa_bar = (uvffa_bar*vacount + c.uvffa_bar*c.vacount)/v_info.vacount; v_info.uvooa_bar = (uvooa_bar*vacount + c.uvooa_bar*c.vacount)/v_info.vacount; - v_info.fa_speed_bar = (fa_speed_bar*vcount + c.fa_speed_bar*c.vcount)/v_info.vcount; - v_info.oa_speed_bar = (oa_speed_bar*vcount + c.oa_speed_bar*c.vcount)/v_info.vcount; + v_info.fa_speed_bar = (fa_speed_bar*vacount + c.fa_speed_bar*c.vacount)/v_info.vacount; + v_info.oa_speed_bar = (oa_speed_bar*vacount + c.oa_speed_bar*c.vacount)/v_info.vacount; } v_info.compute_stats(); From 278ae11abac9aa1503345de8ee46442831b44a70 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Fri, 27 May 2022 15:45:46 -0600 Subject: [PATCH 31/31] Per issue #2022, added _vcnt.txt output files to check to relevant tests based on if vcnt output file is being generated via the config file. SL --- internal/test_unit/xml/unit_point_stat.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/test_unit/xml/unit_point_stat.xml b/internal/test_unit/xml/unit_point_stat.xml index d5446343cd..dd607efaff 100644 --- a/internal/test_unit/xml/unit_point_stat.xml +++ b/internal/test_unit/xml/unit_point_stat.xml @@ -45,6 +45,7 @@ &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_120000L_20120409_120000V_sal1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_120000L_20120409_120000V_vl1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_120000L_20120409_120000V_val1l2.txt + &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_120000L_20120409_120000V_vcnt.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_120000L_20120409_120000V_mpr.txt @@ -94,6 +95,7 @@ &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_MASK_SID_120000L_20120409_120000V_sal1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_MASK_SID_120000L_20120409_120000V_vl1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_MASK_SID_120000L_20120409_120000V_val1l2.txt + &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_MASK_SID_120000L_20120409_120000V_vcnt.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB1_NAM_GDAS_MASK_SID_120000L_20120409_120000V_mpr.txt @@ -123,6 +125,7 @@ &OUTPUT_DIR;/point_stat/point_stat_GRIB2_NAM_NDAS_120000L_20120409_120000V_sal1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_NAM_NDAS_120000L_20120409_120000V_vl1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_NAM_NDAS_120000L_20120409_120000V_val1l2.txt + &OUTPUT_DIR;/point_stat/point_stat_GRIB2_NAM_NDAS_120000L_20120409_120000V_vcnt.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_NAM_NDAS_120000L_20120409_120000V_mpr.txt @@ -150,6 +153,7 @@ &OUTPUT_DIR;/point_stat/point_stat_GRIB2_SREF_GDAS_150000L_20120409_120000V_cnt.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_SREF_GDAS_150000L_20120409_120000V_sl1l2.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_SREF_GDAS_150000L_20120409_120000V_vl1l2.txt + &OUTPUT_DIR;/point_stat/point_stat_GRIB2_SREF_GDAS_150000L_20120409_120000V_vcnt.txt &OUTPUT_DIR;/point_stat/point_stat_GRIB2_SREF_GDAS_150000L_20120409_120000V_mpr.txt