I read many nc files into xarray and write them into zarr. For thesenc files, if I read and write the later time file first. I found the time sequece is by the order I read, not the data time order. How can I set the data time order in zarr? Such as I read time=f378 before time=f120, but I want in zarr time=f120 prior to time=f378 in zarr
...
v = 'gfs.2021032400_gfs.t00z.pgrb2.0p25.f378.nc'
...
d = 'gfs.2021032400.zarr'
xr.open_dataset(v, engine='netcdf4')
if os.path.exists(d):
r = v.to_zarr(d, mode='a', append_dim='time')
else:
os.makedirs(d)
r = v.to_zarr(d, mode='w')
I read many nc files into xarray and write them into zarr. For thesenc files, if I read and write the later time file first. I found the time sequece is by the order I read, not the data time order. How can I set the data time order in zarr? Such as I read time=f378 before time=f120, but I want in zarr time=f120 prior to time=f378 in zarr
the nc file information is like this:
Here is what I read from zarr: