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 1974 message_type_group_map #1999

Merged
merged 3 commits into from
Jan 12, 2022
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
2 changes: 1 addition & 1 deletion met/docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Interpolation/matching methods

This section provides information about the various methods available in MET to match gridded model output to point observations. Matching in the vertical and horizontal are completed separately using different methods.

In the vertical, if forecasts and observations are at the same vertical level, then they are paired as-is. If any discrepancy exists between the vertical levels, then the forecasts are interpolated to the level of the observation. The vertical interpolation is done in the natural log of pressure coordinates, except for specific humidity, which is interpolated using the natural log of specific humidity in the natural log of pressure coordinates. Vertical interpolation for heights above ground are done linear in height coordinates. When forecasts are for the surface, no interpolation is done. They are matched to observations with message types that are mapped to **SURFACE** in the **message_type_group_map** configuration option. By default, the surface message types include ADPSFC, SFCSHP, and MSONET.
In the vertical, if forecasts and observations are at the same vertical level, then they are paired as-is. If any discrepancy exists between the vertical levels, then the forecasts are interpolated to the level of the observation. The vertical interpolation is done in the natural log of pressure coordinates, except for specific humidity, which is interpolated using the natural log of specific humidity in the natural log of pressure coordinates. Vertical interpolation for heights above ground are done linear in height coordinates. When forecasts are for the surface, no interpolation is done. They are matched to observations with message types that are mapped to **SURFACE** in the **message_type_group_map** configuration option. By default, the surface message types include ADPSFC, SFCSHP, and MSONET. The regular expression is applied to the message type list at the message_type_group_map. The derived message types from the time summary ("ADPSFC_MIN_hhmmss" and "ADPSFC_MAX_hhmmss") are accepted as "ADPSFC".

To match forecasts and observations in the horizontal plane, the user can select from a number of methods described below. Many of these methods require the user to define the width of the forecast grid W, around each observation point P, that should be considered. In addition, the user can select the interpolation shape, either a SQUARE or a CIRCLE. For example, a square of width 2 defines the 2 x 2 set of grid points enclosing P, or simply the 4 grid points closest to P. A square of width of 3 defines a 3 x 3 square consisting of 9 grid points centered on the grid point closest to P. :numref:`point_stat_fig1` provides illustration. The point P denotes the observation location where the interpolated value is calculated. The interpolation width W, shown is five.

Expand Down
4 changes: 2 additions & 2 deletions met/src/libcode/vx_statistics/pair_data_ensemble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ void VxPairDataEnsemble::add_point_obs(float *hdr_arr, int *hdr_typ_arr,
// falls within the requested range.
else {

if(!msg_typ_sfc.has(hdr_typ_str) &&
if(!msg_typ_sfc.reg_exp_match(hdr_typ_str) &&
(obs_hgt < obs_info_grib->level().lower() ||
obs_hgt > obs_info_grib->level().upper())) {
return;
Expand Down Expand Up @@ -1481,7 +1481,7 @@ void VxPairDataEnsemble::add_point_obs(float *hdr_arr, int *hdr_typ_arr,
// set the observation level value to bad data so that it's not used in the
// duplicate logic.
if(obs_info->level().type() == LevelType_Vert &&
msg_typ_sfc.has(hdr_typ_str)) {
msg_typ_sfc.reg_exp_match(hdr_typ_str)) {
obs_lvl = bad_data_double;
}

Expand Down
8 changes: 4 additions & 4 deletions met/src/libcode/vx_statistics/pair_data_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,
}

// Check for a large topography difference
if(sfc_info.topo_ptr && msg_typ_sfc.has(hdr_typ_str)) {
if(sfc_info.topo_ptr && msg_typ_sfc.reg_exp_match(hdr_typ_str)) {

// Interpolate model topography to observation location
double topo = compute_horz_interp(
Expand Down Expand Up @@ -1051,7 +1051,7 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,
// falls within the requested range.
else {

if(!msg_typ_sfc.has(hdr_typ_str) &&
if(!msg_typ_sfc.reg_exp_match(hdr_typ_str) &&
(obs_hgt < obs_info->level().lower() ||
obs_hgt > obs_info->level().upper())) {
rej_lvl++;
Expand Down Expand Up @@ -1105,7 +1105,7 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,
// type, set the observation level value to bad data so that it's not
// used in the duplicate logic.
if(obs_info->level().type() == LevelType_Vert &&
msg_typ_sfc.has(hdr_typ_str)) {
msg_typ_sfc.reg_exp_match(hdr_typ_str)) {
obs_lvl = bad_data_double;
}

Expand Down Expand Up @@ -1208,7 +1208,7 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,

// For surface verification, apply land/sea and topo masks
if((sfc_info.land_ptr || sfc_info.topo_ptr) &&
(msg_typ_sfc.has(hdr_typ_str))) {
(msg_typ_sfc.reg_exp_match(hdr_typ_str))) {

bool is_land = msg_typ_lnd.has(hdr_typ_str);

Expand Down