Skip to content

Commit

Permalink
Feature #2362 message_type_group_map (#2365)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway authored Dec 2, 2022
1 parent 9ca4a51 commit 05d4a8f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 55 deletions.
50 changes: 25 additions & 25 deletions docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1797,20 +1797,20 @@ This dictionary may include the following entries:
land_mask
^^^^^^^^^

The "land_mask" dictionary defines the land/sea mask field which is used
when verifying at the surface. For point observations whose message type
appears in the "LANDSF" entry of the "message_type_group_map" setting,
only use forecast grid points where land = TRUE. For point observations
whose message type appears in the "WATERSF" entry of the
"message_type_group_map" setting, only use forecast grid points where
land = FALSE. The "flag" entry enables/disables this logic. If the
"file_name" entry is left empty, then the land/sea is assumed to exist in
the input forecast file. Otherwise, the specified file(s) are searched for
the data specified in the "field" entry. The "regrid" settings specify how
this field should be regridded to the verification domain. Lastly, the
"thresh" entry is the threshold which defines land (threshold is true) and
water (threshold is false).
land_mask.flag may be set separately in each "obs.field" entry.
The "land_mask" dictionary defines the land/sea mask field used when
verifying at the surface. The "flag" entry enables/disables this logic.
When enabled, the "message_type_group_map" dictionary must contain entries
for "LANDSF" and "WATERSF". For point observations whose message type
appears in the "LANDSF" entry, only use forecast grid points where land =
TRUE. For point observations whose message type appears in the "WATERSF"
entry, only use forecast grid points where land = FALSE. If the "file_name"
entry is left empty, the land/sea is assumed to exist in the input forecast
file. Otherwise, the specified file(s) are searched for the data specified
in the "field" entry. The "regrid" settings specify how this field should be
regridded to the verification domain. Lastly, the "thresh" entry is the
threshold which defines land (threshold is true) and water (threshold is false).

The "land_mask.flag" entry may be set separately in each "obs.field" entry.

.. code-block:: none
Expand All @@ -1825,21 +1825,21 @@ land_mask.flag may be set separately in each "obs.field" entry.
topo_mask
^^^^^^^^^

The "topo_mask" dictionary defines the model topography field which is used
when verifying at the surface. This logic is applied to point observations
whose message type appears in the "SURFACE" entry of the
"message_type_group_map" setting. Only use point observations where the
topo - station elevation difference meets the "use_obs_thresh" threshold
The "topo_mask" dictionary defines the model topography field used when
verifying at the surface. The flag entry enables/disables this logic.
When enabled, the "message_type_group_map" dictionary must contain an entry
for "SURFACE". This logic is applied to point observations whose message type
appears in the "SURFACE" entry. Only use point observations where the
topo minus station elevation difference meets the "use_obs_thresh" threshold
entry. For the observations kept, when interpolating forecast data to the
observation location, only use forecast grid points where the topo - station
difference meets the "interp_fcst_thresh" threshold entry. The flag entry
enables/disables this logic. If the "file_name" is left empty, then the
topography data is assumed to exist in the input forecast file. Otherwise,
the specified file(s) are searched for the data specified in the "field"
observation location, only use forecast grid points where the topo minus station
difference meets the "interp_fcst_thresh" threshold entry. If the "file_name"
is left empty, the topography data is assumed to exist in the input forecast file.
Otherwise, the specified file(s) are searched for the data specified in the "field"
entry. The "regrid" settings specify how this field should be regridded to
the verification domain.

topo_mask.flag may be set separately in each "obs.field" entry.
The "topo_mask.flag" entry may be set separately in each "obs.field" entry.

