How to concatenate NCDatasets from different files along a new custom-named dimension in Julia?

Viewed 21

I have a set of NetCDF files that have dimensions X, T, Z, T. Each file in the set corresponds to a different "size class" of animal. I would like to create a new "size" dimension and concatenate all these datasets with sizes 1, 2, etc.

Using python and xarray, I believe it would be done like this

import xarray as xr 

ds_1 = xr.open_dataset("size_class_1.nc")
ds_2 = xr.open_dataset("size_class_2.nc")

xr.concat([ds_1, ds_2], "size_dim")

I've looked at the solutions proposed here (https://discourse.julialang.org/t/read-multi-nc-files-along-new-dimension/70696/8) using Rasters and it worked, but is there a way to do it using a custom dimension name, instead of Ti? Or using just NCDatasets?

Thanks!

0 Answers
Related