Skip to content

Commit

Permalink
Merge pull request #1660 from dtcenter/bugfix_1623_main_v4.1_point2grid
Browse files Browse the repository at this point in the history
Bugfix 1623 main v4.1 point2grid
  • Loading branch information
hankenstein2 authored Jun 14, 2022
2 parents 30e36e1 + c90be36 commit 56cdbac
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
40 changes: 40 additions & 0 deletions internal_tests/pytests/point2grid/test_point2grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,44 @@ def test_set_command_line_arguments(metplus_config):

wrap.args.clear()

wrap.c_dict['QC_FLAGS'] = 1

expected_args = ['-qc 1',
'-method UW_MEAN',
'-gaussian_dx 2',
'-gaussian_radius 3',
'-prob_cat_thresh 1',
'-vld_thresh 0.5',
]

wrap.set_command_line_arguments(time_info)
if wrap.args != expected_args:
test_passed = False
print("Test 5 failed")
print(f"ARGS: {wrap.args}")
print(f"EXP: {expected_args}")

wrap.args.clear()

wrap.c_dict['ADP'] = 'test.nc'

expected_args = ['-qc 1',
'-adp test.nc',
'-method UW_MEAN',
'-gaussian_dx 2',
'-gaussian_radius 3',
'-prob_cat_thresh 1',
'-vld_thresh 0.5',
]

wrap.set_command_line_arguments(time_info)
if wrap.args != expected_args:
test_passed = False
print("Test 6 failed")
print(f"ARGS: {wrap.args}")
print(f"EXP: {expected_args}")

wrap.args.clear()


assert(test_passed)
4 changes: 2 additions & 2 deletions metplus/wrappers/point2grid_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def set_command_line_arguments(self, time_info):
self.args.append(f"-field 'name=\"{input_field}\"; level=\"{input_level}\";'")

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

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

if self.c_dict['REGRID_METHOD']:
self.args.append(f"-method {self.c_dict['REGRID_METHOD']}")
Expand Down

0 comments on commit 56cdbac

Please sign in to comment.