Incrementally write to Zarr #6888
Answered
by
spencerkclark
davidbrochart
asked this question in
General
-
A import numpy as np
import xarray as xr
x = np.linspace(0, 10, 100)
y = np.linspace(50, 40, 100)
data = np.random.randn(100, 100)
da = xr.DataArray(data, coords={"y": y, "x": x}, dims=["y", "x"])
da = da.chunk((10, 10))
ds = xr.Dataset({"da": da})
delayed = ds.to_zarr("ds", compute=False)
da[:10, :10] = 1
delayed.compute() But this writes all the chunks, while I'd like to write only one. |
Beta Was this translation helpful? Give feedback.
Answered by
spencerkclark
Aug 8, 2022
Replies: 1 comment 5 replies
-
Have you looked into the |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
davidbrochart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you looked into the
region
keyword argument ofto_zarr
? I think it should allow you to do what you are looking for; see this section of the documentation for an example.