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 #3000 point2grid_warning #3001

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
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
Next Next commit
Per #3000, change 9 warning messages to Debug(2) log messages to mini…
…mize the number of warning messages Point2Grid writes. However, do retain the warnings about problems writing the grid mapping output file.
  • Loading branch information
JohnHalleyGotway committed Oct 21, 2024
commit 0582846f4511578939e84b2c8bbb7511ad2a1cbf
37 changes: 19 additions & 18 deletions src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
// 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main
// 003 10-03-23 Prestopnik MET #2227 Remove namespace std and netCDF from header files
// 004 05-20-24 Howard Soh MET #2867 Fix -qc ADP bug.
// 004 06-24-24 Halley Gotway MET #2880 Filter obs_quality.
// 005 06-24-24 Halley Gotway MET #2880 Filter obs_quality.
// 006 10-21-24 Halley Gotway MET #3000 Reduce warnings.
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -864,8 +865,8 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI
}
}
if (empty_input) {
mlog << Warning << "\n" << method_name
<< error_msg << "\tBut ignored because of empty input\n\n";
mlog << Debug(2) << method_name
<< error_msg << "\tBut ignored because of empty input\n";
}
else {
mlog << Error << "\n" << method_name
Expand Down Expand Up @@ -1159,14 +1160,14 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI
log_msg << ".";
if (0 == var_count) {
if (0 == filtered_count) {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "No valid data for the variable ["
<< vinfo->name() << "]\n\n";
<< vinfo->name() << "]\n";
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "No valid data after filtering.\n\t"
<< log_msg << "\n\n";
<< log_msg << "\n";
}
}
else {
Expand Down Expand Up @@ -1644,8 +1645,8 @@ static void regrid_nc_variable(NcFile *nc_in, Met2dDataFile *fr_mtddf,
<< "]\n";

if (to_cell_cnt == 0) {
mlog << Warning << "\n" << method_name
<< " There are no matching cells between input and the target grid.\n\n";
mlog << Debug(2) << method_name
<< " There are no matching cells between input and the target grid.\n";
}

mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took "
Expand Down Expand Up @@ -2025,8 +2026,8 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping,

int obs_count = obs_index_array.n();
if (0 == obs_count) {
mlog << Warning << "\n" << method_name
<< "no valid point observation data!\n\n";
mlog << Debug(2) << method_name
<< "no valid point observation data!\n";
return status;
}

Expand Down Expand Up @@ -2054,8 +2055,8 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping,
}

if (0 == count_in_grid)
mlog << Warning << "\n" << method_name
<< "no valid point observation data within to grid\n\n";
mlog << Debug(2) << method_name
<< "no valid point observation data within to grid\n";
else {
status = true;
mlog << Debug(3) << method_name << "count in grid: " << count_in_grid
Expand Down Expand Up @@ -2622,10 +2623,10 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
}
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "QC var name (" << qc_var_name
<< " for " << GET_NC_NAME(var_adp)
<< ") does not exist.\n\n";
<< ") does not exist.\n";
}
}
}
Expand All @@ -2641,7 +2642,7 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
mlog << Debug(3) << method_name << "found QC var: " << qc_var_name << ".\n";
}
else {
mlog << Warning << "\n" << method_name
mlog << Debug(2) << method_name
<< "QC var name (" << qc_var_name
<< ") does not exist.\n";
}
Expand Down Expand Up @@ -2839,8 +2840,8 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
}

if (to_cell_count == 0) {
mlog << Warning << "\n" << method_name
<< "No valid data!\n\n";
mlog << Debug(2) << method_name
<< "No valid data!\n";
}

mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took "
Expand Down