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

Probability field threshold control in SeriesAnalysis #942

Merged
merged 1 commit into from
Jun 1, 2021
Merged
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
5 changes: 5 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7110,3 +7110,8 @@ METplus Configuration Glossary
Specify the value for nth 'consensus.min_req' in the MET configuration file for TCPairs.

| *Used by:* TCPairs

FCST_SERIES_ANALYSIS_PROB_THRESH
Threshold values to be used for probabilistic data in series_analysis. The value can be a single item or a comma separated list of items that must start with a comparison operator (>,>=,==,!=,<,<=,gt,ge,eq,ne,lt,le).

| *Used by:* SeriesAnalysis
3 changes: 3 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3808,6 +3808,7 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_VLD_THRESH`
| :term:`SERIES_ANALYSIS_BLOCK_SIZE`
| :term:`SERIES_ANALYSIS_CTS_LIST`
| :term:`FCST_SERIES_ANALYSIS_PROB_THRESH`
| :term:`SERIES_ANALYSIS_MET_CONFIG_OVERRIDES`
| :term:`FCST_SERIES_ANALYSIS_INPUT_DIR`
| :term:`OBS_SERIES_ANALYSIS_INPUT_DIR`
Expand Down Expand Up @@ -3956,6 +3957,8 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
- fcst.field.cat_thresh
* - :term:`FCST_VAR<n>_OPTIONS`
- n/a
* - :term:`FCST_SERIES_ANALYSIS_PROB_THRESH`
- n/a

.. note:: For more information on controlling the forecast field attributes in METplus, please see the :ref:`Field_Info` section of the User's Guide.

Expand Down
4 changes: 2 additions & 2 deletions metplus/wrappers/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,8 @@ def get_field_info(self, d_type, v_name, v_level='', v_thresh=[], v_extra=''):
"\"; " + thresh_str + "}"

# add probabilistic cat thresh if different from default ==0.1
prob_cat_thresh = self.c_dict[d_type + '_PROB_THRESH']
if prob_cat_thresh is not None:
prob_cat_thresh = self.c_dict.get(d_type + '_PROB_THRESH')
if prob_cat_thresh:
field += " cat_thresh=[" + prob_cat_thresh + "];"

if v_extra:
Expand Down
12 changes: 12 additions & 0 deletions metplus/wrappers/series_analysis_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def create_c_dict(self):
# used in CommandBuilder.find_data function)
self.handle_file_window_variables(c_dict, dtypes=['BOTH'])

prob_thresh = self.config.getstr('config','BOTH_SERIES_ANALYSIS_PROB_THRESH','')
c_dict['FCST_PROB_THRESH'] = prob_thresh
c_dict['OBS_PROB_THRESH'] = prob_thresh

# if BOTH is not set, both FCST or OBS must be set
else:
if (not c_dict['FCST_INPUT_TEMPLATE'] or
Expand All @@ -191,6 +195,14 @@ def create_c_dict(self):
# set *_WINDOW_* variables for FCST and OBS
self.handle_file_window_variables(c_dict, dtypes=['FCST', 'OBS'])

c_dict['FCST_PROB_THRESH'] = (
self.config.getstr('config','FCST_SERIES_ANALYSIS_PROB_THRESH','')
)

c_dict['OBS_PROB_THRESH'] = (
self.config.getstr('config','OBS_SERIES_ANALYSIS_PROB_THRESH','')
)

c_dict['TC_STAT_INPUT_DIR'] = (
self.config.getdir('SERIES_ANALYSIS_TC_STAT_INPUT_DIR', '')
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ MODEL = WRF

OBTYPE = MC_PCP

#FCST_SERIES_ANALYSIS_PROB_THRESH =

FCST_VAR1_NAME = APCP

FCST_VAR1_LEVELS = A03
Expand Down Expand Up @@ -118,4 +120,4 @@ SERIES_ANALYSIS_CLIMO_MEAN_INPUT_TEMPLATE =

SERIES_ANALYSIS_CLIMO_STDEV_INPUT_TEMPLATE =

SERIES_ANALYSIS_TC_STAT_INPUT_TEMPLATE =
SERIES_ANALYSIS_TC_STAT_INPUT_TEMPLATE =