Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 1166 series analysis field info #1353

Merged
merged 49 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2363fb9
per #896, added support for setting fourier dictionary in a GridStat …
georgemccabe Dec 7, 2021
b08dfaa
per #896, added support for setting obs_bufr_map and obs_prepbufr_map…
georgemccabe Dec 7, 2021
1e5492f
added newline at end of file
georgemccabe Dec 7, 2021
99284a9
turn on use case for testing, ci-run-all-diff
georgemccabe Dec 14, 2021
d9f1e6d
turn off use case for testing
georgemccabe Dec 14, 2021
b0eb3c9
per #896, added support for mask.llpnt in PointStat MET config
georgemccabe Dec 15, 2021
2c18523
per #896, added documentation for mask.llpnt and updated deprecated v…
georgemccabe Dec 15, 2021
f6d7b68
per #896, add support for setting the hira dictionary in the PointSta…
georgemccabe Dec 15, 2021
ea2387b
per #896, added support for setting message_type_group_map in PointSt…
georgemccabe Dec 15, 2021
b8c0846
updated output from utility to assist with adding support for new MET…
georgemccabe Dec 15, 2021
12030c3
per #896, add support for setting check_dup in TCPairs wrapped MET co…
georgemccabe Dec 15, 2021
1a93cbe
per #896, add support for setting check_dup in TCPairs wrapped MET co…
georgemccabe Dec 15, 2021
eaa2b09
improve formatting for utility script for adding support for new MET …
georgemccabe Dec 16, 2021
2e5f4b6
per #896, add support for setting interp12 in TCPairs wrapped MET con…
georgemccabe Dec 16, 2021
b01ac4d
per #896, add support for setting all output_stats values in SeriesAn…
georgemccabe Dec 16, 2021
15ee427
per #896, add support for setting all output_stats values in SeriesAn…
georgemccabe Dec 16, 2021
3a40b14
per #896, add support for setting ps_plot_flag and ct_stats_flag in M…
georgemccabe Dec 16, 2021
ca0d5a1
only prepend app name to config nickname if it is not already present
georgemccabe Dec 16, 2021
a9c77e4
Do not automatically prepend app name (i.e. GRID_STAT_) to other conf…
georgemccabe Dec 16, 2021
2f3212f
fixed new unit tests, ci-run-all-diff
georgemccabe Dec 16, 2021
49fb8d5
updated utility for adding support for new MET config variables to ta…
georgemccabe Dec 16, 2021
0e4c94f
added missing update to add_met_config_dict call to include app name …
georgemccabe Dec 16, 2021
4481662
per #896, add support for setting censor_thresh and censor_val in Gri…
georgemccabe Dec 16, 2021
81d55fe
merged develop and resolved conflicts
georgemccabe Dec 16, 2021
c327942
added another missing update to add_met_config_dict call to include a…
georgemccabe Dec 16, 2021
8141caf
changed error log in diff test to print values instead of netcdf file…
georgemccabe Dec 16, 2021
e4fc705
removed lines that should not have remained after merge, ci-run-all-diff
georgemccabe Dec 16, 2021
95aafa4
updated contributor's guide info to reflect changes to add_met_config…
georgemccabe Dec 16, 2021
89d98e1
skip substituting time values into var list to test if this breaks an…
georgemccabe Dec 17, 2021
c90bd9c
removed unused code from test
georgemccabe Dec 17, 2021
d243d33
per #1166, added logic to check if time template tags are used in the…
georgemccabe Dec 17, 2021
d3696ea
trigger use cases that run SeriesAnalysis to test that changes have n…
georgemccabe Dec 17, 2021
d980c55
changed unset value for month and day to 1 so that a datetime object …
georgemccabe Dec 17, 2021
0ccd0b8
added support for setting file_type for fcst and obs
georgemccabe Dec 17, 2021
57428de
fixed incorrect argument order
georgemccabe Dec 17, 2021
7e5b468
Merge branch 'feature_896_more_met_config' into feature_1166_series_a…
georgemccabe Dec 17, 2021
4a9faa2
removed error when stat list (cnt) is not set because it is not actua…
georgemccabe Dec 17, 2021
f88fa8b
removed square brackets for efficiency so check can break out when a …
georgemccabe Dec 17, 2021
646552e
changed method to staticmethod
georgemccabe Dec 17, 2021
379252e
added commented out variable names above environment variables that s…
georgemccabe Dec 17, 2021
e2a8ad5
changed class variables to be private (name starting with _)
georgemccabe Dec 17, 2021
aa5ad0b
added support for setting fcst.cat_thresh and obs.cat_thresh in Serie…
georgemccabe Dec 17, 2021
7c1285b
added missing read of variables to specify probabilistic fields in Se…
georgemccabe Dec 17, 2021
4a43d06
added support for setting file_type in the climo_mean and climo_stdev…
georgemccabe Dec 17, 2021
fd28e65
replace wildcard character * with 'all' in output paths to prevent wr…
georgemccabe Dec 17, 2021
b4bf684
fixed bug introduced in last commit, ci-run-all-diff
georgemccabe Dec 17, 2021
520d70c
merged develop and resolved conflicts
georgemccabe Jan 12, 2022
2d3425d
removed commented lines
georgemccabe Jan 12, 2022
4a1a5c5
turn off all use cases to prepare for PR
georgemccabe Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8694,6 +8694,26 @@ METplus Configuration Glossary

