diff --git a/docs/Users_Guide/glossary.rst b/docs/Users_Guide/glossary.rst index c09cb4175c..e2804652b7 100644 --- a/docs/Users_Guide/glossary.rst +++ b/docs/Users_Guide/glossary.rst @@ -7858,3 +7858,10 @@ METplus Configuration Glossary Specify the value for 'hss_ec_value' in the MET configuration file for StatAnalysis. | *Used by:* StatAnalysis + + TCMPR_PLOTTER_READ_ALL_FILES + If True, pass in input directory set by :term:`TCMPR_PLOTTER_TCMPR_DATA_DIR` + to the script. If False, a list of all files that end with .tcst in the input + directory is gathered and passed into the script. Defaults to False. + + | *Used by:* TCMPRPlotter diff --git a/docs/Users_Guide/wrappers.rst b/docs/Users_Guide/wrappers.rst index 95e69bdc5c..6b1dd4ad37 100644 --- a/docs/Users_Guide/wrappers.rst +++ b/docs/Users_Guide/wrappers.rst @@ -6517,6 +6517,7 @@ METplus Configuration | :term:`TCMPR_PLOTTER_SAVE_DATA` | :term:`TCMPR_PLOTTER_DEP_LABELS` | :term:`TCMPR_PLOTTER_PLOT_LABELS` +| :term:`TCMPR_PLOTTER_READ_ALL_FILES` | The following are TCMPR flags, if set to 'no', then don't set flag, if diff --git a/metplus/wrappers/tcmpr_plotter_wrapper.py b/metplus/wrappers/tcmpr_plotter_wrapper.py index 65bd9b2479..9ac09cef7f 100755 --- a/metplus/wrappers/tcmpr_plotter_wrapper.py +++ b/metplus/wrappers/tcmpr_plotter_wrapper.py @@ -117,6 +117,11 @@ def create_c_dict(self): c_dict['LOOP_INFO'] = self.read_loop_info() c_dict['LOOP_ARGS'] = {} + # get option to pass input directory instead of finding .tcst files + c_dict['READ_ALL_FILES'] = ( + self.config.getbool('config', 'TCMPR_PLOTTER_READ_ALL_FILES', False) + ) + return c_dict def read_optional_args(self): @@ -272,6 +277,10 @@ def get_input_files(self): # input is directory, so find all tcst files to process self.logger.debug(f'Plotting all files in: {input_data}') + if self.c_dict['READ_ALL_FILES']: + self.logger.debug('Passing in directory to R script') + return [input_data] + input_files = util.get_files(input_data, ".*.tcst") self.logger.debug(f"Number of files: {len(input_files)}") return sorted(input_files) diff --git a/parm/use_cases/met_tool_wrapper/TCMPRPlotter/TCMPRPlotter.conf b/parm/use_cases/met_tool_wrapper/TCMPRPlotter/TCMPRPlotter.conf index 243bfa11a6..ccf92158fa 100644 --- a/parm/use_cases/met_tool_wrapper/TCMPRPlotter/TCMPRPlotter.conf +++ b/parm/use_cases/met_tool_wrapper/TCMPRPlotter/TCMPRPlotter.conf @@ -22,6 +22,7 @@ INIT_INCREMENT = 6H TCMPR_PLOTTER_TCMPR_DATA_DIR = {INPUT_BASE}/met_test/tc_pairs/{date?fmt=%Y%m} TCMPR_PLOTTER_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/tcmpr_plots +#TCMPR_PLOTTER_READ_ALL_FILES = True # Plot_TCMPR options, if left unset, default values that are # pre-defined in the R utility (packaged with MET) will be used.