diff --git a/pcmdi_metrics/mean_climate/lib/create_mean_climate_parser.py b/pcmdi_metrics/mean_climate/lib/create_mean_climate_parser.py index ab5861051..02719bd73 100644 --- a/pcmdi_metrics/mean_climate/lib/create_mean_climate_parser.py +++ b/pcmdi_metrics/mean_climate/lib/create_mean_climate_parser.py @@ -186,6 +186,7 @@ def create_mean_climate_parser(): dest="custom_observations", help="Path to an alternative, custom observation file", required=False, + default="" ) parser.add_argument( diff --git a/pcmdi_metrics/mean_climate/mean_climate_driver.py b/pcmdi_metrics/mean_climate/mean_climate_driver.py index 3eac17b48..a489be9dc 100755 --- a/pcmdi_metrics/mean_climate/mean_climate_driver.py +++ b/pcmdi_metrics/mean_climate/mean_climate_driver.py @@ -46,6 +46,7 @@ reference_data_path = parameter.reference_data_path metrics_output_path = parameter.metrics_output_path diagnostics_output_path = parameter.diagnostics_output_path +custom_obs = parameter.custom_observations debug = parameter.debug cmec = parameter.cmec @@ -122,8 +123,11 @@ # load obs catalogue json egg_pth = resources.resource_path() -obs_file_name = "obs_info_dictionary.json" -obs_file_path = os.path.join(egg_pth, obs_file_name) +if len(custom_obs) > 0: + obs_file_path = custom_obs +else: + obs_file_name = "obs_info_dictionary.json" + obs_file_path = os.path.join(egg_pth, obs_file_name) with open(obs_file_path) as fo: obs_dict = json.loads(fo.read()) # if debug: