Skip to content

Commit 43ca2a1

Browse files
Removing batch dimension in postprocessing
1 parent 834be9b commit 43ca2a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gencast_fp/postprocess/gencast_cf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ def proc_time_step(
185185
f"{tstamp}_res-1.0_levels-13{suffix}"
186186

187187
output_dir.mkdir(parents=True, exist_ok=True)
188-
ds.to_netcdf(output_dir / fname, encoding=encoding, engine="netcdf4")
188+
189+
# removing batch dimension during postprocessing
190+
ds.isel(batch=0).to_netcdf(
191+
output_dir / fname,
192+
encoding=encoding,
193+
engine="netcdf4"
194+
)
189195
return
190196

191197

0 commit comments

Comments
 (0)