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 1184 dryline #2088

Merged
merged 79 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
5eafc0e
Start on MODE-Multivar tool.
Aug 19, 2019
150c025
Added additional linking in Makefile.am.
Aug 19, 2019
ccdf4cd
Some name changes.
Aug 19, 2019
0384645
Added MODEMultivarConfig_default.
Aug 19, 2019
31c9058
Added MODEMultivarConfig_default.
Aug 19, 2019
1058300
Changed linking order to build on dakota.
Aug 20, 2019
e436a3d
Merge branch 'feature_1184_dryline' of https://github.com/NCAR/MET in…
Aug 20, 2019
f0423aa
Initial boolean calculator code
rgbullock Aug 28, 2019
1962a44
First pass at boolean calculator code
rgbullock Aug 29, 2019
edd6ed9
Created new libcode vx_bool_calc subdir.
Aug 29, 2019
64ae080
Moved mode_multivar subdir to tools/other.
Aug 29, 2019
da52240
Merge branch 'develop' into feature_1184_dryline
Sep 18, 2019
79b924c
Updated config files.
Sep 18, 2019
bdc9179
Added vx_boolcalc to Makefile.am.
Nov 5, 2019
fa0078c
Create libmode to link to mode_multivar.
Nov 5, 2019
ec015c6
Saving Makefile.am.
Nov 5, 2019
fa3c2af
Added string_array set functions to concat_string
rgbullock Dec 3, 2019
2711a05
Changed Makefile.am for mode. I don't think I changed any of these o…
rgbullock Jan 13, 2020
e255dd3
Cleanup of mode_conf_info interface prior to generalization
rgbullock Jan 13, 2020
603b627
Added multi-field functionality to mode and the mode config code
rgbullock Jan 15, 2020
06f1443
Work on dryline project
rgbullock Feb 24, 2020
8c5c689
Added code to read objects from MODE output netcdf files.
rgbullock Feb 25, 2020
9b1324d
Started the mode_multivar executable
rgbullock Feb 25, 2020
401894f
Got minimalist version of dryline project executable running
rgbullock Feb 25, 2020
4fa5a04
calculating super-object attributes on mode multivar
rgbullock Feb 27, 2020
af418f6
writing out super-object attributes in mode multivar
rgbullock Feb 27, 2020
b798996
writing super-object attributes for mode multivar
rgbullock Feb 27, 2020
556d335
added netcdf output for superobjects
rgbullock Feb 28, 2020
1bfd2ce
Updated Makefile.am.
Mar 27, 2020
0bf6aff
Use development case for default.
Mar 27, 2020
8e4463b
Added bool_combo.
Mar 27, 2020
8709342
Switch to fcst and obs arrays.
Mar 27, 2020
83942a2
Added new default config.
Mar 28, 2020
4f8751a
Added multivar_field_logic.
Apr 23, 2020
332398f
Added default multivar_field_logic.
Apr 24, 2020
044db27
Redefine path to mode as being relative to MET_BASE. Also add 3 .git…
JohnHalleyGotway May 1, 2020
248471c
Delete executables which should not have been committed to the repo i…
JohnHalleyGotway May 1, 2020
6bd773c
The output of enum_to_string does not actually live in the repositoy.…
JohnHalleyGotway May 1, 2020
04bd1c5
Per #1184, latest version of development from Randy on 20200923.
JohnHalleyGotway Sep 23, 2020
ef3f232
Per #1184, latest version of development from Randy on 20200923.
JohnHalleyGotway Sep 23, 2020
c73a147
Per #1184, merging develop into feature_1184 branch.
JohnHalleyGotway Sep 23, 2020
3573a83
Per #1184, some additional manual merging was required to get it comp…
JohnHalleyGotway Sep 24, 2020
ef9dcee
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway Oct 10, 2020
241956e
For #1184, running multivar mode with the code produced a runtime err…
JohnHalleyGotway Oct 10, 2020
6b30049
Per #1184, merges latest changes from the develop branch into this br…
JohnHalleyGotway Nov 10, 2020
e573591
Added unit test for mode multivar
rgbullock Nov 18, 2020
da40315
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway Nov 20, 2020
0b42a6c
Per #1184, adding a slightly updated version of Randy's mode multivar…
JohnHalleyGotway Nov 20, 2020
682931c
Per #1184, remove commented out code and replace get_filename_list() …
JohnHalleyGotway Nov 20, 2020
725859e
Per #1184, just fixing a typo.
JohnHalleyGotway Nov 20, 2020
f611316
Per #1184, remove unneccessary output prefix.
JohnHalleyGotway Nov 20, 2020
349372d
Removed the creation of some debugging output
rgbullock Nov 24, 2020
eedfa9e
Implemented changes recommended by John in email of NOv 20, 2020
rgbullock Nov 30, 2020
4ce18f8
Per #1184, resetting version number from 9.0 to 10.0 and deleting tem…
JohnHalleyGotway Nov 30, 2020
fc065a5
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway Dec 3, 2020
e790248
Per #1184, just updating the comment at the top of each of the MET co…
JohnHalleyGotway Dec 3, 2020
733cc46
Changes requested by John.
rgbullock Dec 7, 2020
b3ec00b
pull
rgbullock Dec 7, 2020
bcba2c4
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway Dec 7, 2020
fac3fb9
Merge remote-tracking branch 'origin/develop' into feature_1184_dryline
Dec 7, 2020
27b5bff
Merge branch 'feature_1184_dryline' of https://github.com/NCAR/MET in…
Dec 7, 2020
d92647e
Per #1184, update the MODE multivar unit test to using the -outdir co…
JohnHalleyGotway Dec 7, 2020
3b5be0d
Merge branch 'feature_1184_dryline' of https://github.com/dtcenter/ME…
JohnHalleyGotway Dec 7, 2020
742901f
Per #1184, update debug log levels. Level 1 for I/O files and level 2…
JohnHalleyGotway Dec 7, 2020
fc92d7e
Per #1184, add a log message listing the output file names.
JohnHalleyGotway Dec 7, 2020
981eed1
Per #1184, write f_super.nc and o_super.nc to the -outdir location.
JohnHalleyGotway Dec 7, 2020
338ab99
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway May 10, 2021
a00c6ec
Merge branch 'develop' into feature_1184_dryline
JohnHalleyGotway Mar 7, 2022
9b1bf77
Per #1184, after merging the latest from develop into this feature br…
JohnHalleyGotway Mar 7, 2022
8921733
Per #1184, add unit_mode_multivar.xml to the automated testing.yml file.
JohnHalleyGotway Mar 7, 2022
6a330ca
Per #1184, replace references to cerr with mlog << Error in the vx_bo…
JohnHalleyGotway Mar 7, 2022
c3b9e8a
Per #1184, move singlevar_usage() into mode_usage.cc to avoid segfaul…
JohnHalleyGotway Mar 8, 2022
e774da4
Per #1184, update multivar mode to check for no input forecast files.
JohnHalleyGotway Mar 9, 2022
706929c
Per #1184, mostly just formatting changes here with a goal toward con…
JohnHalleyGotway Mar 9, 2022
cae3aae
Per #1184, correct the MODE config files to replace multivar_field_lo…
JohnHalleyGotway Mar 9, 2022
16f2c94
Per #1184, add some basic documentation about multi-variate MODE.
JohnHalleyGotway Mar 10, 2022
e9b5622
Per #1184, remove internal_tests/libcode/vx_bool_calc that wasn't inc…
JohnHalleyGotway Mar 10, 2022
99de616
Per #1184, doc updates.
JohnHalleyGotway Mar 10, 2022
93f39b9
Per #1184, documentation tweaks from Tara.
JohnHalleyGotway Mar 10, 2022
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 .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
matrix:
tests:
- 'ascii2nc_indy pb2nc_indy tc_dland tc_pairs tc_stat plot_tc tc_rmw rmw_analysis tc_gen'
- 'met_test_scripts mode_graphics mtd regrid airnow gsi_tools netcdf modis series_analysis gen_ens_prod wwmca_regrid gen_vx_mask grid_weight interp_shape grid_diag grib_tables lidar2nc shift_data_plane trmm2nc aeronet wwmca_plot ioda2nc gaussian'
- 'met_test_scripts mode_multivar mode_graphics mtd regrid airnow gsi_tools netcdf modis series_analysis gen_ens_prod wwmca_regrid gen_vx_mask grid_weight interp_shape grid_diag grib_tables lidar2nc shift_data_plane trmm2nc aeronet wwmca_plot ioda2nc gaussian'
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions met/Make-include
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MET_CPPFLAGS = -I${top_builddir}/src/basic/vx_cal \
-I${top_builddir}/src/libcode/vx_solar \
-I${top_builddir}/src/libcode/vx_statistics \
-I${top_builddir}/src/libcode/vx_stat_out \
-I${top_builddir}/src/libcode/vx_bool_calc \
-I${top_builddir}/src/libcode/vx_summary \
-I${top_builddir}/src/libcode/vx_time_series \
-I${top_builddir}/src/libcode/vx_series_data \
Expand Down Expand Up @@ -73,6 +74,7 @@ MET_LDFLAGS = -L${top_builddir}/src/basic/vx_cal \
-L${top_builddir}/src/libcode/vx_pxm \
-L${top_builddir}/src/libcode/vx_render \
-L${top_builddir}/src/libcode/vx_regrid \
-L${top_builddir}/src/libcode/vx_bool_calc \
-L${top_builddir}/src/libcode/vx_shapedata \
-L${top_builddir}/src/libcode/vx_solar \
-L${top_builddir}/src/libcode/vx_statistics \
Expand Down
1 change: 1 addition & 0 deletions met/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ AC_CONFIG_FILES([Makefile
src/libcode/vx_summary/Makefile
src/libcode/vx_python3_utils/Makefile
src/libcode/vx_data2d_python/Makefile
src/libcode/vx_bool_calc/Makefile
src/libcode/vx_pointdata_python/Makefile
src/tools/Makefile
src/tools/core/Makefile
Expand Down
1 change: 0 additions & 1 deletion met/data/config/MODEConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ obtype = "ANALYS";

//
// Verification grid
// May be set separately in each "field" entry
//
regrid = {
to_grid = NONE;
Expand Down
259 changes: 259 additions & 0 deletions met/data/config/MODEMultivarConfig_default
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
////////////////////////////////////////////////////////////////////////////////
//
// MODE configuration file.
//
// For additional information, please see the MET User's Guide.
//
////////////////////////////////////////////////////////////////////////////////

//
// Output model name to be written
//
model = "WRF";

//
// Output description to be written
//
desc = "NA";

//
// Output observation type to be written
//
obtype = "ANALYS";

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

//
// Verification grid
//
regrid = {
to_grid = NONE;
method = NEAREST;
width = 1;
vld_thresh = 0.5;
shape = SQUARE;
}

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

//
// Approximate grid resolution (km)
//
grid_res = 20;

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

//
// Run all permutations of radius and threshold
//
quilt = FALSE;

//
// MODE Multivar boolean combination logic
//
multivar_logic = "#1 && #2 && #3";

//
// Forecast and observation fields to be verified
//
fcst = {

field = [

{
name = "ALPHA";
level = "(*,*)";
},

{
name = "BETA";
level = "(*,*)";
},

{
name = "GAMMA";
level = "(*,*)";
}

];

conv_radius = 2; // in grid squares
conv_thresh = >=5.0;
vld_thresh = 0.5;
filter_attr_name = [];
filter_attr_thresh = [];
merge_thresh = >=3.5;
merge_flag = NONE;
}
obs = fcst;

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

//
// Handle missing data
//
mask_missing_flag = NONE;

//
// Match objects between the forecast and observation fields
//
match_flag = NONE;

//
// Maximum centroid distance for objects to be compared
//
max_centroid_dist = 800.0/grid_res;

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

//
// Verification masking regions
//
mask = {
grid = "";
grid_flag = NONE; // Apply to NONE, FCST, OBS, or BOTH
poly = "";
poly_flag = NONE; // Apply to NONE, FCST, OBS, or BOTH
}

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

//
// Fuzzy engine weights
//
weight = {
centroid_dist = 2.0;
boundary_dist = 4.0;
convex_hull_dist = 0.0;
angle_diff = 1.0;
aspect_diff = 0.0;
area_ratio = 1.0;
int_area_ratio = 2.0;
curvature_ratio = 0.0;
complexity_ratio = 0.0;
inten_perc_ratio = 0.0;
inten_perc_value = 50;
}

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

//
// Fuzzy engine interest functions
//
interest_function = {

centroid_dist = (
( 0.0, 1.0 )
( 60.0/grid_res, 1.0 )
( 600.0/grid_res, 0.0 )
);

boundary_dist = (
( 0.0, 1.0 )
( 400.0/grid_res, 0.0 )
);

convex_hull_dist = (
( 0.0, 1.0 )
( 400.0/grid_res, 0.0 )
);

angle_diff = (
( 0.0, 1.0 )
( 30.0, 1.0 )
( 90.0, 0.0 )
);

aspect_diff = (
( 0.00, 1.0 )
( 0.10, 1.0 )
( 0.75, 0.0 )
);

corner = 0.8;
ratio_if = (
( 0.0, 0.0 )
( corner, 1.0 )
( 1.0, 1.0 )
);

area_ratio = ratio_if;

int_area_ratio = (
( 0.00, 0.00 )
( 0.10, 0.50 )
( 0.25, 1.00 )
( 1.00, 1.00 )
);

curvature_ratio = ratio_if;

complexity_ratio = ratio_if;

inten_perc_ratio = ratio_if;
}

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

//
// Total interest threshold for determining matches
//
total_interest_thresh = 0.7;

//
// Interest threshold for printing output pair information
//
print_interest_thresh = 0.0;

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

//
// Plotting information
//
met_data_dir = "MET_BASE";

fcst_raw_plot = {
color_table = "MET_BASE/colortables/met_default.ctable";
plot_min = 0.0;
plot_max = 0.0;
}

obs_raw_plot = {
color_table = "MET_BASE/colortables/met_default.ctable";
plot_min = 0.0;
plot_max = 0.0;
}

object_plot = {
color_table = "MET_BASE/colortables/mode_obj.ctable";
}

//
// Boolean for plotting on the region of valid data within the domain
//
plot_valid_flag = FALSE;

//
// Plot polyline edges using great circle arcs instead of straight lines
//
plot_gcarc_flag = FALSE;

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

//
// NetCDF matched pairs, PostScript, and contingency table output files
//
ps_plot_flag = TRUE;
nc_pairs_flag = TRUE;
ct_stats_flag = TRUE;

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

shift_right = 0; // grid squares

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

output_prefix = "";
version = "V10.1.0";

////////////////////////////////////////////////////////////////////////////////
1 change: 1 addition & 0 deletions met/data/config/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ config_DATA = \
Madis2NcConfig_default \
MODEAnalysisConfig_default \
MODEConfig_default \
MODEMultivarConfig_default \
MTDConfig_default \
PB2NCConfig_default \
PointStatConfig_default \
Expand Down
26 changes: 24 additions & 2 deletions met/docs/Users_Guide/mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,21 @@ Summary statistics

Once MODE has been run, summary statistics are written to an output file. These files contain information about all single and cluster objects and their attributes. Total interest for object pairs is also output, as are percentiles of intensity inside the objects. The output file is in a simple flat ASCII tabular format (with one header line) and thus should be easily readable by just about any programming language, scripting language, or statistics package. Refer to :numref:`MODE-output` for lists of the statistics included in the MODE output files. Example scripts will be posted on the MET website in the future.

.. _MODE-multivar:

Multi-Variate MODE
------------------

Traditionally, MODE defines objects by smoothing and thresholding data from a single input field. MET version 10.1.0 extends MODE by adding the option to define objects using multiple input fields.

As described in :numref:`MODE-configuration-file`, the **field** entry in the forecast and observation dictionaries define the input data to be processed. If **field** is defined as a dictionary, the traditional method for running MODE is invoked, where objects are defined using a single input field. If **field** is defined as an array of dictionaries, each specifying a different input field, then the multi-variate MODE logic is invoked and requires the **multivar_logic** configuration entry to be set. Traditional MODE is run once for each input field to define objects for that field. Note that the object definition criteria can be defined separately for each field array entry. The objects from each input field are combined into a *super* object for both the forecast and observation data.

The **multivar_logic** configuration entry, described in :numref:`MODE-configuration-file`, defines the boolean logic for combining objects from multiple fields into a *super* object. If this configuration option is set, there must be an equal or greater number of fields defined in an array of dictionaries for it define a *super* object of more than one field. Note that the multi-variate MODE forecast and observation input fields and combination logic do not need to match. The resulting forecast and observation *super* objects are written to NetCDF output files. Users can then configure and run traditional MODE to compare the forecast super object to the observed super object.

Practical information
=====================

This section contains a description of how MODE can be configured and run. The MODE tool is used to perform a features-based verification of gridded model data using gridded observations. The input gridded model and observation datasets must be in one of the MET supported gridded file formats. The requirement of having all gridded fields using the same grid specification has been removed with METv5.1. The Grid-Stat tool performs no interpolation when the input model, observation, and climatology datasets must be on a common grid. MET will interpolate these files to a common grid if one is specified. There is a regrid option in the configuration file that allows the user to define the grid upon which the scores will be computed. The gridded analysis data may be based on observations, such as Stage II or Stage IV data for verifying accumulated precipitation, or a model analysis field may be used. However, users are cautioned that it is generally unwise to verify model output using an analysis field produced by the same model.
This section contains a description of how MODE can be configured and run. The MODE tool is used to perform a features-based verification of gridded model data using gridded observations. The input gridded model and observation datasets must be in one of the MET supported gridded file formats. If the input datasets are not already on a common grid, MODE can interpolate them to a common grid. The regrid option in the configuration file enables the user to specify the grid upon which the scores will be computed. The gridded analysis data may be based on observations, such as Stage II or Stage IV data for verifying accumulated precipitation, or a model analysis field may be used. However, users are cautioned that it is generally unwise to verify model output using an analysis field produced by the same model.

MODE provides the capability to select a single model variable/level from which to derive objects to be analyzed. MODE was developed and tested using accumulated precipitation. However, the code has been generalized to allow the use of any gridded model and observation field. Based on the options specified in the configuration file, MODE will define a set of simple objects in the model and observation fields. It will then compute an interest value for each pair of objects across the fields using a fuzzy engine approach. Those interest values are thresholded, and any pairs of objects above the threshold will be matched/merged. Through the configuration file, MODE offers a wide range of flexibility in how the objects are defined, processed, matched, and merged.

Expand Down Expand Up @@ -198,7 +209,6 @@ _____________________

The configuration options listed above are common to many MET tools and are described in :numref:`config_options`.


_____________________

.. code-block:: none
Expand All @@ -221,6 +231,16 @@ The **quilt** entry indicates whether all permutations of convolution radii and

_____________________

.. code-block:: none

multivar_logic = "#1 && #2 && #3";

The **multivar_logic** entry appears only in the **MODEMultivarConfig_default** file. This option applies to running multi-variate MODE by setting **field** to an array of dictionaries to define multiple input fields. Objects are defined separately for each input field based on the configuration settings specified for each field array entry. The **multivar_logic** entry is a string which defines how objects for each field are combined into a final *super* object. The objects for each field are referred to as '#N' where N is the N-th field array entry. The '&&' and '||' strings define intersection and union logic, respectively. For example, "#1 && #2" is the intersection of the objects from the first and second fields. "(#1 && #2) || #3" is the union of that intersection with the objects from the third field.

The **multivar_logic** entry is parsed separately from the **fcst** and **obs** dictionaries and can be defined differently in each.

_____________________

.. code-block:: none

fcst = {
Expand All @@ -242,6 +262,8 @@ _____________________

The **field** entries in the forecast and observation dictionaries specify the model and observation variables and level to be compared. See a more complete description of them in :numref:`config_options`. In the above example, the forecast settings are copied into the observation dictionary using **obs = fcst;.**

When **field** is set to an array of dictionaries rather than a single one, the multi-variate MODE logic is invoked. Please see :numref:`MODE-multivar` for a description of that logic.

The **censor_thresh** and **censor_val** entries are used to censor the raw data as described in :numref:`config_options`. Their functionality replaces the **raw_thresh** entry, which is deprecated in met-6.1. Prior to defining objects, it is recommended that the raw fields should be made to look similar to each other. For example, if the model only predicts values for a variable above some threshold, the observations should be thresholded at that same level. The censor thresholds can be specified using symbols. By default, no censor thresholding is applied.

The **conv_radius** entry defines the radius of the circular convolution applied to smooth the raw fields. The radii are specified in terms of grid units. The default convolution radii are defined in terms of the previously defined **grid_res** entry. Multiple convolution radii may be specified as an array (e.g. **conv_radius = [ 5, 10, 15 ];**).
Expand Down
6 changes: 6 additions & 0 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ static const char conf_key_is_wind_speed[] = "is_wind_speed";
static const char conf_key_is_wind_direction[] = "is_wind_direction";
static const char conf_key_is_prob[] = "is_prob";

//
// for use with mode multivar
//

static const char conf_key_multivar_logic [] = "multivar_logic";

//
// Climatology parameter key names
//
Expand Down
4 changes: 4 additions & 0 deletions met/src/basic/vx_config/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class DictionaryEntry {

const ConcatString string_value () const;

Dictionary * dict () const; // doesn't check for dict vs array

Dictionary * dict_value () const;

Dictionary * array_value () const;
Expand Down Expand Up @@ -165,6 +167,8 @@ inline int DictionaryEntry::n_args() const { return ( Nargs ); }

inline const IcodeVector * DictionaryEntry::icv() const { return ( v ); }

inline Dictionary * DictionaryEntry::dict() const { return ( Dict ); }


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

Expand Down
Loading