Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Last active March 28, 2026 21:21
Show Gist options
  • Select an option

  • Save mdsumner/95200c550eb1edb1d7adb2a0b87816b8 to your computer and use it in GitHub Desktop.

Select an option

Save mdsumner/95200c550eb1edb1d7adb2a0b87816b8 to your computer and use it in GitHub Desktop.

New chunk read in https://github.com/hypertidy/zaro

library(zaro)
store <- zaro("virtualizarr://https://raw.githubusercontent.com/mdsumner/virtualized/refs/heads/main/remote/ocean_temp_2023.parq")
#> [zaro] opening VirtualiZarr Parquet reference store: https://raw.githubusercontent.com/mdsumner/virtualized/refs/heads/main/remote/ocean_temp_2023.parq
meta <- attr(zaro_meta(store), "consolidated")$temp
#> [zaro] found .zmetadata (Zarr V2 consolidated)
#> [zaro]   11 arrays: Time, Time_bnds, average_DT, average_T1, average_T2, nv, st_edges_ocean, st_ocean, temp, xt_ocean, yt_ocean

info <- zaro_chunk_info(store, "temp", meta = meta)
par(mfrow = info$grid[3:4], mar = rep(0, 4))
flip <- function(x) x[nrow(x):1, ]

for (j in rev((seq_len(info$grid[3])-1))) {
for (i in (seq_len(info$grid[4])-1)) {  
  z <- zaro_chunk(store, "temp", c(0, 40, j, i), meta = meta)
  ximage::ximage(flip(z$values[1,1,,]))
}}

Created on 2026-03-28 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment