diff --git a/pycontrails/datalib/ecmwf/era5.py b/pycontrails/datalib/ecmwf/era5.py index 5ed9eea3..3a00ab84 100644 --- a/pycontrails/datalib/ecmwf/era5.py +++ b/pycontrails/datalib/ecmwf/era5.py @@ -541,7 +541,7 @@ def _preprocess_era5_dataset(self, ds: xr.Dataset) -> xr.Dataset: # For "reanalysis-era5-single-levels" # then the netcdf file does not contain the dimension "level" - if "single-levels" in self.dataset: + if self.is_single_level: ds = ds.expand_dims(level=self.pressure_levels) # New CDS-Beta gives "valid_time" instead of "time"