| *Used by:* All

FCST_SERIES_ANALYSIS_CAT_THRESH
Specify the value for 'fcst.cat_thresh' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis

OBS_SERIES_ANALYSIS_CAT_THRESH
Specify the value for 'obs.cat_thresh' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis

SERIES_ANALYSIS_CLIMO_MEAN_FILE_TYPE
Specify the value for 'climo_mean.file_type' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis

SERIES_ANALYSIS_CLIMO_STDEV_FILE_TYPE
Specify the value for 'climo_stdev.file_type' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis

OMP_NUM_THREADS
Sets environment variable of the same name that determines the number
of threads to use in the MET executables. Defaults to 1 thread.
Expand Down
30 changes: 30 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5871,6 +5871,7 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_CLIMO_MEAN_MATCH_MONTH`
| :term:`SERIES_ANALYSIS_CLIMO_MEAN_DAY_INTERVAL`
| :term:`SERIES_ANALYSIS_CLIMO_MEAN_HOUR_INTERVAL`
| :term:`SERIES_ANALYSIS_CLIMO_MEAN_FILE_TYPE`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_FILE_NAME`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_FIELD`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_REGRID_METHOD`
Expand All @@ -5881,6 +5882,7 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_MATCH_MONTH`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_DAY_INTERVAL`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_HOUR_INTERVAL`
| :term:`SERIES_ANALYSIS_CLIMO_STDEV_FILE_TYPE`
| :term:`SERIES_ANALYSIS_HSS_EC_VALUE`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_FHO`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTC`
Expand All @@ -5894,6 +5896,8 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PSTD`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PJC`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC`
| :term:`FCST_SERIES_ANALYSIS_CAT_THRESH`
| :term:`OBS_SERIES_ANALYSIS_CAT_THRESH`
|

.. warning:: **DEPRECATED:**
Expand Down Expand Up @@ -6076,6 +6080,8 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
- climo_mean.day_interval
* - :term:`SERIES_ANALYSIS_CLIMO_MEAN_HOUR_INTERVAL`
- climo_mean.hour_interval
* - :term:`SERIES_ANALYSIS_CLIMO_MEAN_FILE_TYPE`
- climo_mean.file_type

**${METPLUS_CLIMO_STDEV_DICT}**

Expand Down Expand Up @@ -6105,6 +6111,8 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
- climo_stdev.day_interval
* - :term:`SERIES_ANALYSIS_CLIMO_STDEV_HOUR_INTERVAL`
- climo_stdev.hour_interval
* - :term:`SERIES_ANALYSIS_CLIMO_STDEV_FILE_TYPE`
- climo_stdev.file_type


