Skip to content

Commit

Permalink
Per #1528, add config constants for plot_point_obs options and update…
Browse files Browse the repository at this point in the history
… PlotInfo to include an on/off flag and colorbar flag.
  • Loading branch information
JohnHalleyGotway committed Nov 10, 2020
1 parent c30edd6 commit c24890a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ struct HiRAInfo {
//

struct PlotInfo {
bool flag; // Enable options
ConcatString color_table; // Color table file
double plot_min; // Minimum plot value
double plot_max; // Maximum plot value
bool colorbar_flag; // Turn on/off plotting the colorbar
int colorbar_spacing; // Spacing of colors in the colorbar

void clear();
Expand Down Expand Up @@ -592,6 +594,7 @@ static const char conf_key_obs_raw_plot[] = "obs_raw_plot";
static const char conf_key_color_table[] = "color_table";
static const char conf_key_plot_min[] = "plot_min";
static const char conf_key_plot_max[] = "plot_max";
static const char conf_key_colorbar_flag[] = "colorbar_flag";
static const char conf_key_colorbar_spacing[] = "colorbar_spacing";
static const char conf_key_map_data_source[] = "map_data.source";
static const char conf_key_file_name[] = "file_name";
Expand Down Expand Up @@ -966,6 +969,20 @@ static const char conf_key_write_pixel_age[] = "write_pixel_age";
static const char conf_key_output_stats[] = "output_stats";
static const char conf_key_block_size[] = "block_size";

//
// Plot-Point-Obs specific parameter values names
//

static const char conf_key_grid_data[] = "grid_data";
static const char conf_key_point_data[] = "point_data";
static const char conf_key_elv_thresh[] = "elv_thresh";
static const char conf_key_hgt_thresh[] = "hgt_thresh";
static const char conf_key_prs_thresh[] = "prs_thresh";
static const char conf_key_dotsize[] = "dotsize";
static const char conf_key_fill_color[] = "fill_color";
static const char conf_key_fill_plot_info[] = "fill_plot_info";
static const char conf_key_grid_plot_info[] = "grid_plot_info";

//
// MET-TC specific parameter key names
//
Expand Down
10 changes: 10 additions & 0 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2001,9 +2001,11 @@ WaveletType parse_conf_wavelet_type(Dictionary *dict) {
///////////////////////////////////////////////////////////////////////////////

void PlotInfo::clear() {
flag = true; // enabled by default
color_table.clear();
plot_min = bad_data_double;
plot_max = bad_data_double;
colorbar_flag = true; // plot colorbar by default
colorbar_spacing = bad_data_int;
}

Expand All @@ -2018,6 +2020,10 @@ PlotInfo parse_conf_plot_info(Dictionary *dict) {
exit(1);
}

// Get the flag, true if not present
info.flag = dict->lookup_bool(conf_key_flag, false);
if(!dict->last_lookup_status()) info.flag = true;

// Get the color table
info.color_table = dict->lookup_string(conf_key_color_table);

Expand All @@ -2029,6 +2035,10 @@ PlotInfo parse_conf_plot_info(Dictionary *dict) {
info.plot_max = dict->lookup_double(conf_key_plot_max, false);
if(is_bad_data(info.plot_max)) info.plot_max = 0.0;

// Get the colorbar flag, true if not present
info.colorbar_flag = dict->lookup_bool(conf_key_colorbar_flag, false);
if(!dict->last_lookup_status()) info.colorbar_flag = true;

// Get the colorbar spacing, 1 if not present
info.colorbar_spacing = dict->lookup_int(conf_key_colorbar_spacing, false);
if(is_bad_data(info.colorbar_spacing)) info.colorbar_spacing = 1;
Expand Down

0 comments on commit c24890a

Please sign in to comment.