I have a .nc file with a group structure, one of the groups containing a variable I need to delete.
Using xarray, if I want to delete the variable I can only extract its group as a new .nc file.
ds = xr.load_dataset(path_test,group='/data_01/ku')
ds = ds.drop_vars(["ssh"])
ds.to_netcdf(path_test, mode="a", group='/data_01/ku')
Using bash command ncks (from nco) doing this :
ncks -x -g data_01/ku -v ssh in.nc out.nc
I get a memory error.
Does anyone know how to delete one specific variable while keeping the complete group structure of the file ?
Thanks guys