@@ -39,13 +39,15 @@ def download(download_path: Path, progress: bool = True):
3939 )
4040 downloadfile = download_path / "ifs_uncompressed.zarr"
4141 with monitor .progress_bar (progress ):
42- ds_regridded .to_zarr (
43- downloadfile , mode = "w" , encoding = dict (), compute = False
44- ).compute ()
42+ ds_regridded .to_zarr (downloadfile , mode = "w" , compute = False ).compute ()
4543
4644 @staticmethod
4745 def open (download_path : Path ) -> xr .Dataset :
48- ds = xr .open_dataset (download_path / "ifs_uncompressed.zarr" )
46+ ds = (
47+ xr .open_dataset (download_path / "ifs_uncompressed.zarr" )
48+ .drop_encoding ()
49+ .chunk (- 1 )
50+ )
4951
5052 # Needed to make the dataset CF-compliant.
5153 ds .longitude .attrs ["axis" ] = "X"
@@ -106,7 +108,11 @@ def load_hplp_data(leveltype=None, gridtype=None, step=None, remap=False):
106108 return xr .open_dataset (
107109 "reference://" ,
108110 engine = "zarr" ,
109- backend_kwargs = dict (storage_options = dict (fo = ref , asynchronous = False )),
111+ backend_kwargs = dict (
112+ storage_options = dict (
113+ fo = ref , asynchronous = False , remote_options = dict (ssl = False )
114+ )
115+ ),
110116 consolidated = False ,
111117 )
112118
@@ -149,9 +155,9 @@ def regrid_to_regular(ds, in_grid, out_grid):
149155 out_data [var ].append (r )
150156
151157 dx = out_grid ["grid" ][0 ]
152- assert (
153- out_grid [ "grid" ][ 0 ] == out_grid [ "grid" ][ 1 ]
154- ), "Only grids with equal latitude and longitude spacing are supported."
158+ assert out_grid [ "grid" ][ 0 ] == out_grid [ "grid" ][ 1 ], (
159+ "Only grids with equal latitude and longitude spacing are supported."
160+ )
155161 lats = np .linspace (90 , - 90 , int (180 / dx ) + 1 )
156162 lons = np .linspace (0 , 360 - dx , int (360 / dx ))
157163 coords = {
0 commit comments