diff --git a/met/configure.ac b/met/configure.ac index dac13bfa64..cbe955c398 100644 --- a/met/configure.ac +++ b/met/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([MET], [m4_esyscmd_s(echo ${MET_BUILD_VERSION:-development})], [met_help@ucar.edu], [], [http://dtcenter.org/community-code/model-evaluation-tools-met]) +AC_INIT([MET], [m4_esyscmd_s(echo ${MET_BUILD_VERSION:-development})], [https://github.com/dtcenter/METplus/discussions], [], [http://dtcenter.org/community-code/model-evaluation-tools-met]) AC_CONFIG_SRCDIR([src/tools/tc_utils/tc_dland/tc_dland.cc]) AC_CONFIG_HEADERS([config.h]) diff --git a/met/data/config/WaveletStatConfig_default b/met/data/config/WaveletStatConfig_default index 5a50fe2f0d..6a7356c7ee 100644 --- a/met/data/config/WaveletStatConfig_default +++ b/met/data/config/WaveletStatConfig_default @@ -131,8 +131,8 @@ obs_raw_plot = { wvlt_plot = { color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; - plot_min = -1.0; - plot_max = 1.0; + plot_min = 0.0; + plot_max = 0.0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/met/data/wrappers/read_tmp_ascii.py b/met/data/wrappers/read_tmp_ascii.py index 66c008e3cd..fb7eb7b4e7 100644 --- a/met/data/wrappers/read_tmp_ascii.py +++ b/met/data/wrappers/read_tmp_ascii.py @@ -16,7 +16,7 @@ __author__ = 'David Fillmore' __version__ = '1.0.0' -__email__ = 'met_help@ucar.edu' + import argparse diff --git a/met/docs/Users_Guide/appendixA.rst b/met/docs/Users_Guide/appendixA.rst index e8e5973e9d..9a0d619648 100644 --- a/met/docs/Users_Guide/appendixA.rst +++ b/met/docs/Users_Guide/appendixA.rst @@ -36,7 +36,7 @@ A. No - it will not. In the future, we may add options to allow additional model **Q. How do I get help if my questions are not answered in the User's Guide?** -A. First, look on our `MET User's Guide website `_. If that doesn't answer your question, then email: met_help@ucar.edu. +A. First, look on our `MET User's Guide website `_. If that doesn't answer your question, create a post in the `METplus GitHub Discussions Forum `_. **Q. Where are the graphics?** @@ -94,9 +94,9 @@ The first place to look for help with individual commands is this user's guide o Where to get help _________________ -If none of the above suggestions have helped solve your problem, help is available through: met_help@ucar.edu +If none of the above suggestions have helped solve your problem, help is available through the `METplus GitHub Discussions Forum `_. How to contribute code ______________________ -If you have code you would like to contribute, we will gladly consider your contribution. Please send email to: met_help@ucar.edu +If you have code you would like to contribute, we will gladly consider your contribution. Please create a post in the `METplus GitHub Discussions Forum `_. diff --git a/met/docs/Users_Guide/index.rst b/met/docs/Users_Guide/index.rst index 40151728e5..6f62391dc6 100644 --- a/met/docs/Users_Guide/index.rst +++ b/met/docs/Users_Guide/index.rst @@ -6,7 +6,7 @@ User's Guide This User's guide is provided as an aid to users of the Model Evaluation Tools (MET). MET is a set of verification tools developed by the Developmental Testbed Center (DTC) for use by the numerical weather prediction community to help them assess and evaluate the performance of numerical weather predictions. It is also the core component of the unified METplus verification framework. More details about METplus can be found on the `METplus website `_. -It is important to note here that MET is an evolving software package. This documentation describes the |release| release dated |release_date|. Previous releases of MET have occurred each year since 2008. Intermediate releases may include bug fixes. MET is also able to accept new modules contributed by the community. If you have code you would like to contribute, we will gladly consider your contribution. Please send an email to: `met_help@ucar.edu `__. We will then determine the maturity of the new verification method and coordinate the inclusion of the new module in a future version. +It is important to note here that MET is an evolving software package. This documentation describes the |release| release dated |release_date|. Previous releases of MET have occurred each year since 2008. Intermediate releases may include bug fixes. MET is also able to accept new modules contributed by the community. If you have code you would like to contribute, we will gladly consider your contribution. Please create a post in the `METplus GitHub Discussions Forum `_. We will then determine the maturity of the new verification method and coordinate the inclusion of the new module in a future version. **Model Evaluation Tools (MET) TERMS OF USE - IMPORTANT!** diff --git a/met/docs/Users_Guide/overview.rst b/met/docs/Users_Guide/overview.rst index 733255d409..ac1d55c067 100644 --- a/met/docs/Users_Guide/overview.rst +++ b/met/docs/Users_Guide/overview.rst @@ -81,13 +81,13 @@ MET is an evolving verification software package. New capabilities are planned i Code support ____________ -MET support is provided through a MET-help email address: met_help@ucar.edu. We will endeavor to respond to requests for help in a timely fashion. In addition, information about MET and tools that can be used with MET are provided on the `MET web page `_. +MET support is provided through the `METplus GitHub Discussions Forum `_. We will endeavor to respond to requests for help in a timely fashion. In addition, information about MET and tools that can be used with MET are provided on the `MET web page `_. We welcome comments and suggestions for improvements to MET, especially information regarding errors. Comments may be submitted using the MET Feedback form available on the MET website. In addition, comments on this document would be greatly appreciated. While we cannot promise to incorporate all suggested changes, we will certainly take all suggestions into consideration. **-help** and **-version** command line options are available for all of the MET tools. Typing the name of the tool with no command line options also produces the usage statement. -The MET package is a "living" set of tools. Our goal is to continually enhance it and add to its capabilities. Because our time, resources, and talents are limited, we welcome contributed code for future versions of MET. These contributions may represent new verification methodologies, new analysis tools, or new plotting functions. For more information on contributing code to MET, please contact met_help@ucar.edu. +The MET package is a "living" set of tools. Our goal is to continually enhance it and add to its capabilities. Because our time, resources, and talents are limited, we welcome contributed code for future versions of MET. These contributions may represent new verification methodologies, new analysis tools, or new plotting functions. For more information on contributing code to MET, please create a post in the `METplus GitHub Discussions Forum `_. Fortify _______ diff --git a/met/docs/Users_Guide/tc-pairs.rst b/met/docs/Users_Guide/tc-pairs.rst index 24afaf814a..de8ff0f957 100644 --- a/met/docs/Users_Guide/tc-pairs.rst +++ b/met/docs/Users_Guide/tc-pairs.rst @@ -222,7 +222,7 @@ ____________________ time_offset = -14400; } -The **watch_warn** field specifies the file name and time applied offset to the **watch_warn** flag. The **file_name** string specifies the path of the watch/warning file to be used to determine when a watch or warning is in effect during the forecast initialization and verification times. The default file is named **wwpts_us.txt**, which is found in the installed *share/met/tc_data/* directory within the MET build. The **time_offset** string is the time window (in seconds) assigned to the watch/warning. Due to the non-uniform time watches and warnings are issued, a time window is assigned for which watch/warnings are included in the verification for each valid time. The default watch/warn file is static, and therefore may not include warned storms beyond the current MET code release date; therefore users may wish to contact met_help@ucar.edu to obtain the most recent watch/warning file if the static file does not contain storms of interest. +The **watch_warn** field specifies the file name and time applied offset to the **watch_warn** flag. The **file_name** string specifies the path of the watch/warning file to be used to determine when a watch or warning is in effect during the forecast initialization and verification times. The default file is named **wwpts_us.txt**, which is found in the installed *share/met/tc_data/* directory within the MET build. The **time_offset** string is the time window (in seconds) assigned to the watch/warning. Due to the non-uniform time watches and warnings are issued, a time window is assigned for which watch/warnings are included in the verification for each valid time. The default watch/warn file is static, and therefore may not include warned storms beyond the current MET code release date; therefore users may wish to create a post in the `METplus GitHub Discussions Forum `_ in order to obtain the most recent watch/warning file if the static file does not contain storms of interest. .. code-block:: none diff --git a/met/docs/Users_Guide/wavelet-stat.rst b/met/docs/Users_Guide/wavelet-stat.rst index ae26221f34..19db97d1ed 100644 --- a/met/docs/Users_Guide/wavelet-stat.rst +++ b/met/docs/Users_Guide/wavelet-stat.rst @@ -30,7 +30,7 @@ The method The Intensity Scale approach can be summarized in the following 5 steps: -1. For each threshold, the forecast and observation fields are transformed into binary fields: where the grid-point precipitation value meets the threshold criteria it is assigned 1, where the threshold criteria are not met it is assigned 0. :numref:`wavelet-stat_NIMROD_3h_fcst` illustrates an example of a forecast and observation fields, and their corresponding binary fields for a threshold of 1mm/h. This case shows an intense storm of the scale of 160 km displaced almost its entire length. The displacement error is clearly visible from the binary field difference and the contingency table image obtained for the same threshold :numref:`contingency_table_counts`. +1. For each threshold, the forecast and observation fields are transformed into binary fields: where the grid-point precipitation value meets the threshold criteria it is assigned 1, where the threshold criteria are not met it is assigned 0. This can also be done with no thresholds indicated at all and in that case the grid-point values are not transformed to binary fields and instead the raw data is used as is for statistics. :numref:`wavelet-stat_NIMROD_3h_fcst` illustrates an example of a forecast and observation fields, and their corresponding binary fields for a threshold of 1mm/h. This case shows an intense storm of the scale of 160 km displaced almost its entire length. The displacement error is clearly visible from the binary field difference and the contingency table image obtained for the same threshold :numref:`contingency_table_counts`. 2. The binary forecast and observation fields obtained from the thresholding are then decomposed into the sum of components on different scales, by using a 2D Haar wavelet filter (:numref:`wavelet-stat_NIMROD_diff`). Note that the scale components are fields, and their sum adds up to the original binary field. For a forecast defined over square domain of **2ⁿ x 2ⁿ** grid-points, the scale components are **n+1: n** mother wavelet components + the largest father wavelet (or scale-function) component. The **n** mother wavelet components have resolution equal to **1, 2, 4, ...** :math:`\mathbf{2^{n-1}}` grid-points. The largest father wavelet component is a constant field over the **2ⁿ x 2ⁿ** grid-point domain with value equal to the field mean. @@ -230,6 +230,23 @@ _______________________ .. code-block:: none + // Empty list of thresholds + cat_thresh = []; + + // Or explicitly set the NA threshold type + cat_thresh = [>0.0, >=5.0, NA]; + + +The **cat_thresh** option defines an array of thresholds for each field defined in the fcst and obs dictionaries. The number of forecast and observation categorical thresholds must match. If set to an empty list, the thresholds will not be applied (no binary masking) and all the raw grid-point values will be used for downstream statistics. + +If the array of thresholds is an empty list, the application will set the threshold to NA internally and skip applying the thresholds. If the threshold is set to NA explicitly in the list, the application will also skip applying the threshold. + +Since the application has the ability to loop through multiple thresholds (for multiple fields), a user can include NA in the list of thresholds to produce statistics for the raw data values for the given field. + +_______________________ + +.. code-block:: none + grid_decomp_flag = AUTO; tile = { diff --git a/met/scripts/config/WaveletStatConfig_APCP_12 b/met/scripts/config/WaveletStatConfig_APCP_12 index 8abdaddb57..67079ef1c7 100644 --- a/met/scripts/config/WaveletStatConfig_APCP_12 +++ b/met/scripts/config/WaveletStatConfig_APCP_12 @@ -50,7 +50,7 @@ fcst = { { name = "APCP"; level = [ "A12" ]; - cat_thresh = [ >0.0, >=5.0 ]; + cat_thresh = [ >0.0, >=5.0, NA ]; } ]; } @@ -59,7 +59,7 @@ obs = { { name = "APCP_12"; level = [ "(*,*)" ]; - cat_thresh = [ >0.0, >=5.0 ]; + cat_thresh = [ >0.0, >=5.0, NA ]; } ]; } @@ -137,8 +137,8 @@ obs_raw_plot = { wvlt_plot = { color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; - plot_min = -1.0; - plot_max = 1.0; + plot_min = 0.0; + plot_max = 0.0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/met/src/libcode/vx_data2d_nccf/nccf_file.cc b/met/src/libcode/vx_data2d_nccf/nccf_file.cc index f948800ef1..4de72e0f44 100644 --- a/met/src/libcode/vx_data2d_nccf/nccf_file.cc +++ b/met/src/libcode/vx_data2d_nccf/nccf_file.cc @@ -2909,6 +2909,11 @@ void NcCfFile::get_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, double dlat = lat_values[1] - lat_values[0]; double dlon = rescale_lon(lon_values[1] - lon_values[0]); + mlog << Debug(7) << method_name << " -> lat[0]=" << lat_values[0] + << " lat[" << (lat_counts-1) << "]=" << lat_values[lat_counts-1] + << " dlat=" << dlat << " lon[0]=" << lon_values[0] + << " lon[" << (lon_counts-1) << "]=" << lon_values[lon_counts-1] + << " dlon=" << dlon << "\n"; ConcatString point_nccf; bool skip_sanity_check = get_att_value_string(_ncFile, nc_att_met_point_nccf, point_nccf); diff --git a/met/src/libcode/vx_nc_util/nc_utils.cc b/met/src/libcode/vx_nc_util/nc_utils.cc index d45a49f8b6..eb066df60a 100644 --- a/met/src/libcode/vx_nc_util/nc_utils.cc +++ b/met/src/libcode/vx_nc_util/nc_utils.cc @@ -1433,6 +1433,18 @@ bool get_nc_data(NcVar *var, float *data) { if (NcType::nc_FLOAT == type_id) { var->getVar(data); } + else if (NcType::nc_DOUBLE == type_id) { + int cell_count = 1; + for (int idx=0; idxgetDimCount();idx++) { + cell_count *= get_dim_size(var, idx); + } + double *double_data = new double[cell_count]; + var->getVar(double_data); + for (int idx=0; idxgetDimCount();idx++) { diff --git a/met/src/tools/core/wavelet_stat/wavelet_stat.cc b/met/src/tools/core/wavelet_stat/wavelet_stat.cc index e557d039a0..c2dbc61635 100644 --- a/met/src/tools/core/wavelet_stat/wavelet_stat.cc +++ b/met/src/tools/core/wavelet_stat/wavelet_stat.cc @@ -35,7 +35,8 @@ // 010 02/25/15 Halley Gotway Add automated regridding. // 011 05/15/17 Prestopnik P. Add shape to regrid options. // 012 04/08/19 Halley Gotway Add percentile thresholds. -// 012 04/01/19 Fillmore Add FCST and OBS units. +// 013 04/01/19 Fillmore Add FCST and OBS units. +// 014 07/09/21 Linden MET #1746 Skip thresholding. // //////////////////////////////////////////////////////////////////////// @@ -113,8 +114,8 @@ static double mean_array(double *, int); static void plot_ps_raw(const DataPlane &, const DataPlane &, const DataPlane &, const DataPlane &, int); -static void plot_ps_wvlt(const double *, int, int, int, ISCInfo &, - int, int); +static void plot_ps_wvlt(const double *, const double, int, int, int, + ISCInfo &, int, int); static double compute_percentage(double, double); static void set_plot_dims(int, int); @@ -419,7 +420,7 @@ void process_scores() { // Allocate memory for ISCInfo objects sized as [n_tile][n_thresh] isc_info = new ISCInfo * [conf_info.get_n_tile()]; for(j=0; j " << "the forecast and observation arrays must have equal " << "length.\n\n"; @@ -962,7 +964,7 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na, ns = conf_info.get_n_scale(); // Set up the ISCInfo thresholds and n_scale - n_isc = conf_info.fcat_ta[i_vx].n_elements(); + n_isc = conf_info.fcat_ta[i_vx].n(); for(i=0; imagic_str() << " " << fcst_thresh_str << " versus " << conf_info.obs_info[i_vx]->magic_str() << " " << obs_thresh_str << ".\n"; - // Apply the threshold to each point to create 0/1 mask fields - for(j=0; j mad) mad = fabs(diff[j]); } // end for j // Compute the contingency table for the binary fields @@ -1023,15 +1044,15 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na, isc_info[i].compute_isc(-1); // Write the thresholded binary fields to NetCDF - if ( conf_info.nc_info.do_raw || conf_info.nc_info.do_diff ) { + if(conf_info.nc_info.do_raw || conf_info.nc_info.do_diff ) { write_nc_wav(conf_info.nc_info, f_dat, o_dat, n, i_vx, i_tile, -1, isc_info[i].fthresh, isc_info[i].othresh); } // Write the thresholded binary difference field to PostScript - if ( ! (conf_info.nc_info.all_false()) ) { - plot_ps_wvlt(diff, n, i_vx, i_tile, isc_info[i], -1, ns); + if(!conf_info.nc_info.all_false()) { + plot_ps_wvlt(diff, mad, n, i_vx, i_tile, isc_info[i], -1, ns); } // Initialize the discrete wavelet transforms @@ -1102,7 +1123,7 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na, isc_info[i].compute_isc(j); // Write the decomposed fields for this scale to NetCDF - if ( ! (conf_info.nc_info.all_false()) ) { + if(!conf_info.nc_info.all_false()) { write_nc_wav(conf_info.nc_info, f_scl, o_scl, n, i_vx, i_tile, j, isc_info[i].fthresh, @@ -1114,7 +1135,7 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na, // Write the decomposed difference field for this scale to PostScript if(conf_info.ps_plot_flag) { - plot_ps_wvlt(diff, n, i_vx, i_tile, isc_info[i], j, ns); + plot_ps_wvlt(diff, mad, n, i_vx, i_tile, isc_info[i], j, ns); } } // end for j @@ -2265,7 +2286,8 @@ void plot_ps_raw(const DataPlane &fcst_dp, //////////////////////////////////////////////////////////////////////// -void plot_ps_wvlt(const double *diff, int n, int i_vx, int i_tile, +void plot_ps_wvlt(const double *diff, double mad, + int n, int i_vx, int i_tile, ISCInfo &isc_info, int i_scale, int n_scale) { ConcatString label; @@ -2286,12 +2308,6 @@ void plot_ps_wvlt(const double *diff, int n, int i_vx, int i_tile, v_tab = v_tab_cen; } - // - // The min and max plotting values should default to [-1.0, 1.0] - // for the decomposed wavelet difference fields. - // - wvlt_ct.rescale(-1.0, 1.0, bad_data_double); - // // If the wvlt_plot_min or wvlt_plot_max value is set in the // config file, rescale the colortable to the requested range. @@ -2302,6 +2318,15 @@ void plot_ps_wvlt(const double *diff, int n, int i_vx, int i_tile, conf_info.wvlt_pi.plot_max, bad_data_double); } + // + // Otherwise, rescale the colortable to [-d, d] where d is the maximum + // absolute difference and at least 1.0. If thresholds have been applied, + // the plotting range should be [-1.0, 1.0]. + // + else { + double max_plot_val = max(1.0, mad); + wvlt_ct.rescale(-1.0*max_plot_val, max_plot_val, bad_data_double); + } // // Set the fill color. If a fill value is not specified in the range @@ -2331,10 +2356,10 @@ void plot_ps_wvlt(const double *diff, int n, int i_vx, int i_tile, v_tab -= 1.0*plot_text_sep; ps_out->write_centered_text(1, 1, h_tab_cen, v_tab, 0.5, 0.5, label.c_str()); if(i_scale == -1) - label.format("Tile %i, Binary, Difference (F-0)", + label.format("Tile %i, Binary, Difference (F-O)", i_tile+1); else - label.format("Tile %i, Scale %i, Difference (F-0)", + label.format("Tile %i, Scale %i, Difference (F-O)", i_tile+1, i_scale+1); v_tab -= 2.0*plot_text_sep; diff --git a/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc b/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc index 087d1fbaba..103f203280 100644 --- a/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc +++ b/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc @@ -135,7 +135,7 @@ void WaveletStatConfInfo::read_config(const char *default_file_name, void WaveletStatConfInfo::process_config(GrdFileType ftype, GrdFileType otype) { - int i, n; + int i, j, n; VarInfoFactory info_factory; mapoutput_map; Dictionary *fcst_dict = (Dictionary *) 0; @@ -144,6 +144,9 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, Dictionary i_fdict, i_odict; gsl_wavelet_type type; + SingleThresh st_NA; + st_NA.set_na(); + // Dump the contents of the config file if(mlog.verbosity_level() >= 5) conf.dump(cout); @@ -250,10 +253,23 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, << "Forecast categorical thresholds: " << fcat_ta[i].get_str() << "\n" << "Observed categorical thresholds: " << ocat_ta[i].get_str() << "\n"; } + + // If the forecast threshold array is an empty list (or NA) + // Add the NA threshold type to the list for downstream iteration + if(fcat_ta[i].n() == 0) { + mlog << Debug(2) << "Found empty list for forecast threshold, setting threshold type to NA.\n"; + fcat_ta[i].add(st_NA); + } + + // If the observation threshold array is an empty list (or NA) + // Add the NA threshold type to the list for downstream iteration + if(ocat_ta[i].n() == 0) { + mlog << Debug(2) << "Found empty list for observation threshold, setting threshold type to NA.\n"; + ocat_ta[i].add(st_NA); + } // Check for the same number of fcst and obs thresholds - if(fcat_ta[i].n_elements() != ocat_ta[i].n_elements()) { - + if(fcat_ta[i].n() != ocat_ta[i].n()) { mlog << Error << "\nWaveletStatConfInfo::process_config() -> " << "The number of thresholds for each field in \"fcst." << conf_key_cat_thresh @@ -262,8 +278,19 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, exit(1); } + // Send a warning about inconsistent use of the NA threshold + for(j=0; j " + << "Skipping thresholding for the forecast (" << fcat_ta[i][j].get_str() + << ") or observation (" << ocat_ta[i][j].get_str() + << ") but not the other may produce unexpected results!\n\n"; + } + } + // Keep track of the maximum number of thresholds - if(fcat_ta[i].n_elements() > max_n_thresh) max_n_thresh = fcat_ta[i].n_elements(); + if(fcat_ta[i].n() > max_n_thresh) max_n_thresh = fcat_ta[i].n(); } // end for i @@ -505,7 +532,7 @@ void WaveletStatConfInfo::process_tiles(const Grid &grid) { case(GridDecompType_Tile): // Number of tiles based on the user-specified locations - n_tile = tile_xll.n_elements(); + n_tile = tile_xll.n(); msg << "\nTiling Method: Apply " << n_tile << " tile(s) specified in the configuration file " @@ -641,9 +668,9 @@ int WaveletStatConfInfo::n_isc_row() { // Compute the number of output lines for each verification field for(i=0,n=0; i 1) n += (n_scale + 2) * fcat_ta[i].n_elements(); + if(n_tile > 1) n += (n_scale + 2) * fcat_ta[i].n(); } return(n); diff --git a/met/src/tools/other/point2grid/point2grid.cc b/met/src/tools/other/point2grid/point2grid.cc index 8f718b0e2a..fe96df2d11 100644 --- a/met/src/tools/other/point2grid/point2grid.cc +++ b/met/src/tools/other/point2grid/point2grid.cc @@ -1930,6 +1930,7 @@ static bool get_grid_mapping(Grid fr_grid, Grid to_grid, IntArray *cellMapping, exit(1); } else if (data_size > 0) { + int last_idx = data_size - 1; float *latitudes = new float[data_size]; float *longitudes = new float[data_size]; status = get_nc_data(&var_lat, latitudes); @@ -1939,6 +1940,14 @@ static bool get_grid_mapping(Grid fr_grid, Grid to_grid, IntArray *cellMapping, latitudes, longitudes, from_lat_count, from_lon_count, skip_times, !fr_grid.get_swap_to_north()); + + if (is_eq(latitudes[0], latitudes[last_idx]) || + is_eq(longitudes[0], longitudes[last_idx])) { + mlog << Warning << "\n" << method_name << "same latitude or longitude. lat[0]=" + << latitudes[0] << " lat[" << last_idx << "]=" << latitudes[last_idx] + << " lon[0]=" << longitudes[0] << " lon[" << last_idx << "]=" + << longitudes[last_idx] << "\n\n"; + } } if( latitudes ) delete [] latitudes; if( longitudes ) delete [] longitudes; diff --git a/test/config/WaveletStatConfig b/test/config/WaveletStatConfig index b9a3983bdf..06963c8f51 100644 --- a/test/config/WaveletStatConfig +++ b/test/config/WaveletStatConfig @@ -127,8 +127,8 @@ obs_raw_plot = { wvlt_plot = { color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; - plot_min = -1.0; - plot_max = 1.0; + plot_min = 0.0; + plot_max = 0.0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/WaveletStatConfig_no_thresholds b/test/config/WaveletStatConfig_no_thresholds new file mode 100644 index 0000000000..42e02ca680 --- /dev/null +++ b/test/config/WaveletStatConfig_no_thresholds @@ -0,0 +1,139 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Wavelet-Stat 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 +// May be set separately in each "obs.field" entry +// +desc = "NA"; + +// +// Output observation type to be written +// +obtype = "MC_PCP"; + +//////////////////////////////////////////////////////////////////////////////// + +// +// Verification grid +// +regrid = { + to_grid = NONE; + method = NEAREST; + width = 1; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Forecast and observation fields to be verified +// +fcst = { + field = [ + { + name = "APCP"; + level = [ "A12" ]; + cat_thresh = []; + } + ]; +} +obs = { + field = [ + { + name = "APCP_12"; + level = [ "(*,*)" ]; + cat_thresh = []; + } + ]; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Handle missing data +// +mask_missing_flag = NONE; + +//////////////////////////////////////////////////////////////////////////////// + +// +// Decompose the field into dyadic tiles +// +grid_decomp_flag = AUTO; + +tile = { + width = 0; + location = [ + { + x_ll = 0; + y_ll = 0; + } + ]; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Wavelet to be used for the decomposition +// +wavelet = { + type = HAAR; + member = 2; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Statistical output types +// +output_flag = { + isc = BOTH; +} + +// +// NetCDF matched pairs and PostScript output files +// +nc_pairs_flag = TRUE; +ps_plot_flag = TRUE; + +//////////////////////////////////////////////////////////////////////////////// + +// +// 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; +} + +wvlt_plot = { + color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; + plot_min = 0.0; + plot_max = 0.0; +} + +//////////////////////////////////////////////////////////////////////////////// + +output_prefix = "${OUTPUT_PREFIX}"; +version = "V10.1.0"; + +//////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/WaveletStatConfig_python b/test/config/WaveletStatConfig_python index 28df2065a8..b9e2d62f04 100644 --- a/test/config/WaveletStatConfig_python +++ b/test/config/WaveletStatConfig_python @@ -118,8 +118,8 @@ obs_raw_plot = { wvlt_plot = { color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; - plot_min = -1.0; - plot_max = 1.0; + plot_min = 0.0; + plot_max = 0.0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/WaveletStatConfig_python_mixed b/test/config/WaveletStatConfig_python_mixed index a5e09298b7..899766b007 100644 --- a/test/config/WaveletStatConfig_python_mixed +++ b/test/config/WaveletStatConfig_python_mixed @@ -127,8 +127,8 @@ obs_raw_plot = { wvlt_plot = { color_table = "MET_BASE/colortables/NCL_colortables/BlWhRe.ctable"; - plot_min = -1.0; - plot_max = 1.0; + plot_min = 0.0; + plot_max = 0.0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/xml/unit_wavelet_stat.xml b/test/xml/unit_wavelet_stat.xml index 0b4d33510d..9e5f6efdd9 100644 --- a/test/xml/unit_wavelet_stat.xml +++ b/test/xml/unit_wavelet_stat.xml @@ -15,7 +15,10 @@ &TEST_DIR; true - + + + + &MET_BIN;/wavelet_stat @@ -35,5 +38,27 @@ + + + + + + &MET_BIN;/wavelet_stat + + OUTPUT_PREFIX GRIB1_NAM_STAGE4_NO_THRESH + + \ + &DATA_DIR_MODEL;/grib1/nam_st4/nam_2012040900_F012_gSt4.grib \ + &OUTPUT_DIR;/pcp_combine/stage4_2012040912_F012_APCP12.nc \ + &CONFIG_DIR;/WaveletStatConfig_no_thresholds \ + -outdir &OUTPUT_DIR;/wavelet_stat -v 1 + + + &OUTPUT_DIR;/wavelet_stat/wavelet_stat_GRIB1_NAM_STAGE4_NO_THRESH_120000L_20120409_120000V.stat + &OUTPUT_DIR;/wavelet_stat/wavelet_stat_GRIB1_NAM_STAGE4_NO_THRESH_120000L_20120409_120000V_isc.txt + &OUTPUT_DIR;/wavelet_stat/wavelet_stat_GRIB1_NAM_STAGE4_NO_THRESH_120000L_20120409_120000V.nc + &OUTPUT_DIR;/wavelet_stat/wavelet_stat_GRIB1_NAM_STAGE4_NO_THRESH_120000L_20120409_120000V.ps + +