Skip to content

Instantly share code, notes, and snippets.

@jhamman
Last active February 27, 2020 21:36
Show Gist options
  • Save jhamman/ad375c1b8a35388f3c591759751f4034 to your computer and use it in GitHub Desktop.
Save jhamman/ad375c1b8a35388f3c591759751f4034 to your computer and use it in GitHub Desktop.
streaming-zarr-blog
store = zarr.RedisStore(port=args.port)
root = zarr.group(store=store, overwrite=True)
t = 0
while True:
arr = root.zeros(f"{t}", shape=grid.shape, chunks=(25, 25)) # create a new array for this timestep
arr[…] = grid # write data to zarr array
t += 1 # increment the time counter
time.sleep(update_interval)
grid = update(grid, N) # evolve the model one time step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment