Skip to content

Commit

Permalink
Per #1673, enhance Grid-Stat to parse the new beta_value option and s…
Browse files Browse the repository at this point in the history
…et its value in the library code.
  • Loading branch information
JohnHalleyGotway committed Jul 8, 2021
1 parent e423644 commit caff652
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions met/src/basic/vx_config/config_constants.h
Expand Up @@ -692,6 +692,7 @@ static const char conf_key_baddeley_p[] = "baddeley_p";
static const char conf_key_baddeley_max_dist[] = "baddeley_max_dist";
static const char conf_key_fom_alpha[] = "fom_alpha";
static const char conf_key_zhu_weight[] = "zhu_weight";
static const char conf_key_beta_value[] = "beta_value";

//
// Wavelet-Stat specific parameter key names
Expand Down
14 changes: 9 additions & 5 deletions met/src/libcode/vx_statistics/met_stats.cc
Expand Up @@ -2750,10 +2750,11 @@ void DMAPInfo::clear() {
////////////////////////////////////////////////////////////////////////

void DMAPInfo::reset_options() {
baddeley_p = 2; // Exponent for lp-norm
baddeley_max_dist = 5.0; // Maximum distance constant
fom_alpha = 0.1; // FOM Alpha
zhu_weight = 0.5; // Zhu Weight
baddeley_p = 2; // Exponent for lp-norm
baddeley_max_dist = bad_data_double; // Maximum distance constant
fom_alpha = 0.1; // FOM Alpha
zhu_weight = 0.5; // Zhu Weight
beta_value = bad_data_double; // G-Beta Value

return;
}
Expand Down Expand Up @@ -2796,6 +2797,7 @@ void DMAPInfo::assign(const DMAPInfo &c) {
baddeley_max_dist = c.baddeley_max_dist;
fom_alpha = c.fom_alpha;
zhu_weight = c.zhu_weight;
beta_value = c.beta_value;

return;
}
Expand Down Expand Up @@ -2948,11 +2950,13 @@ void DMAPInfo::set(const SingleThresh &fthr, const SingleThresh &othr,
////////////////////////////////////////////////////////////////////////

void DMAPInfo::set_options(const int _baddeley_p, const double _baddeley_max_dist,
const double _fom_alpha, const double _zhu_weight) {
const double _fom_alpha, const double _zhu_weight,
const double _beta_value) {
baddeley_p = _baddeley_p;
baddeley_max_dist = _baddeley_max_dist;
fom_alpha = _fom_alpha;
zhu_weight = _zhu_weight;
beta_value = _beta_value;
}

////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion met/src/libcode/vx_statistics/met_stats.h
Expand Up @@ -606,6 +606,7 @@ class DMAPInfo {
double baddeley_max_dist; // Maximum distance constant
double fom_alpha; // FOM Alpha
double zhu_weight; // Zhu Weight
double beta_value; // G-Beta Value

public:

Expand Down Expand Up @@ -642,7 +643,8 @@ class DMAPInfo {
const NumArray &fthr_na, const NumArray &othr_na);

void set_options(const int _baddeley_p, const double _baddeley_max_dist,
const double _fom_alpha, const double _zhu_weight);
const double _fom_alpha, const double _zhu_weight,
const double _beta_value);

void clear();
void reset_options();
Expand Down
14 changes: 14 additions & 0 deletions met/src/tools/core/grid_stat/grid_stat_conf_info.cc
Expand Up @@ -529,6 +529,12 @@ void GridStatVxOpt::clear() {
grad_dx.clear();
grad_dy.clear();

baddeley_p = bad_data_int;
baddeley_max_dist = bad_data_double;
fom_alpha = bad_data_double;
zhu_weight = bad_data_double;
beta_value = bad_data_double;

hss_ec_value = bad_data_double;
rank_corr_flag = false;

Expand Down Expand Up @@ -811,6 +817,14 @@ void GridStatVxOpt::process_config(
exit(1);
}

beta_value = d->lookup_double(conf_key_beta_value);
if(beta_value <=0) {
mlog << Error << "\nGridStatVxOpt::process_config() -> "
<< "The \"" << conf_key_beta_value << "\" option ("
<< beta_value << ") must be set > 0.\n\n";
exit(1);
}

// Conf: hss_ec_value
hss_ec_value = odict.lookup_double(conf_key_hss_ec_value);

Expand Down
3 changes: 2 additions & 1 deletion met/src/tools/core/grid_stat/grid_stat_conf_info.h
Expand Up @@ -186,7 +186,8 @@ class GridStatVxOpt {
int baddeley_p; // Exponent for lp-norm
double baddeley_max_dist; // Maximum distance constant
double fom_alpha; // FOM Alpha
double zhu_weight; // Zhu Weight
double zhu_weight; // Zhu Weight
double beta_value; // G-Beta Value

double hss_ec_value; // MCTS HSS expected correct value
bool rank_corr_flag; // Flag for computing rank correlations
Expand Down

0 comments on commit caff652

Please sign in to comment.