Skip to content

Commit

Permalink
Update develop-ref after #1719 (#1727)
Browse files Browse the repository at this point in the history
* Start on write netcdf pickle alternative.

* Write dataplane array.

* Start on read of netcdf as pickle alternative.

* Create attribute variables.

* Use global attributes for met_info attrs.

* Add grid structure.

* Read metadata back into met_info.attrs.

* Convert grid.nx and grid.ny to int.

* Rename _name key to name.

* Removed pickle write.

* Fixed write_pickle_dataplane to work for both numpy and xarray.

* Use items() to iterate of key, value attrs.

* Write temporary text file.

* Renamed scripts.

* Changed script names in Makefile.am.

* Replaced pickle with tmp_nc.

* Fixed wrapper script names.

* Test for attrs in met_in.met_data.

* Initial version of read_tmp_point module.

* Added read_tmp_point.py to install list.

* Start on Python3_Script::read_tmp_point.

* Write MPR tmp ascii file.

* Renamed to read_tmp_ascii to use for point point and MPR.

* Renamed to read_tmp_ascii to use for point point and MPR.

* Define Python3_Script::import_read_tmp_ascii_py.

* Call Python3_Script::import_read_tmp_ascii_py.

* Append MET_BASE/wrappers to sys.path.

* Finished implementation of Python3_Script::import_read_tmp_ascii_py.

* Call Python3_Script::read_tmp_ascii in python_handler.

* Revised python3_script::read_tmp_ascii with call to run, PyRun_String.

* Return PyObject* from Python3_Script::run.

* Restored call to run_python_string for now.

* Per #1429, enhance error message from DataLine::get_item(). (#1682)

