From 814f822963bf6958eb42037624b15e8d90465564 Mon Sep 17 00:00:00 2001 From: Jakob Smretschnig Date: Fri, 22 Nov 2024 10:11:54 +0100 Subject: [PATCH] improve runtime behavior --- pycontrails/datalib/ecmwf/era5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"