diff --git a/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py b/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py index 2b7e9ed0f..909baa88d 100644 --- a/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py +++ b/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py @@ -189,6 +189,12 @@ def test_find_input_files(metplus_config, offsets, offset_to_find): 'OBS_PB2NC_WINDOW_END': '1800', }, {'METPLUS_OBS_WINDOW_DICT': 'obs_window = {beg = -1800;end = 1800;}'}), + # test legacy PB2NC_WINDOW_[BEGIN/END] + ({'PB2NC_WINDOW_BEGIN': '-1800', }, + {'METPLUS_OBS_WINDOW_DICT': 'obs_window = {beg = -1800;}'}), + + ({'PB2NC_WINDOW_END': '1800', }, + {'METPLUS_OBS_WINDOW_DICT': 'obs_window = {end = 1800;}'}), ({'PB2NC_MASK_GRID': 'FULL', }, {'METPLUS_MASK_DICT': 'mask = {grid = "FULL";}'}), diff --git a/metplus/util/met_config.py b/metplus/util/met_config.py index 55e753883..2b99e5410 100644 --- a/metplus/util/met_config.py +++ b/metplus/util/met_config.py @@ -165,6 +165,12 @@ def add_met_config_dict(config, app_name, output_dict, dict_name, items): metplus_configs.append( f"OBS_{app_name}_WINDOW_{suffix}".upper() ) + + # also add support for legacy PB2NC_WINDOW_[BEGIN/END] + metplus_configs.append( + f"{app_name}_WINDOW_{suffix}".upper() + ) + # also add OBS_WINDOW_[BEGIN/END] metplus_configs.append(f"OBS_WINDOW_{suffix}") diff --git a/metplus/wrappers/command_builder.py b/metplus/wrappers/command_builder.py index 29214acfc..c0c7d0475 100755 --- a/metplus/wrappers/command_builder.py +++ b/metplus/wrappers/command_builder.py @@ -328,9 +328,11 @@ def handle_obs_window_legacy(self, c_dict): ('END', 5400)] app = self.app_name.upper() + # check {app}_WINDOW_{edge} to support PB2NC_WINDOW_[BEGIN/END] for edge, default_val in edges: input_list = [f'OBS_{app}_WINDOW_{edge}', f'{app}_OBS_WINDOW_{edge}', + f'{app}_WINDOW_{edge}', f'OBS_WINDOW_{edge}', ] output_key = f'OBS_WINDOW_{edge}'