What is your issue?
When I overwrite a zarr using mode='w' (that I've modified), all the unmodified data in the zarr is converted to nan. Perhaps I've misunderstood the purpose of mode='w', but I thought it would just overwrite with whatever data is in the zarr when it's open in xarray and being saved?
An example is as follows:
# open the file and check the contents
ds_ex = xr.open_zarr('/scratch/bweeding/AMOS_2026_wind_data/franklin_square/CSIRO_BOM_ACCESS1_0/MBCn/2040_2060/example.zarr')
ds_ex.UTCI.isel(timestamp=5).plot()
ds_ex.Tmrt.isel(timestamp=5).plot()
# modify some data and check the contents
ds['UTCI'] = ds.UTCI*20
ds_ex.UTCI.isel(timestamp=5).plot()
ds_ex.Tmrt.isel(timestamp=5).plot()
# overwrite , reopen, and check
ds_ex.to_zarr('/scratch/bweeding/AMOS_2026_wind_data/franklin_square/CSIRO_BOM_ACCESS1_0/MBCn/2040_2060/example.zarr',mode='w')
ds_ex = xr.open_zarr('/scratch/bweeding/AMOS_2026_wind_data/franklin_square/CSIRO_BOM_ACCESS1_0/MBCn/2040_2060/example.zarr')
ds_ex.UTCI.isel(timestamp=5).plot()
ds_ex.Tmrt.isel(timestamp=5).plot()
Have I misunderstood what w does? Or is this a bug?
Cheers
Ben
example.zarr.zip
What is your issue?
When I overwrite a zarr using mode='w' (that I've modified), all the unmodified data in the zarr is converted to nan. Perhaps I've misunderstood the purpose of mode='w', but I thought it would just overwrite with whatever data is in the zarr when it's open in xarray and being saved?
An example is as follows:
ds_ex.Tmrt.isel(timestamp=5).plot()ds_ex.Tmrt.isel(timestamp=5).plot()ds_ex.Tmrt.isel(timestamp=5).plot()Have I misunderstood what w does? Or is this a bug?
Cheers
Ben
example.zarr.zip