Skip to content

Commit

Permalink
per #2540, set -goes_qc command line argument from POINT2GRID_GOES_QC…
Browse files Browse the repository at this point in the history
…_FLAGS and continue to support legacy POINT2GRID_QC_FLAGS. Other fixes to resolve incorrectly resolved conflicts from previous commit merging develop into branch
  • Loading branch information
georgemccabe committed Oct 2, 2024
1 parent 8e8f29b commit 0676c86
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
7 changes: 6 additions & 1 deletion docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ METplus Configuration Glossary
| *Used by:* Point2Grid
POINT2GRID_QC_FLAGS
.. warning:: **DEPRECATED:** Please use :term:`POINT2GRID_OBS_QUALITY_INC`.
.. warning:: **DEPRECATED:** Please use :term:`POINT2GRID_GOES_QC_FLAGS`.

| *Used by:* Point2Grid
POINT2GRID_GOES_QC_FLAGS
Sets the value for the -goes_qc command line argument for Point2Grid.

| *Used by:* Point2Grid
Expand Down
1 change: 1 addition & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6862,6 +6862,7 @@ METplus Configuration
| :term:`POINT2GRID_REGRID_TO_GRID`
| :term:`POINT2GRID_INPUT_FIELD`
| :term:`POINT2GRID_INPUT_LEVEL`
| :term:`POINT2GRID_GOES_QC_FLAGS`
| :term:`POINT2GRID_ADP`
| :term:`POINT2GRID_REGRID_METHOD`
| :term:`POINT2GRID_GAUSSIAN_DX`
Expand Down
6 changes: 4 additions & 2 deletions internal/tests/pytests/wrappers/point2grid/test_point2grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_point2grid_missing_inputs(metplus_config, get_test_data_dir,
({'POINT2GRID_VLD_THRESH': '0.5'}, {}, ['-vld_thresh 0.5']),
({'POINT2GRID_ADP': '{valid?fmt=%Y%m}.nc'}, {}, ['-adp 201706.nc']),
({'POINT2GRID_REGRID_TO_GRID': 'G212'}, {}, []),
({'POINT2GRID_REGRID_TO_GRID': 'lambert 614 428 12.190 -133.459 -95.0 12.19058 6367.47 25.0 N'}, []),
({'POINT2GRID_REGRID_TO_GRID': 'lambert 614 428 12.190 -133.459 -95.0 12.19058 6367.47 25.0 N'}, {}, []),
({'POINT2GRID_INPUT_LEVEL': '(*,*)'}, {}, []),
({'POINT2GRID_VALID_TIME': '20240509_120800', },
{'METPLUS_VALID_TIME': 'valid_time = "20240509_120800";'}, []),
Expand Down Expand Up @@ -123,7 +123,9 @@ def test_point2grid_missing_inputs(metplus_config, get_test_data_dir,
({'POINT2GRID_OBS_QUALITY_EXC': '3,4, 5', },
{'METPLUS_OBS_QUALITY_EXC': 'obs_quality_exc = ["3", "4", "5"];'}, []),
({'POINT2GRID_QC_FLAGS': '0,1'}, ['-goes_qc 0,1']),
({'POINT2GRID_GOES_QC_FLAGS': '0,1'}, {}, ['-goes_qc 0,1']),
({'POINT2GRID_QC_FLAGS': '0,1'}, {}, ['-goes_qc 0,1']),
({'POINT2GRID_GOES_QC_FLAGS': '0,1', 'POINT2GRID_QC_FLAGS': '2,3'}, {}, ['-goes_qc 0,1']),
({'POINT2GRID_TIME_OFFSET_WARNING': '5', },
{'METPLUS_TIME_OFFSET_WARNING': 'time_offset_warning = 5;'}, []),
Expand Down
15 changes: 10 additions & 5 deletions metplus/wrappers/point2grid_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def create_c_dict(self):
'POINT2GRID_INPUT_LEVEL',
'')

# support legacy QC_FLAGS and new GOES_QC_FLAGS to set -goes_qc arg
config_name = self.config.get_mp_config_name(['POINT2GRID_GOES_QC_FLAGS',
'POINT2GRID_QC_FLAGS'])
if config_name:
c_dict['GOES_QC_FLAGS'] = self.config.getraw('config', config_name)

c_dict['ADP'] = self.config.getraw('config', 'POINT2GRID_ADP')

c_dict['REGRID_METHOD'] = self.config.getstr('config',
Expand Down Expand Up @@ -123,14 +129,10 @@ def create_c_dict(self):
self.add_met_config(name='obs_quality_inc', data_type='list',
metplus_configs=['POINT2GRID_OBS_QUALITY_INC',
'POINT2GRID_OBS_QUALITY_INCLUDE',
'POINT2GRID_OBS_QUALITY',
'POINT2GRID_QC_FLAGS'])
'POINT2GRID_OBS_QUALITY'])
self.add_met_config(name='obs_quality_exc', data_type='list',
metplus_configs=['POINT2GRID_OBS_QUALITY_EXC',
'POINT2GRID_OBS_QUALITY_EXCLUDE'])

# skip RuntimeFreq input file logic - remove once integrated
c_dict['FIND_FILES'] = False
return c_dict

def find_input_files(self, time_info):
Expand Down Expand Up @@ -171,6 +173,9 @@ def set_command_line_arguments(self, time_info):
config_file = do_string_sub(self.c_dict['CONFIG_FILE'], **time_info)
self.args.append(f'-config {config_file}')

if self.c_dict.get('GOES_QC_FLAGS', '') != '':
self.args.append(f"-goes_qc {self.c_dict['GOES_QC_FLAGS']}")

if self.c_dict['ADP']:
self.args.append(f"-adp {self.c_dict['ADP']}")

Expand Down

0 comments on commit 0676c86

Please sign in to comment.