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

Extend preprocessor multi_model_statistics to handle data with "altitude" coordinate #1010

Merged
merged 2 commits into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion esmvalcore/preprocessor/_multimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ def _put_in_cube(template_cube, cube_data, statistic, t_axis):
cspec = [(times, 0), (lats, 1), (lons, 2)]
# plevs
elif len(template_cube.shape) == 4:
plev = template_cube.coord('air_pressure')
if 'air_pressure' in coord_names:
plev = template_cube.coord('air_pressure')
elif 'altitude' in coord_names:
plev = template_cube.coord('altitude')
axel-lauer marked this conversation as resolved.
Show resolved Hide resolved
else:
raise ValueError(f"4D cube with dimensions {coord_names} not "
f"supported at the moment")
cspec = [(times, 0), (plev, 1), (lats, 2), (lons, 3)]
elif len(template_cube.shape) == 1:
cspec = [
Expand Down