Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom target grid to mean climate #973

Merged
merged 5 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 6 additions & 2 deletions pcmdi_metrics/mean_climate/mean_climate_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -129,8 +130,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:
Expand Down