From 5eed9f158a75937dfb659d487e0160657dcc8f59 Mon Sep 17 00:00:00 2001 From: johnhg Date: Wed, 2 Feb 2022 20:19:12 -0700 Subject: [PATCH] Update develop-ref after #2034 (#2037) * Per #1906, modify code to pass entire path to make_temp_file_name instead of only the filename so that the function can tell whether or not the file exists. (#1952) Co-authored-by: Julie Prestopnik * Feature 1761 percent thresh (#1956) * Per issue #1761 in set_perc() adding code to get FBIAS numeric value, like 1.0 or 0.9, etc. SL * Per issue #1761: in set_perc(), modified actual percentile calculation at end to use the extracted FBIAS numeric value (float). SL * Per issue #1761: modified the check on the perc_thresh_freq_bias, just has to be > 0 now. SL * Per issue #1761: cleaned up code in set_perc(). SL * Per #1761, updates to Simple_Node::set_perc() to handle variable frequency bias amounts. Changes include: - Reverting the formatting of this back to how it originally was in the develop branch. In general, just match the formatting of the existing file, so as the minimize the number of difference lines. - Add logic to adjust the percentile to be found based on the requested FBIAS value. Multiplying or dividing the percentile by the FBIAS value depends on the inequality type and whether we're bias adjusting the forecast or observation data. - Adjust the log messages slightly. Please be aware that I'm not totally confident in these changes. They warrant much more testing. This logic is very, very confusing. * Per #1761, call compute_percentile() when double-checking the percentile values. * Per #1761, remove unused variable. * Per #1761, add warning for percentiles > 100. * Per #1761. In set_perc(), after testing cleaned up code. SL * Per issue #1761: adding new config file for testing dynamic FBIAS values. SL * Per issue #1761: added new unit test for dynamic FBIAS values when running grid_stat. SL * Per issue #1761, modified FBIAS section to indicated that the user can use dynamic values that are not 1.0. SL * Update met/docs/Users_Guide/config_options.rst Co-authored-by: johnhg * Update met/docs/Users_Guide/config_options.rst Co-authored-by: johnhg * Update met/docs/Users_Guide/config_options.rst Co-authored-by: johnhg * Update test/config/GridStatConfig_fbias_perc_thresh Co-authored-by: johnhg * Update test/config/GridStatConfig_fbias_perc_thresh Co-authored-by: johnhg * Update test/config/GridStatConfig_fbias_perc_thresh Co-authored-by: johnhg * Update test/config/GridStatConfig_fbias_perc_thresh Co-authored-by: johnhg * Per issue #1761, set nc_pairs_flag = FALSE. SL Co-authored-by: Seth Linden Co-authored-by: John Halley Gotway * Feature 1905 ens_ctrl (#1955) Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com> * Hotfix after merging changing for #1761. Updating the list of expected output files. * Per #1905, committing a hotfix directly to the develop branch. Reverting the logic for computing the ensemble range back to what it was previously. The new version produced very slight differences in the 6-th or 7-th decimal place when compared to previous results. There's not good reason for these changes which were caused by the order of operations in casting from doubles to floats. Reverting back to the old logic prevents diffs for anyone else downstream and is the prudent choice. * Feature 1957 ascii2nc_python (#1958) * Feature 1949 cf netcdf documentaton (#1951) * #1949 Added CF compliant NetCDF into data IO * #1949 Added commas * #1948 Some corrections for typo and added the links for CF attributes * #1948 Added Performance with NetCDF input data * #1949 Corrected tyoe and applied Juloie's suggestions Co-authored-by: Howard Soh * Feature 1968 ens_ctrl (#1969) * Feature 1809 gen prob (#1967) * Feature 1970 v10.1.0-beta4 (#1973) * Fix tiny typo in plot_data_plane usage statement. * Hotfix for the develop branch to get met-10.1.0-beta4 compiling on WCOSS. The intel compiler does not allow adjacent >> characters when defining maps. * Updating the beta4 release date from 11/16 to 11/17 since the beta4 release needs to be recreated. * Update the MET PR template to list expected changes up front. * Bugfix 1976 develop cdist (#1979) * #1936 Excludes precip3hr, precip6hr, precip12hr, and precip10min from required variables for MESONET * Per #1985, correcting typo found while creating V10.0.1 in the develop branch as well. * Per #1985, VERY minor change to fix alignment of titles in Point-Stat... updating the develop branch. * #1936 Added an unit test for newer MESONET file * Feature 1989 sort (#1990) * Feature 1991 VCNT (#1992) * Feature 1993 grid_mask (#1994) * #1844 Added vx_pointdata_python * #1844 Added vx_pointdata_python to PYTHON_LIBS & make file for vx_pointdata_python * #1844 Added vx_pointdata_python to SUBDIRS * #1844 Initial release * #1844 Added met_point_data.cc & met_point_data.h * #1844 NcHeaderData is renamed to MetPointHeader and moved to met_point_dataq.h * #1844 NcPointObsData is derived from MetPointObsData. Many methods are moved to the base class MetPointObsData * #1844 Moved varianbles and methods to the base class MetPointData * #1844 override the obs_data pointer to the derived class * #1844 Added pyobject_as_bool & pyobject_as_string_array * #1844 Cleanup include statements and addpointdata_python.h if python is enabled * #18443 Support python embedding * #1844 Initial release * #1844 Make buf_size const * Add GitHub Actions workflow to trigger METplus testing workflow (#2002) * changed names of inputs to send to METplus to match changes to METplus repo * #1965 Excludes the duplicated variable names from multiple input files * #1965 Processed with the raw variable names and update them when the output is saved. * #1965 Added unit test ioda2nc_same_input * #1965 Processed with the raw variable names and update them when the output is saved. * #1965 Added unit test ioda2nc_same_input * #1965 initialize var_idx * Update the development environment for seneca to add /usr/local/nco/bin and /usr/local/netcdf/bin to the path. Also define MET_TEST_RSCRIPT to point to a new enough version of RSCRIPT that has the ncdf4 package 1.17 or later. * send email address of user who triggered event to METplus workflow as input * Fixup the Rscript diffing logic to support running the nightly build on seneca. The problem here is that the ncdiff -x -v command line options that worked in version 4.7.0 NO LONGER work in 4.9.2. Added a check to skip over the time_bounds variable when processing the ncdiff output. * No real changes here. Just formatting * Feature 1974 message_type_group_map (#1999) Co-authored-by: Howard Soh Co-authored-by: John Halley Gotway * Feature 1996 uninitialized variables (#2004) Co-authored-by: Howard Soh Co-authored-by: John Halley Gotway * Feature 1695 ensemble single file (gen_ens_prod) (#2001) Co-authored-by: johnhg * Feature 1965 NB faile with time summary by ioda2nc (#2008) Co-authored-by: Howard Soh * Feature 1810 shapes (#2005) * #1844 Added log message for use_var_id * #1844 Get use_var_id for python embedding * #1844 Initial release * #1844 Added met_point_obs.py and read_met_point_obs.py * #1844 Added 4 unit test for python embedding of MET point data * More changes to test_util.R to account for differences between 4.7.0 and 4.9.2 of ncdiff. The earlier version reported 0 diffs for the time_bounds, lat, lon, latitude, and longitude variables while the newer version reports their raw values. Simply ignore these variables for now. This isn't a great solution but when we reimplement this testing logic in python, we can address this issue then. * #1844 Added python embedding for point observation data * Feature 1926 gridstat openmp (#1977) Co-authored-by: johnhg Co-authored-by: John Halley Gotway Co-authored-by: Julie Prestopnik * feature 1695 ensemble single file (ensemble_stat) (#2007) Co-authored-by: johnhg * Committing directly to the develop branch. Removing many, many instances of MET_BUILD_BASE and a couple instances of MET_BASE from the examples listed in Appendix A. The inconsistent use of these variables will only cause confusion. Removing them will help avoid that confusion. Big picture... MET_BASE defines the installed 'share/met' directory. It can be used to reference the location of map or polyline files. MET_BUILD_BASE is only used in the context of the test scripts. There, it's defined as the top-level source code directory in which the code was compiled. Its used to reference the location of sample data files or Rscript included in the tarball. I left a couple references to these variables in Appendix A where thier use is not confusing. But I removed all instances which are used to the define the location of the 'bin' directory. Instead, let's just assume the MET binaries are already in their path... or the user knows where to find them. * feature 2011 v10.1.0-beta5 (#2014) * feature 1695 fix issues with ensemble changes (#2012) Co-authored-by: John Halley Gotway Co-authored-by: John Halley Gotway * Hotfix for #1695 committed directly to the develop branch. The new Ensemble-Stat config files added for this issue don't define a random number generator seed. This results in different output for each run and prevents the regression test from producing repeatable results. Defining the seed here to fix that. * Adding George to email list for the nightly build. * Fix the links for the met-10.1.0-beta5 release notes. * #1844 Make met_point_obs as abstract class * #1844 correctedb for loop end condition on processing obs bdata * Feature 1546 unit_tests (#2021) * #2020 Added SonarQube related varibales * #2020 Initial release * #2015 Avoid the repeasted debug message if derived varibales are disabled * #1996 Initialize right and left * #1966 Call clear() instead of reset memory for Header variable * #1966 Make sure the levels from variable does not exceed the maxLevel * #1966 Removed unreachable codes * #1966 Do not write into NetcDF if empty data * #2015 Corrected "retained or derived" count * Feature 1546 CI testing (#2029) Co-authored-by: John Halley Gotway * fixed broken workflow by setting environment variable expected for docker build script * add missing docker tag from push command * added correct docker tag value * fixed incorrect truth data version for updating -ref reference data * Updating develop with changes to the unit tests names. Renaming unit_test.yml to a more generic testing.yml name since it compiles AND/OR runs unit tests. Also make the job names more concise so its easier to see what's running in the action summary window on GitHub. * fixed directory to copy truth data into -- copy command was copying the content of the directory, not including the directory itself * Per #1907, added warning about switch from Ensemble-Stat to Gen-Ens-Prod (#2032) Co-authored-by: Julie Prestopnik * 2028 Check null for header data * Removed un-reachable code * #2028 Check if the pointer (d) is null * #2015 Changed warning to debug message * #2028 Passing two dimensionl cur and dim array * #2028 Set obs_data * Feature 2003 briercl (#2034) Co-authored-by: jprestop Co-authored-by: Julie Prestopnik Co-authored-by: Seth Linden Co-authored-by: Seth Linden Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com> Co-authored-by: hsoh-u Co-authored-by: Howard Soh Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: John Halley Gotway Co-authored-by: MET Tools Test Account Co-authored-by: mo-mglover <78152252+mo-mglover@users.noreply.github.com> Co-authored-by: John Halley Gotway Co-authored-by: Howard Soh --- met/data/config/GridStatConfig_default | 1 + met/data/config/PointStatConfig_default | 1 + met/data/config/SeriesAnalysisConfig_default | 11 +- met/docs/Users_Guide/config_options.rst | 32 +++- met/docs/Users_Guide/series-analysis.rst | 3 +- met/src/basic/vx_config/config_constants.h | 10 +- met/src/basic/vx_config/config_util.cc | 7 +- met/src/libcode/vx_nc_obs/met_point_data.cc | 32 +--- .../vx_pointdata_python/pointdata_python.cc | 2 - .../libcode/vx_statistics/compute_stats.cc | 2 +- met/src/libcode/vx_statistics/ens_stats.cc | 2 +- met/src/libcode/vx_statistics/pair_base.cc | 132 ++++++++++---- met/src/libcode/vx_statistics/pair_base.h | 14 +- .../vx_statistics/pair_data_ensemble.cc | 16 +- .../vx_statistics/pair_data_ensemble.h | 2 +- .../libcode/vx_statistics/pair_data_point.cc | 16 +- .../libcode/vx_statistics/pair_data_point.h | 2 +- .../tools/core/ensemble_stat/ensemble_stat.cc | 2 +- .../ensemble_stat/ensemble_stat_conf_info.cc | 11 +- met/src/tools/core/grid_stat/grid_stat.cc | 2 +- met/src/tools/core/point_stat/point_stat.cc | 2 +- .../core/point_stat/point_stat_conf_info.cc | 2 +- .../core/series_analysis/series_analysis.cc | 40 +++-- .../series_analysis_conf_info.cc | 12 +- .../series_analysis_conf_info.h | 2 + .../core/stat_analysis/aggr_stat_line.cc | 23 ++- .../tools/core/stat_analysis/aggr_stat_line.h | 2 + .../core/stat_analysis/stat_analysis_job.cc | 6 +- met/src/tools/other/madis2nc/madis2nc.cc | 4 +- .../other/mode_time_domain/mtd_file_int.cc | 14 +- met/src/tools/other/pb2nc/pb2nc.cc | 20 ++- test/config/GridStatConfig_climo_WMO | 1 + test/config/GridStatConfig_climo_prob | 1 + test/config/GridStatConfig_mpr_thresh | 1 + test/config/PointStatConfig_airnow | 1 + test/config/PointStatConfig_climo | 1 + test/config/PointStatConfig_climo_WMO | 1 + test/config/PointStatConfig_climo_prob | 1 + test/config/PointStatConfig_mpr_thresh | 1 + test/config/PointStatConfig_python | 1 + test/config/SeriesAnalysisConfig | 40 ++++- test/config/SeriesAnalysisConfig_climo | 13 +- test/config/SeriesAnalysisConfig_climo_prob | 164 ++++++++++++++++++ test/config/SeriesAnalysisConfig_conditional | 5 +- test/config/SeriesAnalysisConfig_python | 11 +- test/xml/unit_climatology_1.0deg.xml | 49 ++++++ 46 files changed, 550 insertions(+), 168 deletions(-) create mode 100644 test/config/SeriesAnalysisConfig_climo_prob diff --git a/met/data/config/GridStatConfig_default b/met/data/config/GridStatConfig_default index 89dc90e156..2ee10600a2 100644 --- a/met/data/config/GridStatConfig_default +++ b/met/data/config/GridStatConfig_default @@ -107,6 +107,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/met/data/config/PointStatConfig_default b/met/data/config/PointStatConfig_default index 558e419726..3967152fe6 100644 --- a/met/data/config/PointStatConfig_default +++ b/met/data/config/PointStatConfig_default @@ -149,6 +149,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/met/data/config/SeriesAnalysisConfig_default b/met/data/config/SeriesAnalysisConfig_default index c725cb2a5c..0249671fb6 100644 --- a/met/data/config/SeriesAnalysisConfig_default +++ b/met/data/config/SeriesAnalysisConfig_default @@ -85,6 +85,12 @@ climo_stdev = { file_name = []; } +climo_cdf = { + cdf_bins = 1; + center_bins = FALSE; + direct_prob = FALSE; +} + //////////////////////////////////////////////////////////////////////////////// // @@ -111,8 +117,9 @@ mask = { } // -// Number of grid points to be processed concurrently. Set smaller to use -// less memory but increase the number of passes through the data. +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. // block_size = 1024; diff --git a/met/docs/Users_Guide/config_options.rst b/met/docs/Users_Guide/config_options.rst index b56cb65d75..9f568932bd 100644 --- a/met/docs/Users_Guide/config_options.rst +++ b/met/docs/Users_Guide/config_options.rst @@ -1307,8 +1307,8 @@ over the "climo_mean" setting and then updating the "file_name" entry. The "climo_cdf" dictionary specifies how the the climatological mean ("climo_mean") and standard deviation ("climo_stdev") data are used to evaluate model performance relative to where the observation value falls -within the climatological distribution. This dictionary consists of 3 -entries: +within the climatological distribution. This dictionary consists of the +following entries: (1) The "cdf_bins" entry defines the climatological bins either as an integer @@ -1320,6 +1320,8 @@ entries: (3) The "write_bins" entry may be set to TRUE or FALSE. +(4) The "direct_prob" entry may be set to TRUE or FALSE. + MET uses the climatological mean and standard deviation to construct a normal PDF at each observation location. The total area under the PDF is 1, and the climatological CDF value is computed as the area of the PDF to the left of @@ -1348,11 +1350,11 @@ an even number of bins can only be uncentered. For example: 5 centered bins (cdf_bins = 5; center_bins = TRUE;) yields: 0.0, 0.125, 0.375, 0.625, 0.875, 1.0 -When multiple climatological bins are used, statistics are computed -separately for each bin, and the average of the statistics across those bins -is written to the output. When "write_bins" is true, the statistics for each -bin are also written to the output. The bin number is appended to the -contents of the VX_MASK output column. +When multiple climatological bins are used for Point-Stat and Grid-Stat, +statistics are computed separately for each bin, and the average of the +statistics across those bins is written to the output. When "write_bins" +is true, the statistics for each bin are also written to the output. +The bin number is appended to the contents of the VX_MASK output column. Setting the number of bins to 1 effectively disables this logic by grouping all pairs into a single climatological bin. @@ -1363,6 +1365,7 @@ all pairs into a single climatological bin. cdf_bins = 11; or an array of floats center_bins = TRUE; or FALSE write_bins = FALSE; or TRUE + direct_prob = FALSE; or TRUE } .. _climato_data: @@ -1381,7 +1384,18 @@ directly to compute Brier Skill Score (BSS). When "climo_mean" and "climo_stdev" are both set to non-probability fields, the MET tools use the mean, standard deviation, and observation event threshold to derive a normal approximation of the climatological -probabilities. Those derived probability values are used to compute BSS. +probabilities. + +The "direct_prob" option controls the derivation logic. When "direct_prob" is +true, the climatological probability is computed directly from the +climatological distribution at each point as the area to the left of +the event threshold value. For greater-than or greater-than-or-equal-to +thresholds, 1.0 minus the area is used. When "direct_prob" is false, the +"cdf_bins" values are sampled from climatological distribution. The probability +is computed as the proportion of those samples which meet the threshold criteria. +In this way, the number of bins impacts the resolution of the climatological +probabilities. These derived probability values are used to compute the +climatological Brier Score and Brier Skill Score. .. _mask_missing_flag: @@ -3593,6 +3607,8 @@ Computation may be memory intensive, especially for large grids. The "block_size" entry sets the number of grid points to be processed concurrently (i.e. in one pass through a time series). Smaller values require less memory but increase the number of passes through the data. +If set less than or equal to 0, it is automatically reset to the number +of grid points, and they are all processed concurrently. .. code-block:: none diff --git a/met/docs/Users_Guide/series-analysis.rst b/met/docs/Users_Guide/series-analysis.rst index bc9095dbf1..640d948012 100644 --- a/met/docs/Users_Guide/series-analysis.rst +++ b/met/docs/Users_Guide/series-analysis.rst @@ -123,8 +123,7 @@ ____________________ block_size = 1024; -Number of grid points to be processed concurrently. Set smaller to use less memory but increase the number of passes through the data. The amount of memory the Series-Analysis tool consumes is determined by the size of the grid, the length of the series, and the block_size entry defined above. The larger this entry is set the faster the tool will run, subject to the amount of memory available on the machine. - +Number of grid points to be processed concurrently. Set smaller to use less memory but increase the number of passes through the data. The amount of memory the Series-Analysis tool consumes is determined by the size of the grid, the length of the series, and the block_size entry defined above. The larger this entry is set the faster the tool will run, subject to the amount of memory available on the machine. If set less than or equal to 0, it is automatically reset to the number of grid points, and they are all processed concurrently. ____________________ diff --git a/met/src/basic/vx_config/config_constants.h b/met/src/basic/vx_config/config_constants.h index 01f03b3840..156c55881b 100644 --- a/met/src/basic/vx_config/config_constants.h +++ b/met/src/basic/vx_config/config_constants.h @@ -300,10 +300,11 @@ struct RegridInfo { // struct ClimoCDFInfo { - bool flag; // Flag to turn on/off climo CDF logic - int n_bin; // Number of climo CDF cdf bins - ThreshArray cdf_ta; // Array of CDF thresholds - bool write_bins; // Flag for writing the individual bins + bool flag; // Flag to turn on/off climo CDF logic + int n_bin; // Number of climo CDF cdf bins + ThreshArray cdf_ta; // Array of CDF thresholds + bool write_bins; // Flag for writing the individual bins + bool direct_prob; // Flag for the direct computation of probs ClimoCDFInfo(); void clear(); @@ -665,6 +666,7 @@ static const char conf_key_climo_cdf[] = "climo_cdf"; static const char conf_key_cdf_bins[] = "cdf_bins"; static const char conf_key_center_bins[] = "center_bins"; static const char conf_key_write_bins[] = "write_bins"; +static const char conf_key_direct_prob[] = "direct_prob"; static const char conf_key_time_interp_method[] = "time_interp_method"; static const char conf_key_day_interval[] = "day_interval"; static const char conf_key_hour_interval[] = "hour_interval"; diff --git a/met/src/basic/vx_config/config_util.cc b/met/src/basic/vx_config/config_util.cc index 1218e2940d..3d77ff1a8f 100644 --- a/met/src/basic/vx_config/config_util.cc +++ b/met/src/basic/vx_config/config_util.cc @@ -1498,6 +1498,7 @@ void ClimoCDFInfo::clear() { n_bin = 0; cdf_ta.clear(); write_bins = false; + direct_prob = false; } /////////////////////////////////////////////////////////////////////////////// @@ -1589,9 +1590,13 @@ ClimoCDFInfo parse_conf_climo_cdf(Dictionary *dict) { center = cdf_dict->lookup_bool(conf_key_center_bins); // Conf: write_bins - // Used by Grid-Stat and Point-Stat but not by Ensemble-Stat + // Used by Grid-Stat and Point-Stat + // Not used by Ensemble-Stat or Series-Analysis info.write_bins = cdf_dict->lookup_bool(conf_key_write_bins, false, false); + // Conf: direct_prob + info.direct_prob = cdf_dict->lookup_bool(conf_key_direct_prob, false, false); + // Check that at least one value is provided if(bins.n() == 0) { mlog << Error << "\nparse_conf_climo_cdf() -> " diff --git a/met/src/libcode/vx_nc_obs/met_point_data.cc b/met/src/libcode/vx_nc_obs/met_point_data.cc index 6cc15a7e81..f223c4acff 100644 --- a/met/src/libcode/vx_nc_obs/met_point_data.cc +++ b/met/src/libcode/vx_nc_obs/met_point_data.cc @@ -59,12 +59,6 @@ void MetPointData::init_from_scratch() { } -//////////////////////////////////////////////////////////////////////// - -//void MetPointData::allocate() { -// obs_data.allocate(); -//} - //////////////////////////////////////////////////////////////////////// void MetPointData::clear() { @@ -178,18 +172,10 @@ MetPointDataPython::MetPointDataPython() { MetPointDataPython::MetPointDataPython(MetPointDataPython &d) { init_from_scratch(); - //obs_data = d.get_point_obs_data(); - //header_data = d.get_header_data(); - obs_data->assign(*d.get_point_obs_data()); + obs_data = new MetPointObsData(); + MetPointObsData *from_obs_data = d.get_point_obs_data(); + if (from_obs_data) obs_data->assign(*from_obs_data); header_data.assign(*d.get_header_data()); -cout << " DEBUG HS MetPointData(MetPointData &d) is called \n"; -cout << " DEBUG HS MetPointData(MetPointData &d) &header_data.lat_array=" << &(header_data.lat_array) << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.lat_array.n()=" << header_data.lat_array.n() << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.lon_array.n()=" << header_data.lon_array.n() << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.elv_array.n()=" << header_data.elv_array.n() << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.typ_idx_array.n()=" << header_data.typ_idx_array.n() << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.sid_idx_array.n()=" << header_data.sid_idx_array.n() << "\n"; -cout << " DEBUG HS MetPointData(MetPointData &d) header_data.vld_idx_array.n()=" << header_data.vld_idx_array.n() << "\n"; } @@ -199,17 +185,6 @@ MetPointDataPython::~MetPointDataPython() { clear(); } -//////////////////////////////////////////////////////////////////////// - -//void MetPointDataPython::init_from_scratch() { -// nobs = 0; -// nhdr = 0; -// qty_length = 0; -// -// use_var_id = false; -// use_arr_vars = false; -//} - //////////////////////////////////////////////////////////////////////// @@ -434,4 +409,3 @@ void MetPointHeader::reset_counters() { } /////////////////////////////////////////////////////////////////////////////// - diff --git a/met/src/libcode/vx_pointdata_python/pointdata_python.cc b/met/src/libcode/vx_pointdata_python/pointdata_python.cc index 846966a6f1..316ec0dfc2 100644 --- a/met/src/libcode/vx_pointdata_python/pointdata_python.cc +++ b/met/src/libcode/vx_pointdata_python/pointdata_python.cc @@ -84,8 +84,6 @@ mlog << Error << "\nMetPythonPointDataFile::operator=(const MetPythonPointDataFi exit ( 1 ); -return ( * this ); - } diff --git a/met/src/libcode/vx_statistics/compute_stats.cc b/met/src/libcode/vx_statistics/compute_stats.cc index 4d6a2046c1..4938565694 100644 --- a/met/src/libcode/vx_statistics/compute_stats.cc +++ b/met/src/libcode/vx_statistics/compute_stats.cc @@ -762,7 +762,7 @@ void compute_pctinfo(const PairDataPoint &pd, bool pstd_flag, // Use input climatological probabilities or derive them if(cmn_flag) { if(cprob_in) climo_prob = *cprob_in; - else climo_prob = derive_climo_prob(pd.cdf_info, + else climo_prob = derive_climo_prob(pd.cdf_info_ptr, pd.cmn_na, pd.csd_na, pct_info.othresh); } diff --git a/met/src/libcode/vx_statistics/ens_stats.cc b/met/src/libcode/vx_statistics/ens_stats.cc index ac9805a928..e69b74f786 100644 --- a/met/src/libcode/vx_statistics/ens_stats.cc +++ b/met/src/libcode/vx_statistics/ens_stats.cc @@ -522,7 +522,7 @@ void RPSInfo::set(const PairDataEnsemble &pd) { climo_pct.zero_out(); // Derive climatological probabilities - if(cmn_flag) climo_prob = derive_climo_prob(pd.cdf_info, + if(cmn_flag) climo_prob = derive_climo_prob(pd.cdf_info_ptr, pd.cmn_na, pd.csd_na, fthresh[i]); diff --git a/met/src/libcode/vx_statistics/pair_base.cc b/met/src/libcode/vx_statistics/pair_base.cc index a8f2f2ff83..5a41f95d1b 100644 --- a/met/src/libcode/vx_statistics/pair_base.cc +++ b/met/src/libcode/vx_statistics/pair_base.cc @@ -64,9 +64,11 @@ void PairBase::clear() { IsPointVx = false; mask_name.clear(); - mask_area_ptr = (MaskPlane *) 0; // Not allocated - mask_sid_ptr = (StringArray *) 0; // Not allocated - mask_llpnt_ptr = (MaskLatLon *) 0; // Not allocated + mask_area_ptr = (MaskPlane *) 0; // Not allocated + mask_sid_ptr = (StringArray *) 0; // Not allocated + mask_llpnt_ptr = (MaskLatLon *) 0; // Not allocated + + cdf_info_ptr = (const ClimoCDFInfo *) 0; // Not allocated msg_typ.clear(); msg_typ_vals.clear(); @@ -75,8 +77,6 @@ void PairBase::clear() { interp_mthd = InterpMthd_None; interp_shape = GridTemplateFactory::GridTemplate_None; - cdf_info.clear(); - o_na.clear(); x_na.clear(); y_na.clear(); @@ -114,9 +114,11 @@ void PairBase::erase() { IsPointVx = false; mask_name.erase(); - mask_area_ptr = (MaskPlane *) 0; // Not allocated - mask_sid_ptr = (StringArray *) 0; // Not allocated - mask_llpnt_ptr = (MaskLatLon *) 0; // Not allocated + mask_area_ptr = (MaskPlane *) 0; // Not allocated + mask_sid_ptr = (StringArray *) 0; // Not allocated + mask_llpnt_ptr = (MaskLatLon *) 0; // Not allocated + + cdf_info_ptr = (const ClimoCDFInfo *) 0; // Not allocated msg_typ.clear(); msg_typ_vals.clear(); @@ -124,8 +126,6 @@ void PairBase::erase() { interp_mthd = InterpMthd_None; interp_shape = GridTemplateFactory::GridTemplate_None; - cdf_info.clear(); - o_na.erase(); x_na.erase(); y_na.erase(); @@ -218,6 +218,15 @@ void PairBase::set_mask_llpnt_ptr(MaskLatLon *llpnt_ptr) { //////////////////////////////////////////////////////////////////////// +void PairBase::set_climo_cdf_info_ptr(const ClimoCDFInfo *info_ptr) { + + cdf_info_ptr = info_ptr; + + return; +} + +//////////////////////////////////////////////////////////////////////// + void PairBase::set_msg_typ(const char *c) { msg_typ = c; @@ -272,15 +281,6 @@ void PairBase::set_interp_shape(GridTemplateFactory::GridTemplates shape) { //////////////////////////////////////////////////////////////////////// -void PairBase::set_climo_cdf_info(const ClimoCDFInfo &info) { - - cdf_info = info; - - return; -} - -//////////////////////////////////////////////////////////////////////// - void PairBase::set_fcst_ut(unixtime ut){ fcst_ut = ut; @@ -1027,22 +1027,25 @@ bool set_climo_flag(const NumArray &f_na, const NumArray &c_na) { //////////////////////////////////////////////////////////////////////// -void derive_climo_vals(const ClimoCDFInfo &cdf_info, +void derive_climo_vals(const ClimoCDFInfo *cdf_info_ptr, double m, double s, NumArray &climo_vals) { // Initialize climo_vals.erase(); - // cdf_info.cdf_ta starts with >=0.0 and ends with >=1.0. + // Check for no work to do + if(!cdf_info_ptr) return; + + // cdf_info_ptr->cdf_ta starts with >=0.0 and ends with >=1.0. // The number of bins is the number of thresholds minus 1. // Check for bad mean value - if(is_bad_data(m) || cdf_info.cdf_ta.n() < 2) { + if(is_bad_data(m) || cdf_info_ptr->cdf_ta.n() < 2) { return; } // Single climo bin - else if(cdf_info.cdf_ta.n() == 2) { + else if(cdf_info_ptr->cdf_ta.n() == 2) { climo_vals.add(m); } // Check for bad standard deviation value @@ -1053,9 +1056,9 @@ void derive_climo_vals(const ClimoCDFInfo &cdf_info, else { // Skip the first and last thresholds - for(int i=1; icdf_ta.n()-1; i++) { climo_vals.add( - normal_cdf_inv(cdf_info.cdf_ta[i].get_value(), m, s)); + normal_cdf_inv(cdf_info_ptr->cdf_ta[i].get_value(), m, s)); } } @@ -1064,7 +1067,7 @@ void derive_climo_vals(const ClimoCDFInfo &cdf_info, //////////////////////////////////////////////////////////////////////// -NumArray derive_climo_prob(const ClimoCDFInfo &cdf_info, +NumArray derive_climo_prob(const ClimoCDFInfo *cdf_info_ptr, const NumArray &mn_na, const NumArray &sd_na, const SingleThresh &othresh) { int i, n_mn, n_sd; @@ -1090,21 +1093,74 @@ NumArray derive_climo_prob(const ClimoCDFInfo &cdf_info, // threshold else if(n_mn > 0 && n_sd > 0) { - // The first (>=0.0) and last (>=1.0) climo thresholds are omitted - mlog << Debug(4) - << "Deriving climatological probabilities for threshold " - << othresh.get_str() << " by sampling " << cdf_info.cdf_ta.n()-2 - << " values from the normal climatological distribution.\n"; - - // Compute the probability by sampling from the climo distribution - // and deriving the event frequency - for(i=0; idirect_prob) { + + mlog << Debug(4) + << "Deriving climatological probabilities for threshold " + << othresh.get_str() << " directly from the normal " + << "climatological distribution.\n"; + + // Directly derive the climatological probability + for(i=0; icdf_ta.n() == 0) { + mlog << Error << "\nderive_climo_prob() -> " + << "No climatological probability thresholds defined!\n\n"; + exit(1); + } + + // The first (>=0.0) and last (>=1.0) climo thresholds are omitted + mlog << Debug(4) + << "Deriving climatological probabilities for threshold " + << othresh.get_str() << " by sampling " + << cdf_info_ptr->cdf_ta.n()-2 + << " values from the normal climatological distribution.\n"; + + // Compute the probability by sampling from the climo distribution + // and deriving the event frequency + for(i=0; icdf_ta.n() == 2) { mlog << Debug(3) << "Computing ensemble statistics relative to the " << "climatological mean.\n"; } - else if(cmn_flag && csd_flag && cdf_info.cdf_ta.n() > 2) { + else if(cmn_flag && csd_flag && cdf_info_ptr && cdf_info_ptr->cdf_ta.n() > 2) { mlog << Debug(3) << "Computing ensemble statistics relative to a " - << cdf_info.cdf_ta.n() - 2 + << cdf_info_ptr->cdf_ta.n() - 2 << "-member climatological ensemble.\n"; } else { @@ -468,7 +468,7 @@ void PairDataEnsemble::compute_pair_vals(const gsl_rng *rng_ptr) { } // Derive ensemble from climo mean and standard deviation - derive_climo_vals(cdf_info, cmn_na[i], csd_na[i], cur_clm); + derive_climo_vals(cdf_info_ptr, cmn_na[i], csd_na[i], cur_clm); // Store empirical CRPS stats crps_emp_na.add(compute_crps_emp(o_na[i], cur_ens)); @@ -785,7 +785,7 @@ PairDataEnsemble PairDataEnsemble::subset_pairs_obs_thresh(const SingleThresh &o pd.ssvar_bin_size = ssvar_bin_size; pd.obs_error_entry = obs_error_entry; pd.obs_error_flag = obs_error_flag; - pd.cdf_info = cdf_info; + pd.cdf_info_ptr = cdf_info_ptr; bool cmn_flag = set_climo_flag(o_na, cmn_na); bool csd_flag = set_climo_flag(o_na, csd_na); @@ -1306,12 +1306,12 @@ void VxPairDataEnsemble::set_ens_size(int n) { //////////////////////////////////////////////////////////////////////// -void VxPairDataEnsemble::set_climo_cdf_info(const ClimoCDFInfo &info) { +void VxPairDataEnsemble::set_climo_cdf_info_ptr(const ClimoCDFInfo *info) { for(int i=0; i " + << "Ensemble post-processing should be moved to the " + << "Gen-Ens-Prod tool, which replaces the logic of the " + << "\"ens\" dictionary. Support for the \"ens\" dictionary " + << "will be deprecated and removed." << "\n\n"; + } + // Parse the ensemble field information for(i=0,max_n_thresh=0; imsg_typ_sfc); diff --git a/met/src/tools/core/grid_stat/grid_stat.cc b/met/src/tools/core/grid_stat/grid_stat.cc index e7055ed596..8549cbf2e8 100644 --- a/met/src/tools/core/grid_stat/grid_stat.cc +++ b/met/src/tools/core/grid_stat/grid_stat.cc @@ -1847,7 +1847,7 @@ void get_mask_points(const GridStatVxOpt &vx_opt, pd.erase(); // Store the climo CDF info - pd.set_climo_cdf_info(vx_opt.cdf_info); + pd.set_climo_cdf_info_ptr(&vx_opt.cdf_info); // Apply the mask the data fields or fill with default values apply_mask(*fcst_ptr, mask_mp, pd.f_na); diff --git a/met/src/tools/core/point_stat/point_stat.cc b/met/src/tools/core/point_stat/point_stat.cc index 48ffd21c6e..11a88e0391 100644 --- a/met/src/tools/core/point_stat/point_stat.cc +++ b/met/src/tools/core/point_stat/point_stat.cc @@ -1736,7 +1736,7 @@ void do_hira_ens(int i_vx, const PairDataPoint *pd_ptr) { hira_pd.clear(); hira_pd.extend(pd_ptr->n_obs); hira_pd.set_ens_size(gt->size()); - hira_pd.set_climo_cdf_info(conf_info.vx_opt[i_vx].cdf_info); + hira_pd.set_climo_cdf_info_ptr(&conf_info.vx_opt[i_vx].cdf_info); f_ens.extend(gt->size()); // Process each observation point diff --git a/met/src/tools/core/point_stat/point_stat_conf_info.cc b/met/src/tools/core/point_stat/point_stat_conf_info.cc index 6117a0f7fc..8b90544b44 100644 --- a/met/src/tools/core/point_stat/point_stat_conf_info.cc +++ b/met/src/tools/core/point_stat/point_stat_conf_info.cc @@ -972,7 +972,7 @@ void PointStatVxOpt::set_vx_pd(PointStatConfInfo *conf_info) { vx_pd.set_mpr_thresh(mpr_sa, mpr_ta); // Store the climo CDF info - vx_pd.set_climo_cdf_info(cdf_info); + vx_pd.set_climo_cdf_info_ptr(&cdf_info); // Store the surface message type group cs = surface_msg_typ_group_str; diff --git a/met/src/tools/core/series_analysis/series_analysis.cc b/met/src/tools/core/series_analysis/series_analysis.cc index b89eeff0bb..b7f9aa01b9 100644 --- a/met/src/tools/core/series_analysis/series_analysis.cc +++ b/met/src/tools/core/series_analysis/series_analysis.cc @@ -30,6 +30,7 @@ // 010 12/11/19 Halley Gotway Reorganize logic to support the use // of python embedding. // 011 05/28/21 Halley Gotway Add MCTS HSS_EC output. +// 012 01/20/22 Halley Gotway MET #2003 Add PSTD BRIERCL output. // //////////////////////////////////////////////////////////////////////// @@ -339,6 +340,9 @@ void process_grid(const Grid &fcst_grid, const Grid &obs_grid) { // Process masking regions conf_info.process_masks(grid); + // Set the block size, if needed + if(is_bad_data(conf_info.block_size)) conf_info.block_size = nxy; + // Compute the number of reads required n_reads = nint(ceil((double) nxy / conf_info.block_size)); @@ -666,20 +670,10 @@ void process_scores() { // Number of points skipped due to valid data threshold int n_skip_zero = 0; int n_skip_pos = 0; - - // Allocate space to store the pairs for each grid point - pd_ptr = new PairDataPoint [conf_info.block_size]; - for(i=0; imagic_str() << ".\n"; @@ -1845,7 +1855,11 @@ void store_stat_pstd(int n, const ConcatString &col, else if(c == "BRIER") { v = pct_info.brier.v; } else if(c == "BRIER_NCL") { v = pct_info.brier.v_ncl[i]; } else if(c == "BRIER_NCU") { v = pct_info.brier.v_ncu[i]; } + else if(c == "BRIERCL") { v = pct_info.briercl.v; } + else if(c == "BRIERCL_NCL") { v = pct_info.briercl.v_ncl[i]; } + else if(c == "BRIERCL_NCU") { v = pct_info.briercl.v_ncu[i]; } else if(c == "BSS") { v = pct_info.bss; } + else if(c == "BSS_SMPL") { v = pct_info.bss_smpl; } else { mlog << Error << "\nstore_stat_pstd() -> " << "unsupported column name requested \"" << c diff --git a/met/src/tools/core/series_analysis/series_analysis_conf_info.cc b/met/src/tools/core/series_analysis/series_analysis_conf_info.cc index 0920787d0f..5fa6608650 100644 --- a/met/src/tools/core/series_analysis/series_analysis_conf_info.cc +++ b/met/src/tools/core/series_analysis/series_analysis_conf_info.cc @@ -68,6 +68,7 @@ void SeriesAnalysisConfInfo::clear() { fcnt_ta.clear(); ocnt_ta.clear(); cnt_logic = SetLogic_None; + cdf_info.clear(); ci_alpha.clear(); boot_interval = BootIntervalType_None; boot_rep_prop = bad_data_double; @@ -340,11 +341,11 @@ void SeriesAnalysisConfInfo::process_config(GrdFileType ftype, // Conf: block_size block_size = conf.lookup_int(conf_key_block_size); + // Reset invalid block_sizes to bad data so that they if(block_size <= 0.0) { - mlog << Error << "\nSeriesAnalysisConfInfo::process_config() -> " - << "The \"" << conf_key_block_size << "\" parameter (" - << block_size << ") must be greater than 0.\n\n"; - exit(1); + block_size = bad_data_int; + mlog << Debug(3) << "Automatically setting the \"" + << conf_key_block_size << "\" parameter to the size of the grid.\n"; } // Conf: vld_thresh @@ -414,6 +415,9 @@ void SeriesAnalysisConfInfo::process_config(GrdFileType ftype, } // end if continuous + // Conf: climo_cdf + cdf_info = parse_conf_climo_cdf(&conf); + // Conf: ci_alpha ci_alpha = parse_conf_ci_alpha(&conf); diff --git a/met/src/tools/core/series_analysis/series_analysis_conf_info.h b/met/src/tools/core/series_analysis/series_analysis_conf_info.h index 339de45ef4..f0cd829eed 100644 --- a/met/src/tools/core/series_analysis/series_analysis_conf_info.h +++ b/met/src/tools/core/series_analysis/series_analysis_conf_info.h @@ -57,6 +57,8 @@ class SeriesAnalysisConfInfo { ThreshArray ocnt_ta; // Continuous obs thresholds SetLogic cnt_logic; // Continuous threshold field logic + ClimoCDFInfo cdf_info; // Climo CDF info + NumArray ci_alpha; // Alpha value for confidence intervals BootIntervalType boot_interval; // Bootstrap CI type double boot_rep_prop; // Bootstrap replicate proportion diff --git a/met/src/tools/core/stat_analysis/aggr_stat_line.cc b/met/src/tools/core/stat_analysis/aggr_stat_line.cc index 3e66de254e..edee31714d 100644 --- a/met/src/tools/core/stat_analysis/aggr_stat_line.cc +++ b/met/src/tools/core/stat_analysis/aggr_stat_line.cc @@ -2204,9 +2204,6 @@ void aggr_mpr_lines(LineDataFile &f, STATAnalysisJob &job, // if(m.count(key) == 0) { - bool center = false; - aggr.pd.cdf_info.set_cdf_ta(nint(1.0/job.out_bin_size), center); - aggr.pd.f_na.clear(); aggr.pd.o_na.clear(); aggr.pd.cmn_na.clear(); @@ -2226,8 +2223,14 @@ void aggr_mpr_lines(LineDataFile &f, STATAnalysisJob &job, aggr.obs_var = cur.obs_var; aggr.hdr.clear(); + bool center = false; + aggr.cdf_info.set_cdf_ta(nint(1.0/job.out_bin_size), center); + m[key] = aggr; + // Set the pointer after storing in the map + m[key].pd.set_climo_cdf_info_ptr(&m[key].cdf_info); + mlog << Debug(3) << "[Case " << m.size() << "] Added new case for key \"" << key << "\".\n"; @@ -3084,9 +3087,9 @@ void aggr_orank_lines(LineDataFile &f, STATAnalysisJob &job, // Add a new map entry, if necessary // if(m.count(key) == 0) { + aggr.clear(); - bool center = false; - aggr.ens_pd.cdf_info.set_cdf_ta(nint(1.0/job.out_bin_size), center); + aggr.ens_pd.obs_error_flag = !is_bad_data(cur.ens_mean_oerr); aggr.ens_pd.set_ens_size(cur.n_ens); aggr.ens_pd.extend(cur.total); @@ -3095,7 +3098,15 @@ void aggr_orank_lines(LineDataFile &f, STATAnalysisJob &job, n_bin = ceil(1.0/aggr.ens_pd.phist_bin_size); for(i=0; i= debug_level) { @@ -1995,11 +1996,16 @@ void process_pbfile(int i_pb) { } if(i_msg <= 0) { - mlog << Warning << "\n" << method_name - << ((n_derived_obs > 0) ? "Saved the derived variables only. " : " ") - << "No " << (is_prepbufr ? "PrepBufr" : "Bufr") - << " messages retained from file: " - << pbfile[i_pb] << "\n\n"; + if (n_derived_obs > 0) + mlog << Debug(3) << method_name + << "Saved the derived variables only. No " << (is_prepbufr ? "PrepBufr" : "Bufr") + << " messages retained from file: " + << pbfile[i_pb] << "\n"; + else + mlog << Warning << "\n" << method_name + << "No " << (is_prepbufr ? "PrepBufr" : "Bufr") + << " messages retained from file: " + << pbfile[i_pb] << "\n\n"; } return; diff --git a/test/config/GridStatConfig_climo_WMO b/test/config/GridStatConfig_climo_WMO index e23f74a2be..f16d03b47e 100644 --- a/test/config/GridStatConfig_climo_WMO +++ b/test/config/GridStatConfig_climo_WMO @@ -130,6 +130,7 @@ climo_cdf = { cdf_bins = 3; center_bins = TRUE; write_bins = FALSE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/GridStatConfig_climo_prob b/test/config/GridStatConfig_climo_prob index a97291af88..085a8135d9 100644 --- a/test/config/GridStatConfig_climo_prob +++ b/test/config/GridStatConfig_climo_prob @@ -140,6 +140,7 @@ climo_cdf = { cdf_bins = [ 0.0, 0.4, 0.6, 1.0 ]; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/GridStatConfig_mpr_thresh b/test/config/GridStatConfig_mpr_thresh index 268e24cbc6..b2930f027b 100644 --- a/test/config/GridStatConfig_mpr_thresh +++ b/test/config/GridStatConfig_mpr_thresh @@ -128,6 +128,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_airnow b/test/config/PointStatConfig_airnow index 80df21807a..5c424a3cb6 100644 --- a/test/config/PointStatConfig_airnow +++ b/test/config/PointStatConfig_airnow @@ -126,6 +126,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_climo b/test/config/PointStatConfig_climo index 041642d1a6..207d251ff5 100644 --- a/test/config/PointStatConfig_climo +++ b/test/config/PointStatConfig_climo @@ -173,6 +173,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_climo_WMO b/test/config/PointStatConfig_climo_WMO index 599797cde3..c801f581ac 100644 --- a/test/config/PointStatConfig_climo_WMO +++ b/test/config/PointStatConfig_climo_WMO @@ -121,6 +121,7 @@ climo_cdf = { cdf_bins = 3; center_bins = TRUE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_climo_prob b/test/config/PointStatConfig_climo_prob index e57f5e003f..ca4cadcbc9 100644 --- a/test/config/PointStatConfig_climo_prob +++ b/test/config/PointStatConfig_climo_prob @@ -123,6 +123,7 @@ climo_cdf = { cdf_bins = 11; center_bins = TRUE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_mpr_thresh b/test/config/PointStatConfig_mpr_thresh index 6da3ee7c63..f1559f1d3f 100644 --- a/test/config/PointStatConfig_mpr_thresh +++ b/test/config/PointStatConfig_mpr_thresh @@ -115,6 +115,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/PointStatConfig_python b/test/config/PointStatConfig_python index 2e97f43f29..8d70867143 100644 --- a/test/config/PointStatConfig_python +++ b/test/config/PointStatConfig_python @@ -112,6 +112,7 @@ climo_cdf = { cdf_bins = 1; center_bins = FALSE; write_bins = TRUE; + direct_prob = FALSE; } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/SeriesAnalysisConfig b/test/config/SeriesAnalysisConfig index 8c5e965230..9d28ce3925 100644 --- a/test/config/SeriesAnalysisConfig +++ b/test/config/SeriesAnalysisConfig @@ -53,6 +53,39 @@ obs = { //////////////////////////////////////////////////////////////////////////////// +// +// Climatology data +// +climo_mean = { + + file_name = []; + field = []; + + regrid = { + method = NEAREST; + width = 1; + vld_thresh = 0.5; + shape = SQUARE; + } + + time_interp_method = DW_MEAN; + day_interval = 31; + hour_interval = 6; +} + +climo_stdev = climo_mean; +climo_stdev = { + file_name = []; +} + +climo_cdf = { + cdf_bins = 1; + center_bins = FALSE; + direct_prob = FALSE; +} + +//////////////////////////////////////////////////////////////////////////////// + // // Confidence interval settings // @@ -77,10 +110,11 @@ mask = { } // -// Number of grid points to be processed concurrently. Set smaller to use -// less memory but increase the number of passes through the data. +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. // -block_size = 10000; +block_size = 169*154; // // Ratio of valid matched pairs to compute statistics for a grid point diff --git a/test/config/SeriesAnalysisConfig_climo b/test/config/SeriesAnalysisConfig_climo index a1ceb41577..78d9e7449f 100644 --- a/test/config/SeriesAnalysisConfig_climo +++ b/test/config/SeriesAnalysisConfig_climo @@ -82,6 +82,12 @@ climo_stdev = { file_name = [ ${CLIMO_STDEV_FILE_LIST} ]; } +climo_cdf = { + cdf_bins = 1; + center_bins = FALSE; + direct_prob = FALSE; +} + //////////////////////////////////////////////////////////////////////////////// // @@ -108,10 +114,11 @@ mask = { } // -// Number of grid points to be processed concurrently. Set smaller to use -// less memory but increase the number of passes through the data. +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. // -block_size = 150000; +block_size = 0; // // Ratio of valid matched pairs to compute statistics for a grid point diff --git a/test/config/SeriesAnalysisConfig_climo_prob b/test/config/SeriesAnalysisConfig_climo_prob new file mode 100644 index 0000000000..ee023bf6c4 --- /dev/null +++ b/test/config/SeriesAnalysisConfig_climo_prob @@ -0,0 +1,164 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Series-Analysis configuration file. +// +// For additional information, please see the MET User's Guide. +// +//////////////////////////////////////////////////////////////////////////////// + +// +// Output model name to be written +// +model = "SREF"; + +// +// Output description to be written +// +desc = "NA"; + +// +// Output observation type to be written +// +obtype = "GFSANL"; + +//////////////////////////////////////////////////////////////////////////////// + +// +// Verification grid +// +regrid = { + to_grid = FCST; + method = BILIN; + width = 2; + vld_thresh = 0.5; + shape = SQUARE; +} + +//////////////////////////////////////////////////////////////////////////////// + +censor_thresh = []; +censor_val = []; +cat_thresh = []; +cnt_thresh = [ NA ]; +cnt_logic = UNION; + +// +// Forecast and observation fields to be verified +// +fcst = { + cat_thresh = ==0.1; + + field = [ + { + name = "PROB"; level = "Z2"; + prob = { name = "TMP"; thresh_hi = 273.0; }; + } + ]; +} +obs = { + cat_thresh = <273.0; + + field = [ + { + name = "TMP"; level = "Z2"; + } + ]; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Climatology data +// +climo_mean = obs; +climo_mean = { + + file_name = [ ${CLIMO_MEAN_FILE_LIST} ]; + + regrid = { + method = BILIN; + width = 2; + vld_thresh = 0.5; + } + + time_interp_method = DW_MEAN; + day_interval = ${DAY_INTERVAL}; + hour_interval = ${HOUR_INTERVAL}; +} + +climo_stdev = climo_mean; +climo_stdev = { + file_name = [ ${CLIMO_STDEV_FILE_LIST} ]; +} + +climo_cdf = { + cdf_bins = 1; + center_bins = FALSE; + direct_prob = TRUE; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Confidence interval settings +// +ci_alpha = [ 0.05 ]; + +boot = { + interval = PCTILE; + rep_prop = 1.0; + n_rep = 0; + rng = "mt19937"; + seed = "1"; +} + +//////////////////////////////////////////////////////////////////////////////// + +// +// Verification masking regions +// +mask = { + grid = ""; + poly = ""; +} + +// +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. +// +block_size = -9999; + +// +// Ratio of valid matched pairs to compute statistics for a grid point +// +vld_thresh = 0.5; + +//////////////////////////////////////////////////////////////////////////////// + +// +// Statistical output types +// +output_stats = { + fho = [ ]; + ctc = [ ]; + cts = [ ]; + mctc = [ ]; + mcts = [ ]; + cnt = [ ]; + sl1l2 = [ ]; + sal1l2 = [ ]; + pct = [ ]; + pstd = [ "TOTAL", "ROC_AUC", "BRIER", "BRIERCL", "BSS", "BSS_SMPL" ]; + pjc = [ ]; + prc = [ ]; +} + +//////////////////////////////////////////////////////////////////////////////// + +hss_ec_value = NA; +rank_corr_flag = FALSE; +tmp_dir = "/tmp"; +version = "V10.1.0"; + +//////////////////////////////////////////////////////////////////////////////// diff --git a/test/config/SeriesAnalysisConfig_conditional b/test/config/SeriesAnalysisConfig_conditional index a4b1447a1c..b4becd6656 100644 --- a/test/config/SeriesAnalysisConfig_conditional +++ b/test/config/SeriesAnalysisConfig_conditional @@ -77,8 +77,9 @@ mask = { } // -// Number of grid points to be processed concurrently. Set smaller to use -// less memory but increase the number of passes through the data. +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. // block_size = 10000; diff --git a/test/config/SeriesAnalysisConfig_python b/test/config/SeriesAnalysisConfig_python index 945a1a56b6..a33b237ab3 100644 --- a/test/config/SeriesAnalysisConfig_python +++ b/test/config/SeriesAnalysisConfig_python @@ -82,6 +82,12 @@ climo_stdev = { file_name = []; } +climo_cdf = { + cdf_bins = 1; + center_bins = FALSE; + direct_prob = FALSE; +} + //////////////////////////////////////////////////////////////////////////////// // @@ -108,8 +114,9 @@ mask = { } // -// Number of grid points to be processed concurrently. Set smaller to use -// less memory but increase the number of passes through the data. +// Number of grid points to be processed concurrently. Set smaller to use less +// memory but increase the number of passes through the data. If set <= 0, all +// grid points are processed concurrently. // block_size = 24000; diff --git a/test/xml/unit_climatology_1.0deg.xml b/test/xml/unit_climatology_1.0deg.xml index 8fad5f3be1..6f458f13c8 100644 --- a/test/xml/unit_climatology_1.0deg.xml +++ b/test/xml/unit_climatology_1.0deg.xml @@ -190,6 +190,55 @@ + + echo "&DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F003.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F009.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F015.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F021.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F027.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F033.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F039.grib2 \ + &DATA_DIR_MODEL;/grib2/sref_pr/sref_prob_2012040821_F045.grib2" \ + > &OUTPUT_DIR;/climatology_1.0deg/input_fcst_file_list; \ + echo "&DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120409_0000_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120409_0600_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120409_1200_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120409_1800_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120410_0000_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120410_0600_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120410_1200_000.grb2 \ + &DATA_DIR_MODEL;/grib2/gfsanl/gfsanl_4_20120410_1800_000.grb2" \ + > &OUTPUT_DIR;/climatology_1.0deg/input_obs_file_list; \ + &MET_BIN;/series_analysis + + DAY_INTERVAL 1 + HOUR_INTERVAL 6 + CLIMO_MEAN_FILE_LIST + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cmean_1d.19590409", + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cmean_1d.19590410", + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cmean_1d.19590411" + + + CLIMO_STDEV_FILE_LIST + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cstdv_1d.19590409", + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cstdv_1d.19590410", + "&DATA_DIR_CLIMO;/NCEP_NCAR_40YR_1.0deg/cstdv_1d.19590411" + + + + \ + -fcst &OUTPUT_DIR;/climatology_1.0deg/input_fcst_file_list \ + -obs &OUTPUT_DIR;/climatology_1.0deg/input_obs_file_list \ + -paired \ + -out &OUTPUT_DIR;/climatology_1.0deg/series_analysis_PROB_CLIMO_1.0DEG.nc \ + -config &CONFIG_DIR;/SeriesAnalysisConfig_climo_prob \ + -v 2 + + + &OUTPUT_DIR;/climatology_1.0deg/series_analysis_PROB_CLIMO_1.0DEG.nc + + + echo "&DATA_DIR_MODEL;/grib1/arw-fer-gep1/arw-fer-gep1_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-fer-gep5/arw-fer-gep5_2012040912_F024.grib \