@@ -133,7 +133,7 @@ def write_serafin(fout, ds):
133
133
if "plan" in ds .dims : # 3D
134
134
slf_header .nb_planes = len (ds .plan )
135
135
slf_header .is_2d = False
136
- shape = (slf_header .nb_var , slf_header .nb_nodes_2d , slf_header .nb_planes )
136
+ shape = (slf_header .nb_var , slf_header .nb_planes , slf_header .nb_nodes_2d )
137
137
else : # 2D (converted if required)
138
138
# if ds.attrs["type"] == "3D":
139
139
# slf_header.is_2d = False # to enable conversion from 3D
@@ -166,7 +166,7 @@ def write_serafin(fout, ds):
166
166
else :
167
167
temp [iv ] = ds .isel (time = it )[var ]
168
168
if slf_header .nb_planes > 1 :
169
- temp [iv ] = np .reshape (np .ravel (temp [iv ]), (slf_header .nb_nodes_2d , slf_header .nb_planes ))
169
+ temp [iv ] = np .reshape (np .ravel (temp [iv ]), (slf_header .nb_planes , slf_header .nb_nodes_2d ))
170
170
resout .write_entire_frame (
171
171
slf_header ,
172
172
t_ ,
@@ -291,8 +291,8 @@ def open_dataset(
291
291
shape = (len (times ), npoin2 )
292
292
dims = ["time" , "node" ]
293
293
else :
294
- shape = (len (times ), npoin2 , nplan )
295
- dims = ["time" , "node " , "plan " ]
294
+ shape = (len (times ), nplan , npoin2 )
295
+ dims = ["time" , "plan " , "node " ]
296
296
297
297
for var in vars :
298
298
if lazy_loading :
@@ -306,7 +306,7 @@ def open_dataset(
306
306
if is_2d :
307
307
data [time_index , :] = values
308
308
else :
309
- data [time_index , :, :] = np .reshape (values , (nplan , npoin2 )). T
309
+ data [time_index , :, :] = np .reshape (values , (nplan , npoin2 ))
310
310
data_vars [var ] = xr .Variable (dims = dims , data = data )
311
311
312
312
coords = {
0 commit comments