.. code-block:: none
Expand Down
55 changes: 25 additions & 30 deletions src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ void PointStatConfInfo::process_config(GrdFileType ftype) {
// Conf: message_type_group_map
msg_typ_group_map = parse_conf_message_type_group_map(&conf);

// Conf: message_type_group_map(SURFACE)
if(msg_typ_group_map.count((string)surface_msg_typ_group_str) == 0) {
mlog << Error << "\nPointStatConfInfo::process_config() -> "
<< "\"" << conf_key_message_type_group_map
<< "\" must contain an entry for \""
<< surface_msg_typ_group_str << "\".\n\n";
exit(1);
}

// Conf: fcst.field and obs.field
fdict = conf.lookup_array(conf_key_fcst_field);
odict = conf.lookup_array(conf_key_obs_field);
Expand Down Expand Up @@ -422,6 +413,18 @@ void PointStatConfInfo::process_geog(const Grid &grid,
geog_dp = parse_geog_data(dict, grid, fcst_file);
geog_dp.threshold(dict->lookup_thresh(conf_key_thresh));
land_mask = geog_dp.mask_plane();

// Conf: message_type_group_map for LANDSF and WATERSF
if(msg_typ_group_map.count((string)landsf_msg_typ_group_str) == 0 ||
msg_typ_group_map.count((string)watersf_msg_typ_group_str) == 0 ) {
mlog << Error << "\nPointStatConfInfo::process_geog() -> "
<< "when \"" << conf_key_land_mask_flag << "\" is true, \""
<< conf_key_message_type_group_map
<< "\" must contain entries for \""
<< landsf_msg_typ_group_str << "\" and \""
<< watersf_msg_typ_group_str << "\".\n\n";
exit(1);
}
}

// Conf: topo
Expand All @@ -430,6 +433,16 @@ void PointStatConfInfo::process_geog(const Grid &grid,
topo_dp = parse_geog_data(dict, grid, fcst_file);
topo_use_obs_thresh = dict->lookup_thresh(conf_key_use_obs_thresh);
topo_interp_fcst_thresh = dict->lookup_thresh(conf_key_interp_fcst_thresh);

// Conf: message_type_group_map for SURFACE
if(msg_typ_group_map.count((string)surface_msg_typ_group_str) == 0) {
mlog << Error << "\nPointStatConfInfo::process_geog() -> "
<< "when \"" << conf_key_topo_mask_flag << "\" is true, \""
<< conf_key_message_type_group_map
<< "\" must contain an entry for \""
<< surface_msg_typ_group_str << "\".\n\n";
exit(1);
}
}

// Loop over the verification tasks and set the geography info
Expand Down Expand Up @@ -1002,37 +1015,19 @@ void PointStatVxOpt::set_vx_pd(PointStatConfInfo *conf_info) {

// Store the surface message type group
cs = surface_msg_typ_group_str;
if(conf_info->msg_typ_group_map.count(cs) == 0) {
mlog << Error << "\nPointStatVxOpt::set_vx_pd() -> "
<< "\"" << conf_key_message_type_group_map
<< "\" must contain an entry for \"" << cs << "\".\n\n";
exit(1);
}
else {
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_sfc(conf_info->msg_typ_group_map[cs]);
}

// Store the surface land message type group
cs = landsf_msg_typ_group_str;
if(conf_info->msg_typ_group_map.count(cs) == 0) {
mlog << Error << "\nPointStatVxOpt::set_vx_pd() -> "
<< "\"" << conf_key_message_type_group_map
<< "\" must contain an entry for \"" << cs << "\".\n\n";
exit(1);
}
else {
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_lnd(conf_info->msg_typ_group_map[cs]);
}

// Store the surface water message type group
cs = watersf_msg_typ_group_str;
if(conf_info->msg_typ_group_map.count(cs) == 0) {
mlog << Error << "\nPointStatVxOpt::set_vx_pd() -> "
<< "\"" << conf_key_message_type_group_map
<< "\" must contain an entry for \"" << cs << "\".\n\n";
exit(1);
}
else {
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_wtr(conf_info->msg_typ_group_map[cs]);
}

Expand Down

0 comments on commit 05d4a8f

Please sign in to comment.