Skip to content

Commit

Permalink
Per #1898, removed setting of models in -diag arguments because they …
Browse files Browse the repository at this point in the history
…are now set in diag_info_map.match_to_track. Added documentation for TC_PAIRS_DIAG_SOURCE<n>, TC_PAIRS_DIAG_DIR<n>, and TC_PAIRS_DIAG_TEMPLATE<n> that was missing
  • Loading branch information
georgemccabe committed Nov 16, 2022
1 parent 66092a1 commit aa91458
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
15 changes: 15 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10134,6 +10134,21 @@ METplus Configuration Glossary

| *Used by:* TCPairs
TC_PAIRS_DIAG_DIR<n>
Specify the (optional) directory for the nth -diag argument for TCPairs.

| *Used by:* TCPairs
TC_PAIRS_DIAG_TEMPLATE<n>
Specify the (optional) template for the nth -diag argument for TCPairs.

| *Used by:* TCPairs
TC_PAIRS_DIAG_SOURCE<n>
Specify the (optional) source string for the nth -diag argument for TCPairs.

| *Used by:* TCPairs
TC_STAT_DIAG_THRESH_NAME
Specify the value for 'diag_thresh_name' in the MET configuration file for TCStat.

Expand Down
3 changes: 3 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8233,6 +8233,9 @@ METplus Configuration
| :term:`TC_PAIRS_DIAG_CONVERT_MAP<n>_DIAG_SOURCE`
| :term:`TC_PAIRS_DIAG_CONVERT_MAP<n>_KEY`
| :term:`TC_PAIRS_DIAG_CONVERT_MAP<n>_CONVERT`
| :term:`TC_PAIRS_DIAG_SOURCE\<n\>`
| :term:`TC_PAIRS_DIAG_TEMPLATE\<n\>`
| :term:`TC_PAIRS_DIAG_DIR\<n\>`
|
.. warning:: **DEPRECATED:**
Expand Down
21 changes: 6 additions & 15 deletions internal/tests/pytests/wrappers/tc_pairs/test_tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,25 +467,16 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'TC_PAIRS_DIAG_SOURCE1': 'TCDIAG',
},
{'DIAG_ARG': '-diag TCDIAG /some/path/2014121318.dat'}),
# 43 -diag argument with models
('VALID', {
'TC_PAIRS_DIAG_TEMPLATE1': '/some/path/{valid?fmt=%Y%m%d%H}.dat',
'TC_PAIRS_DIAG_SOURCE1': 'TCDIAG',
'TC_PAIRS_DIAG_MODELS1': 'OFCL, SHIP',
},
{'DIAG_ARG': '-diag TCDIAG /some/path/2014121318.dat model=OFCL,SHIP'}),
# 44 2 -diag arguments
# 43 2 -diag arguments
('VALID', {
'TC_PAIRS_DIAG_TEMPLATE1': '/some/path/{valid?fmt=%Y%m%d%H}.dat',
'TC_PAIRS_DIAG_SOURCE1': 'TCDIAG',
'TC_PAIRS_DIAG_TEMPLATE2': '/some/path/rt_{valid?fmt=%Y%m%d%H}.dat',
'TC_PAIRS_DIAG_SOURCE2': 'LSDIAG_RT',
'TC_PAIRS_DIAG_MODELS2': 'OFCL, SHIP',
},
{'DIAG_ARG': ('-diag TCDIAG /some/path/2014121318.dat '
'-diag LSDIAG_RT /some/path/rt_2014121318.dat '
'model=OFCL,SHIP')}),
# 45 diag_convert_map 1 dictionary in list
'-diag LSDIAG_RT /some/path/rt_2014121318.dat')}),
# 44 diag_convert_map 1 dictionary in list
('VALID', {
'TC_PAIRS_DIAG_CONVERT_MAP1_DIAG_SOURCE': 'CIRA_DIAG',
'TC_PAIRS_DIAG_CONVERT_MAP1_KEY': '(10C),(10KT),(10M/S)',
Expand All @@ -495,7 +486,7 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'diag_convert_map = [{diag_source = "CIRA_DIAG";'
'key = ["(10C)", "(10KT)", "(10M/S)"];convert(x) = x/10;}];'
)}),
# 46 diag_convert_map 2 dictionaries in list
# 45 diag_convert_map 2 dictionaries in list
('VALID', {
'TC_PAIRS_DIAG_CONVERT_MAP1_DIAG_SOURCE': 'CIRA_DIAG',
'TC_PAIRS_DIAG_CONVERT_MAP1_KEY': '(10C),(10KT),(10M/S)',
Expand All @@ -510,7 +501,7 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'{diag_source = "SHIPS_DIAG";key = ["LAT", "LON", "CSST", '
'"RSST", "DSST", "DSTA"];convert(x) = x/100;}];'
)}),
# 47 diag_info_map 1 dictionary in list
# 46 diag_info_map 1 dictionary in list
('VALID', {
'TC_PAIRS_DIAG_INFO_MAP1_DIAG_SOURCE': 'CIRA_DIAG_RT',
'TC_PAIRS_DIAG_INFO_MAP1_TRACK_SOURCE': 'GFS',
Expand All @@ -522,7 +513,7 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'diag_info_map = [{diag_source = "CIRA_DIAG_RT";'
'track_source = "GFS";field_source = "GFS_0p50";'
'match_to_track = ["GFS"];diag_name = ["MY_NAME"];}];')}),
# 48 diag_info_map 2 dictionaries in list
# 47 diag_info_map 2 dictionaries in list
('VALID', {
'TC_PAIRS_DIAG_INFO_MAP1_DIAG_SOURCE': 'CIRA_DIAG_RT',
'TC_PAIRS_DIAG_INFO_MAP1_TRACK_SOURCE': 'GFS',
Expand Down
6 changes: 0 additions & 6 deletions metplus/wrappers/tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,9 @@ def _handle_diag(self, c_dict):
source = (
self.config.getraw('config', f'TC_PAIRS_DIAG_SOURCE{idx}')
)
models = getlist(
self.config.getraw('config', f'TC_PAIRS_DIAG_MODELS{idx}')
)
diag_info = {
'template': template,
'source': source,
'models': models,
}
diag_info_list.append(diag_info)

Expand Down Expand Up @@ -1023,8 +1019,6 @@ def _get_diag_file(self, time_info):
return False

arg = f"-diag {diag_info['source']} {' '.join(filepaths)}"
if diag_info['models']:
arg = f"{arg} model={','.join(diag_info['models'])}"
self.args.append(arg)

return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ TC_PAIRS_BDECK_TEMPLATE = {date?fmt=%Y%m}/b{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.

TC_PAIRS_REFORMAT_DIR = {OUTPUT_BASE}/track_data_atcf

#TC_PAIRS_DIAG_DIR1 =
#TC_PAIRS_DIAG_TEMPLATE1 =
#TC_PAIRS_DIAG_SOURCE1 =

TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs
TC_PAIRS_OUTPUT_TEMPLATE = {date?fmt=%Y%m}/{basin?fmt=%s}q{date?fmt=%Y%m%d%H}.gfso.{cyclone?fmt=%s}

Expand Down
4 changes: 4 additions & 0 deletions parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ TC_PAIRS_BDECK_TEMPLATE = b{basin?fmt=%s}{cyclone?fmt=%s}{date?fmt=%Y}.dat
TC_PAIRS_EDECK_INPUT_DIR =
TC_PAIRS_EDECK_TEMPLATE =

#TC_PAIRS_DIAG_DIR1 =
#TC_PAIRS_DIAG_TEMPLATE1 =
#TC_PAIRS_DIAG_SOURCE1 =

TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs
TC_PAIRS_OUTPUT_TEMPLATE = tc_pairs_{basin?fmt=%s}{date?fmt=%Y%m%d%H}.dat

Expand Down

0 comments on commit aa91458

Please sign in to comment.