Skip to content

Commit

Permalink
fix to allow pressure-levels data with one pressure level
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Smretschnig authored and zebengberg committed Nov 22, 2024
1 parent 968c091 commit 1ffdba6
Showing 1 changed file with 2 additions and 2 deletions.
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:
ds = ds.expand_dims(level=self.pressure_levels)

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

0 comments on commit 1ffdba6

Please sign in to comment.