* Feature 1429 tc_log second try (#1686)

* Per #1429, enhance error message from DataLine::get_item().

* Per #1429, I realize that the line number actually is readily available in the DataLine class... so include it in the error message.

* Feature 1588 ps_log (#1687)

* Per #1588, updated pair_data_point.h/.cc to add detailed Debug(4) log messages, as specified in the GitHub issue. Do still need to test each of these cases to confirm that the log messages look good.

* Per #1588, switch very detailed interpolation details from debug level 4 to 5.

* Per #1588, remove the Debug(4) log message about duplicate obs since it's been moved up to a higher level.

* Per #1588, add/update detailed log messages when processing point observations for bad data, off the grid, bad topo, big topo diffs, bad fcst value, and duplicate obs.

* #1454 Disabled plot_data_plane_CESM_SSMI_microwave and plot_data_plane_CESM_sea_ice_nc becaues of not evenly spaced

* #1454 Moved NC attribute name to nc_utils.h

* #1454 Corrected sanity checking for lat/lon projection based on the percentage of the delta instead of fixed tolerance

* #1454 Corrected sanity checking for lat/lon projection based on the percentage of the delta instead of fixed tolerance

* #1454 Corrected data.delta_lon

* #1454 Change bact to use diff instead of absolute value of diff

* 454 Deleted instea dof commenting out

* 454 Deleted instea dof commenting out

* Feature 1684 bss and 1685 single reference model (#1689)

* Per #1684, move an instance of the ClimoCDFInfo class into PairBase. Also define derive_climo_vals() and derive_climo_prob() utility functions.

* Add to VxPairDataPoint and VxPairDataEnsemble functions to set the ClimoCDFInfo class.

* Per #1684, update ensemble_stat and point_stat to set the ClimoCDFInfo object based on the contents of the config file.

* Per #1684, update the vx_statistics library and stat_analysis to make calls to the new derive_climo_vals() and derive_climo_prob() functions.

* Per #1684, since cdf_info is a member of PairBase class, need to handle it in the PairDataPoint and PairDataEnsemble assignment and subsetting logic.

* Per #1684, during development, I ran across and then updated this log message.

* Per #1684, working on log messages and figured that the regridding climo data should be moved from Debug(1) to at least Debug(2).

* Per #1684 and #1685, update the logic for the derive_climo_vals() utility function. If only a single climo bin is requested, just return the climo mean. Otherwise, sample the requested number of values.

* Per #1684, just fixing the format of this log message.

* Per #1684, add a STATLine::get_offset() member function.

* Per #1684, update parse_orank_line() logic. Rather than calling NumArray::clear() call NumArray::erase() to preserve allocated memory. Also, instead of parsing ensemble member values by column name, parse them by offset number.

* Per #1684, call EnsemblePairData::extend() when parsing ORANK data to allocate one block of memory instead of bunches of litte ones.

* Per #1684 and #1685, add another call to Ensemble-Stat to test computing the CRPSCL_EMP from a single climo mean instead of using the full climo distribution.

* Per #1684 and #1685, update ensemble-stat docs about computing CRPSS_EMP relative to a single reference model.

* Per #1684, need to update Grid-Stat to store the climo cdf info in the PairDataPoint objects.

* Per #1684, remove debug print statements.

* Per #1684, need to set cdf_info when aggregating MPR lines in Stat-Analysis.

* Per #1684 and #1685, update PairDataEnsemble::compute_pair_vals() to print a log message indicating the climo data being used as reference:

For a climo distribution defined by mean and stdev:
DEBUG 3: Computing ensemble statistics relative to a 9-member climatological ensemble.

For a single deterministic reference:
DEBUG 3: Computing ensemble statistics relative to the climatological mean.

* Per #1691, add met-10.0.0-beta4 release notes. (#1692)

* Updated Python documentation

* Per #1694, add VarInfo::magic_str_attr() to construct a field summary string from the name_attr() and level_attr() functions.

* Per #1694, fixing 2 issues here. There was a bug in the computation of the max value. Had a less-than sign that should have been greater-than. Also, switch from tracking data by it's magic_str() to simply using VAR_i and VAR_j strings. We *could* have just used the i, j integers directly, but constructing the ij joint histogram integer could have been tricky since we start numbering with 0 instead of 1. i=0, j=1 would result in 01 which is the same as integer of 1. If we do want to switch to integers, we just need to make them 1-based and add +1 all over the place.

* Per #1694, just switching to consistent variable name.

* Just consistent spacing.

* Added python3_script::import_read_tmp_ascii.

* Restored read_tmp_ascii call.

* Added lookup into ascii module.

* Adding files for ReadTheDocs

* Adding .yaml file for ReadTheDocs

* Updated path to requirements.txt file

* Updated path to conf.py file

* Removing ReadTheDocs files and working in separate branch

* Return PyObject* from read_tmp_ascii.

* Put point_data in global namespace.

* Remove temporary ascii file.

* Added tmp_ascii_path.

* Removed read_obs_from_pickle.

* Trying different options for formats (#1702)

* Per #1706, add bugfix to the develop branch. Also add a new job to unit_stat_analysis.xml to test out the aggregation of the ECNT line type. This will add new unit test output and cause the NB to fail. (#1708)

* Feature 1471 python_grid (#1704)

* Per #1471, defined a parse_grid_string() function in the vx_statistics library and then updated vx_data2d_python to call that function. However, this creates a circular dependency because vx_data2d_python now depends on vx_statistics.

* Per #1471, because of the change in dependencies, I had to modify many, many Makefile.am files to link to the -lvx_statistics after -lvx_data2d_python. This is not great, but I didn't find a better solution.

* Per #1471, add a sanity check to make sure the grid and data dimensions actually match.

* Per #1471, add 3 new unit tests to demonstrate setting the python grid as a named grid, grid specification string, or a gridded data file.

* Per #1471, document python grid changes in appendix F.

* Per #1471, just spacing.

* Per #1471, lots of Makefile.am changes to get this code to compile on kiowa. Worringly, it compiled and linked fine on my Mac laptop but not on kiowa. Must be some large differences in the linker logic.

Co-authored-by: John Halley Gotway <[email protected]>

* Committing a fix for unit_python.xml directly to the develop branch. We referenced  in a place where it's not defined.

* Add *.dSYM to the .gitignore files in the src and internal_tests directories.

* Replaced tmp netcdf _name attribute with name_str.

* Append user script path to system path.

* Revert "Feature 1319 no pickle" (#1717)

* Fixed typos, added content, and modified release date format

* #1715 Initial release

* #1715 Do not combined if there are no overlapping beteewn TQZ and UV records

* #1715 Added pb2nc_compute_pbl_cape

* #1715 Added pb2nc_compute_pbl_cape

* #1715 Reduced obs_bufr_var. Removed pb_report_type

* #1715 Added a blank line for Error/Warning

* Per #1725, return good status from TrackInfoArray::add() when using an ATCF line to create a new track. (#1726)

* Per #1705, update the threshold node heirarchy by adding a climo_prob() function to determine the climatological probability of a CDP-type threshold. Also update derive_climo_prob() in pair_base.cc to call the new climo_prob() function. (#1724)

* Bugfix 1716 develop perc_thresh (#1722)

* Per #1716, committing changes from Randy Bullock to support floating point percentile thresholds.

* Per #1716, no code changes, just consistent formatting.

* Per #1716, change SFP50 example to SFP33.3 to show an example of using floating point percentile values.

Co-authored-by: David Fillmore <[email protected]>
Co-authored-by: Howard Soh <[email protected]>
Co-authored-by: hsoh-u <[email protected]>
Co-authored-by: Julie.Prestopnik <[email protected]>
Co-authored-by: David Fillmore <[email protected]>
Co-authored-by: John Halley Gotway <[email protected]>
Co-authored-by: MET Tools Test Account <[email protected]>
  • Loading branch information
8 people authored Mar 19, 2021
1 parent cd837ff commit 11cb05d
Show file tree
Hide file tree
Showing 11 changed files with 544 additions and 112 deletions.
2 changes: 1 addition & 1 deletion met/docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The configuration file language supports the following data types:
* The following percentile threshold types are supported:

* "SFP" for a percentile of the sample forecast values.
e.g. ">SFP50" means greater than the 50-th forecast percentile.
e.g. ">SFP33.3" means greater than the 33.3-rd forecast percentile.

* "SOP" for a percentile of the sample observation values.
e.g. ">SOP75" means greater than the 75-th observation percentile.
Expand Down
2 changes: 1 addition & 1 deletion met/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
verinfo = version
release = f'{version}'
release_year = '2021'
release_date = f'{release_year}0302'
release_date = f'{release_year}-03-31'
copyright = f'{release_year}, {author}'

# -- General configuration ---------------------------------------------------
Expand Down
85 changes: 82 additions & 3 deletions met/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,95 @@
=====================
MET version |version|
=====================
Developed by the `Developmental Testbed Center <https://dtcenter.org/>`_, Boulder, CO
Developed by the `Developmental Testbed Center <https://dtcenter.org/>`_,
Boulder, CO

.. image:: _static/METplus_banner_photo_web.png

History
-------
The Model Evaluation Tools (MET) were developed by the Developmental Testbed Center (DTC) and released in January 2008. The goal of the tools was to provide the community with a platform independent and extensible framework for reproducible verification. The DTC partners, including NCAR, NOAA, and the USAF, decided to start by replicating the NOAA EMC (see list of acronyms below) Mesoscale Branch verification package, called VSDB. In the first release, MET included several pre-processing, statistical, and analysis tools to provided the primary functionality as the EMC VSDB system, and also included a spatial verification package called MODE.
The Model Evaluation Tools (MET) were developed by the Developmental Testbed
Center (DTC) and released in January 2008. The goal of the tools was to
provide the community with a platform-independent and extensible framework
for reproducible verification.
The DTC partners, including NCAR, NOAA, and the USAF, decided to start by
replicating the NOAA EMC (see list of acronyms below) Mesoscale Branch
verification package, called VSDB.
In the first release, MET included several pre-processing, statistical,
and analysis tools to provide the same primary functionality as the EMC VSDB
system, and also included a spatial verification package called MODE.

Over the years, MET and VSDB packages grew in complexity. Verification capability at other NOAA laboratories, such as ESRL, were also under heavy development. An effort to unify verification capability was first started under the HIWPP project and led by NOAA ESRL. In 2015, the NGGPS Program Office started working groups to focus on several aspects of the next gen system, including the Verification and Validation Working Group. This group made the recommendation to use MET as the foundation for a unified verification capability. In 2016, NCAR and GSD leads visited EMC to gather requirements. At that time, the concept of METplus was developed as it extends beyond the original code base. It was originally called METplus but several constraints have driven the transition to the use of METplus. METplus is now the unified verification, validation, and diagnostics capability for NOAA's UFS and a component of NCAR's SIMA modeling frameworks. It being actively developed by NCAR, ESRL, EMC and is open to community contributions.
Over the years, MET and VSDB packages grew in complexity. Verification
capability at other NOAA laboratories, such as ESRL, were also under heavy
development. An effort to unify verification capability was first started
under the HIWPP project and led by NOAA ESRL. In 2015, the NGGPS
Program Office started working groups to focus on several aspects of the
next gen system, including the Verification and Validation Working Group.
This group made the recommendation to use MET as the foundation for a
unified verification capability. In 2016, NCAR and GSD leads visited EMC
to gather requirements. At that time, the concept of METplus was developed
as it extends beyond the original code base. It was originally MET+ but
several constraints have driven the transition to the use of METplus.
METplus is now the unified verification, validation, and
diagnostics capability for NOAA's UFS and a component of NCAR's SIMA
modeling frameworks. It is being actively developed by NCAR, ESRL, EMC
and is open to community contributions.

METplus Concept
---------------
METplus is the overarching, or umbrella, repository and hence framework for
the Unified Forecast System verification capability. It is intended to be
extensible through adding additional capability developed by the community.
The core components of the framework include MET, the associated database and
display systems called METviewer and METexpress, and a suite of Python
wrappers to provide low-level automation and examples, also called use-cases.
A description of each tool along with some ancillary repositories are as
follows:

* **MET** - core statistical tool that matches up grids with either gridded
analyses or point observations and applies configurable methods to compute
statistics and diagnostics
* **METviewer** - core database and display system intended for deep analysis
of MET output
* **METexpress** - core database and display system intended for quick
analysis via pre-defined queries of MET output
* **METplus wrappers** - suite of Python-based wrappers that provide
low-level automation of MET tools and newly developed plotting capability
* **METplus use-cases** - configuration files and sample data to show how to
invoke METplus wrappers to make using MET tools easier and reproducible
* **METcalcpy** - suite of Python-based scripts to be used by other
components of METplus tools for statistical aggregation, event
equalization, and other analysis needs
* **METplotpy** - suite of Python-based scripts to plot MET output,
and in come cases provide additional post-processing of output prior
to plotting
* **METdatadb** - database to store MET output and to be used by both
METviewer and METexpress

The umbrella repository will be brought together by using a software package
called `manage_externals <https://github.com/ESMCI/manage_externals>`_
developed by the Community Earth System Modeling (CESM) team, hosted at NCAR
and NOAA Earth System's Research Laboratory. The manage_externals paackage
was developed because CESM is comprised of a number of different components
that are developed and managed independently. Each component also may have
additional "external" dependencies that need to be maintained independently.

Acronyms
--------

* **MET** - Model Evaluation Tools
* **DTC** - Developmental Testbed Center
* **NCAR** - National Center for Atmospheric Research
* **NOAA** - National Oceanic and Atmospheric Administration
* **EMC** - Environmental Modeling Center
* **VSDB** - Verification Statistics Data Base
* **MODE** - Method for Object-Based Diagnostic Evaluation
* **UFS** - Unified Forecast System
* **SIMA** -System for Integrated Modeling of the Atmosphere
* **ESRL** - Earth Systems Research Laboratory
* **HIWPP** - High Impact Weather Predication Project
* **NGGPS** - Next Generation Global Predicatio System
* **GSD** - Global Systems Division

.. toctree::
:hidden:
Expand Down
78 changes: 40 additions & 38 deletions met/src/basic/vx_config/my_config_scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ static bool replace_env(ConcatString &);

static bool is_fort_thresh_no_spaces();

static bool is_simple_perc_thresh();

static int do_simple_perc_thresh();


Expand Down Expand Up @@ -370,6 +372,8 @@ if ( is_float_v2() ) { if ( do_float() ) return ( token(FLOAT) ); }

if ( is_fort_thresh_no_spaces() ) { return ( do_fort_thresh() ); }

if ( is_simple_perc_thresh() ) { return ( do_simple_perc_thresh() ); }

int t;

if ( is_id() ) { t = do_id(); return ( token(t) ); }
Expand Down Expand Up @@ -533,7 +537,6 @@ if ( is_lhs ) { strncpy(configlval.text, configtext, max_id_length); return (

if ( strcmp(configtext, "print" ) == 0 ) { return ( PRINT ); }


//
// boolean?
//
Expand All @@ -554,17 +557,13 @@ for (j=0; j<n_fort_thresh_strings; ++j) {

}





//
// builtin ?
//

int index;

if ( (! is_lhs) && is_builtin((string)configtext, index) ) { configlval.index = index; return ( BUILTIN ); }
if ( (! is_lhs) && is_builtin((string)configtext, index) ) { configlval.index = index; return ( BUILTIN ); }

//
// local variable ? // ie, in argument list
Expand All @@ -580,11 +579,6 @@ const DictionaryEntry * e = dict_stack->lookup(configtext);

if ( e && (e->is_number()) && (! is_lhs) ) {

// cout << "=================== id = \"" << configtext << "\" is_lhs = " << (is_lhs ? "true" : "false") << "\n";

// cout << "do_id() -> \n";
// e->dump(cout);

if ( e->type() == IntegerType ) {

set_int(configlval.nval, e->i_value());
Expand Down Expand Up @@ -613,28 +607,20 @@ if ( e && (! is_lhs) && (e->type() == UserFunctionType) ) {

}


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





//
// fortran threshold without spaces? (example: "le150")
//

if ( (strncmp(configtext, "lt", 2) == 0) && is_number(configtext + 2, max_id_length - 2) ) { return ( do_fort_thresh() ); }

for (j=0; j<n_fort_thresh_strings; ++j) {

if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0)
&& (is_number(configtext + 2, max_id_length - 2))
) { configlval.cval = thresh_lt; return ( do_fort_thresh() ); }
&& (is_number(configtext + 2, max_id_length - 2)) )
{ configlval.cval = thresh_lt; return ( do_fort_thresh() ); }

}


//
// simple percentile threshold? (example: "SOP50")
//
Expand All @@ -649,11 +635,8 @@ for (j=0; j<n_perc_thresh_infos; ++j) {

}



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


//
// nope
//
Expand Down Expand Up @@ -863,7 +846,6 @@ while ( 1 ) {

c1 = c2;

// c2 = nextchar();
c2 = fgetc(configin);

}
Expand Down Expand Up @@ -891,7 +873,6 @@ while ( 1 ) {

if ( feof (configin) ) break;

// c = nextchar();
c = fgetc(configin);

if ( (c == eof) || (c == '\n') ) break;
Expand Down Expand Up @@ -1435,7 +1416,38 @@ int j;

for (j=0; j<n_fort_thresh_strings; ++j) {

if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0) && (is_number(configtext + 2, max_id_length - 2)) ) return ( true );
if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0)
&& (is_number(configtext + 2, max_id_length - 2)) )
{ return ( true ); }

}


return ( false );

}


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


bool is_simple_perc_thresh()

{

int j, k;

//
// simple percentile threshold? (example: "SOP50.0")
//

for (j=0; j<n_perc_thresh_infos; ++j) {

k = perc_thresh_info[j].short_name_length;

if ( (strncmp(configtext, perc_thresh_info[j].short_name, k) == 0)
&& (is_number(configtext + k, max_id_length - k)) )
{ return ( do_simple_perc_thresh() ); }

}

Expand Down Expand Up @@ -1472,7 +1484,6 @@ for (j=0; j<n_perc_thresh_infos; ++j) {

}


if ( index < 0 ) {

mlog << Error << "\ndo_simple_perc_thresh() -> "
Expand All @@ -1482,11 +1493,8 @@ if ( index < 0 ) {

}


configlval.pc_info.perc_index = index;
// configlval.pc_info.is_simple = true;
configlval.pc_info.value = value;
// configlval.pc_info.value2 = bad_data_double;;
configlval.pc_info.value = value;


return ( SIMPLE_PERC_THRESH );
Expand All @@ -1495,9 +1503,3 @@ return ( SIMPLE_PERC_THRESH );


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






Loading

0 comments on commit 11cb05d

Please sign in to comment.