Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 1439 mask_names #1679

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,22 @@ void parse_conf_range_double(Dictionary *dict, double &beg, double &end) {

///////////////////////////////////////////////////////////////////////////////

void check_mask_names(const StringArray &sa) {
StringArray sa_uniq = sa.uniq();

// Check for unique mask names
if(sa_uniq.n() < sa.n()) {
mlog << Error << "\ncheck_mask_names() -> "
<< "found non-unique strings in the list of masking region names ("
<< write_css(sa) << ")!\n\n";
exit(1);
}

return;
}

///////////////////////////////////////////////////////////////////////////////

void check_climo_n_vx(Dictionary *dict, const int n_vx) {
int n;

Expand Down
2 changes: 2 additions & 0 deletions met/src/basic/vx_config/config_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ extern map<ConcatString,ThreshArray>
extern void parse_conf_range_int(Dictionary *dict, int &beg, int &end);
extern void parse_conf_range_double(Dictionary *dict, double &beg, double &end);

extern void check_mask_names(const StringArray &);

extern void check_climo_n_vx(Dictionary *dict, const int);

extern InterpMthd int_to_interpmthd(int);
Expand Down
2 changes: 1 addition & 1 deletion met/src/basic/vx_log/string_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ return;
////////////////////////////////////////////////////////////////////////


StringArray StringArray::uniq()
StringArray StringArray::uniq() const

{

Expand Down
2 changes: 1 addition & 1 deletion met/src/basic/vx_log/string_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class StringArray {
// return a unique subset of strings
//

StringArray uniq();
StringArray uniq() const;

};

Expand Down
3 changes: 3 additions & 0 deletions met/src/tools/core/grid_stat/grid_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ void GridStatConfInfo::process_masks(const Grid &grid) {
exit(1);
}

// Check for unique mask names
check_mask_names(vx_opt[i].mask_name);

} // end for i

return;
Expand Down
3 changes: 3 additions & 0 deletions met/src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ void PointStatConfInfo::process_masks(const Grid &grid) {

} // end for j

// Check for unique mask names
check_mask_names(vx_opt[i].mask_name);

} // end for i

return;
Expand Down