**${METPLUS_BLOCK_SIZE}**
Expand Down Expand Up @@ -6184,6 +6192,28 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC`
- output_stats.prc

**${METPLUS_FCST_CAT_THRESH}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`FCST_SERIES_ANALYSIS_CAT_THRESH`
- fcst.cat_thresh

**${METPLUS_OBS_CAT_THRESH}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`OBS_SERIES_ANALYSIS_CAT_THRESH`
- obs.cat_thresh


SeriesByInit
============
Expand Down
27 changes: 13 additions & 14 deletions internal_tests/pytests/series_analysis/test_series_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ def set_minimum_config_settings(config):
'pstd = ["RMSE10", "FBAR", "OBAR"];'
'pjc = ["RMSE11", "FBAR", "OBAR"];'
'prc = ["RMSE12", "FBAR", "OBAR"];}')}),
({'SERIES_ANALYSIS_FCST_CAT_THRESH': '>=0.0, >=0.3, >=1.0', },
{'METPLUS_FCST_CAT_THRESH': 'cat_thresh = [>=0.0, >=0.3, >=1.0];'}),

({'SERIES_ANALYSIS_OBS_CAT_THRESH': '<=CDP33', },
{'METPLUS_OBS_CAT_THRESH': 'cat_thresh = [<=CDP33];'}),

]
)
Expand Down Expand Up @@ -738,29 +743,23 @@ def test_create_ascii_storm_files_list(metplus_config, config_overrides,
leads = lead_group[1]
else:
leads = None
fcst_list_file = wrapper.get_ascii_filename('FCST', storm_id, leads)
fcst_list_file = wrapper._get_ascii_filename('FCST', storm_id, leads)
fcst_file_path = os.path.join(output_dir,
output_prefix,
fcst_list_file)
if os.path.exists(fcst_file_path):
os.remove(fcst_file_path)

obs_list_file = wrapper.get_ascii_filename('OBS', storm_id, leads)
obs_list_file = wrapper._get_ascii_filename('OBS', storm_id, leads)
obs_file_path = os.path.join(output_dir,
output_prefix,
obs_list_file)
if os.path.exists(obs_file_path):
os.remove(obs_file_path)

# perform string substitution on var list
wrapper.c_dict['VAR_LIST'] = (
sub_var_list(wrapper.c_dict['VAR_LIST_TEMP'],
time_info)
)

fcst_path, obs_path = wrapper.create_ascii_storm_files_list(time_info,
storm_id,
lead_group)
fcst_path, obs_path = wrapper._create_ascii_storm_files_list(time_info,
storm_id,
lead_group)
assert(fcst_path == fcst_file_path and obs_path == obs_file_path)

with open(fcst_file_path, 'r') as file_handle:
Expand Down Expand Up @@ -813,7 +812,7 @@ def test_get_ascii_filename(metplus_config, storm_id, leads,
expected_result):
wrapper = series_analysis_wrapper(metplus_config)
for data_type in ['FCST', 'OBS']:
actual_result = wrapper.get_ascii_filename(data_type,
actual_result = wrapper._get_ascii_filename(data_type,
storm_id,
leads)
assert(actual_result == f"{data_type}{expected_result}")
Expand All @@ -822,7 +821,7 @@ def test_get_ascii_filename(metplus_config, storm_id, leads,
return

lead_seconds = [ti_get_seconds_from_lead(item) for item in leads]
actual_result = wrapper.get_ascii_filename(data_type,
actual_result = wrapper._get_ascii_filename(data_type,
storm_id,
lead_seconds)
assert(actual_result == f"{data_type}{expected_result}")
Expand Down Expand Up @@ -865,7 +864,7 @@ def test_get_netcdf_min_max(metplus_config):
'tc_data',
'basin_global_tenth_degree.nc')
variable_name = 'basin'
min, max = wrapper.get_netcdf_min_max(filepath, variable_name)
min, max = wrapper._get_netcdf_min_max(filepath, variable_name)
assert(min == expected_min)
assert(max == expected_max)

Expand Down
4 changes: 2 additions & 2 deletions metplus/util/string_template_substitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ def add_date_matches_to_output_dict(match_dict, output_dict, time_type, valid_sh
time_values = {
'Y': -1,
'y': -1,
'm': -1,
'd': -1,
'm': 1,
'd': 1,
'j': -1,
'H': 0,
'M': 0,
Expand Down
6 changes: 5 additions & 1 deletion metplus/wrappers/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,15 @@ def find_and_check_output_file(self, time_info=None,
output_path = do_string_sub(output_path,
**time_info)

# replace wildcard character * with all
output_path.replace('*', 'all')

skip_if_output_exists = self.c_dict.get('SKIP_IF_OUTPUT_EXISTS', False)

# get directory that the output file will exist
if is_directory:
parent_dir = output_path
if time_info:
if time_info and time_info['valid'] != '*':
valid_format = time_info['valid'].strftime('%Y%m%d_%H%M%S')
else:
valid_format = ''
Expand Down Expand Up @@ -1523,6 +1526,7 @@ def handle_climo_dict(self):
'match_month': ('bool', 'uppercase'),
'day_interval': 'int',
'hour_interval': 'int',
'file_type': ('string', 'remove_quotes'),
}
for climo_type in self.climo_types:
dict_name = f'climo_{climo_type.lower()}'
Expand Down
Loading