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

ERA5 fix to allow pressure-levels data with one pressure level #276

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions pycontrails/datalib/ecmwf/era5.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ def _preprocess_era5_dataset(self, ds: xr.Dataset) -> xr.Dataset:
LOG.debug("Input dataset processed with pycontrails > 0.29")
return ds

# For "reanalysis-era5-single-levels" or if self.pressure_levels length == 1,
# For "reanalysis-era5-single-levels"
# then the netcdf file does not contain the dimension "level"
if len(self.pressure_levels) == 1:
if "single-levels" in self.dataset:
zebengberg marked this conversation as resolved.
Show resolved Hide resolved
ds = ds.expand_dims(level=self.pressure_levels)

# New CDS-Beta gives "valid_time" instead of "time"
Expand Down
Loading