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 857 tc stat met config #861

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -6191,3 +6191,23 @@ METplus Configuration Glossary
Specify the value for 'nc_pairs_flag.apply_mask' in the MET configuration file for GridStat.

| *Used by:* GridStat

TC_STAT_COLUMN_STR_EXC_NAME
Specify the value for 'column_str_exc_name' in the MET configuration file for TCStat.

| *Used by:* TCStat

TC_STAT_COLUMN_STR_EXC_VAL
Specify the value for 'column_str_exc_val' in the MET configuration file for TCStat.

| *Used by:* TCStat

TC_STAT_INIT_STR_EXC_NAME
Specify the value for 'init_str_exc_name' in the MET configuration file for TCStat.

| *Used by:* TCStat

TC_STAT_INIT_STR_EXC_VAL
Specify the value for 'init_str_exc_val' in the MET configuration file for TCStat.

| *Used by:* TCStat
48 changes: 48 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4878,6 +4878,10 @@ Configuration
| :term:`TC_STAT_MATCH_POINTS`
| :term:`TC_STAT_SKIP_IF_OUTPUT_EXISTS`
| :term:`TC_STAT_MET_CONFIG_OVERRIDES`
| :term:`TC_STAT_COLUMN_STR_EXC_NAME`
| :term:`TC_STAT_COLUMN_STR_EXC_VAL`
| :term:`TC_STAT_INIT_STR_EXC_NAME`
| :term:`TC_STAT_INIT_STR_EXC_VAL`
|

.. warning:: **DEPRECATED:**
Expand Down Expand Up @@ -5187,6 +5191,28 @@ Below the file contents are descriptions of each environment variable referenced
* - :term:`TC_STAT_COLUMN_STR_VAL`
- column_str_val

**${METPLUS_COLUMN_STR_EXC_NAME}**

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

* - METplus Config(s)
- MET Config File
* - :term:`TC_STAT_COLUMN_STR_EXC_NAME`
- column_str_exc_name

**${METPLUS_COLUMN_STR_EXC_VAL}**

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

* - METplus Config(s)
- MET Config File
* - :term:`TC_STAT_COLUMN_STR_EXC_VAL`
- column_str_exc_val

**${METPLUS_INIT_THRESH_NAME}**

.. list-table::
Expand Down Expand Up @@ -5231,6 +5257,28 @@ Below the file contents are descriptions of each environment variable referenced
* - :term:`TC_STAT_INIT_STR_VAL`
- init_str_val

**${METPLUS_INIT_STR_EXC_NAME}**

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

* - METplus Config(s)
- MET Config File
* - :term:`TC_STAT_INIT_STR_EXC_NAME`
- init_str_exc_name

**${METPLUS_INIT_STR_EXC_VAL}**

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

* - METplus Config(s)
- MET Config File
* - :term:`TC_STAT_INIT_STR_EXC_VAL`
- init_str_exc_val

**${METPLUS_WATER_ONLY}**

.. list-table::
Expand Down
10 changes: 10 additions & 0 deletions internal_tests/pytests/tc_stat/test_tc_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ def tc_stat_wrapper(metplus_config):
({'TC_STAT_LOOKIN_DIR': '/my/new/input/dir', },
{'LOOKIN_DIR': '/my/new/input/dir'}),

({'TC_STAT_COLUMN_STR_EXC_NAME': 'WATCH_WARN',
'TC_STAT_COLUMN_STR_EXC_VAL': 'TSWATCH',},
{'COLUMN_STR_EXC_NAME': 'column_str_exc_name = ["WATCH_WARN"];',
'COLUMN_STR_EXC_VAL': 'column_str_exc_val = ["TSWATCH"];'}),

({'TC_STAT_INIT_STR_EXC_NAME': 'WATCH_WARN',
'TC_STAT_INIT_STR_EXC_VAL': 'HUWARN',},
{'INIT_STR_EXC_NAME': 'init_str_exc_name = ["WATCH_WARN"];',
'INIT_STR_EXC_VAL': 'init_str_exc_val = ["HUWARN"];'}),

]
)
def test_override_config_in_c_dict(metplus_config, overrides, c_dict):
Expand Down
25 changes: 25 additions & 0 deletions metplus/wrappers/tc_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ class TCStatWrapper(CommandBuilder):
'METPLUS_LANDFALL_END',
'METPLUS_MATCH_POINTS',
'METPLUS_JOBS',
'METPLUS_COLUMN_STR_EXC_NAME',
'METPLUS_COLUMN_STR_EXC_VAL',
'METPLUS_INIT_STR_EXC_NAME',
'METPLUS_INIT_STR_EXC_VAL',
]

def __init__(self, config, instance=None, config_overrides={}):
Expand Down Expand Up @@ -135,6 +139,27 @@ def create_c_dict(self):

self.set_met_config_for_environment_variables()

self.add_met_config(name='column_str_exc_name',
data_type='list',
metplus_configs=['TC_STAT_COLUMN_STR_EXC_NAME',
'TC_STAT_COLUMN_STR_EXCLUDE_NAME',
])
self.add_met_config(name='column_str_exc_val',
data_type='list',
metplus_configs=['TC_STAT_COLUMN_STR_EXC_VAL',
'TC_STAT_COLUMN_STR_EXCLUDE_VAL',
])
self.add_met_config(name='init_str_exc_name',
data_type='list',
metplus_configs=['TC_STAT_INIT_STR_EXC_NAME',
'TC_STAT_INIT_STR_EXCLUDE_NAME',
])
self.add_met_config(name='init_str_exc_val',
data_type='list',
metplus_configs=['TC_STAT_INIT_STR_EXC_VAL',
'TC_STAT_INIT_STR_EXCLUDE_VAL',
])

return c_dict

def set_met_config_for_environment_variables(self):
Expand Down
18 changes: 18 additions & 0 deletions parm/met_config/TCStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ ${METPLUS_COLUMN_THRESH_VAL}
${METPLUS_COLUMN_STR_NAME}
${METPLUS_COLUMN_STR_VAL}

//
// Stratify by excluding strings in non-numeric data columns.
//
//column_str_exc_name =
${METPLUS_COLUMN_STR_EXC_NAME}

//column_str_exc_val =
${METPLUS_COLUMN_STR_EXC_VAL}

//
// Similar to the column_thresh options above
//
Expand All @@ -117,6 +126,15 @@ ${METPLUS_INIT_THRESH_VAL}
${METPLUS_INIT_STR_NAME}
${METPLUS_INIT_STR_VAL}

//
// Similar to the column_str_exc options above
//
//init_str_exc_name =
${METPLUS_INIT_STR_EXC_NAME}

//init_str_exc_val =
${METPLUS_INIT_STR_EXC_VAL}

//
// Stratify by the ADECK and BDECK distances to land.
//
Expand Down
6 changes: 6 additions & 0 deletions parm/use_cases/met_tool_wrapper/TCStat/TCStat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ TC_STAT_LANDFALL_END = 00
# tracks should be written out
TC_STAT_MATCH_POINTS = false

#TC_STAT_COLUMN_STR_EXC_NAME =
#TC_STAT_COLUMN_STR_EXC_VAL =

#TC_STAT_INIT_STR_EXC_NAME =
#TC_STAT_INIT_STR_EXC_VAL =

# IMPORTANT Refer to the README_TC for details on setting up analysis
# jobs (located in {MET_INSTALL_DIR}/share/met/config

Expand Down