zarr-developers / geozarr-spec

This document aims to provides a geospatial extension to the Zarr specification. Zarr specifies a protocol and format used for storing Zarr arrays, while the present extension defines conventions and recommendations for storing multidimensional georeferenced grid of geospatial observations (including rasters).
106 stars 10 forks source link

Creating xarray friendly zarr file of geospatial data #9

Closed Marston closed 1 year ago

Marston commented 1 year ago

I would like to read a grib file and create from the records a 5D tensor array: ('time', 'name', 'lev', 'lat', 'lon'). I can create this easily in zarr by creating a dataset and load it by looping over the dimension, name. This creates a nice zarr but xarray cannot read it because of some missing dimension issues. I have all the metadata, I just need an example of how to write georeferenced data to zarr. There doesn't seem to be any docs or code in this repo. Can someone point me in the right direction?

briannapagan commented 1 year ago

Hi @Marston this might be useful: https://nbviewer.org/gist/rsignell-usgs/a047178ee12d44c2a7900ee86ba2fbc7 Going to CC: @lsterzinger and @rsignell-usgs

lsterzinger commented 1 year ago

Hi @Marston, Kerchunk would be a good option I think for your usecase (this is what @briannapagan linked, though it was called fsspec_reference_maker at the time). Some of the API has changed since, especially concerning kerchunk.combine.MultiZarrToZarr: https://fsspec.github.io/kerchunk/tutorial.html#combine-multiple-kerchunked-datasets-into-a-single-logical-aggregate-dataset

Marston commented 1 year ago

Hi @lsterzinger and @briannapagan Thanks for the suggestions. I'll take a look at it. It is very interesting indeed.

rsignell-usgs commented 1 year ago

@Marston did you have success?

Marston commented 1 year ago

@rsignell-usgs I have was successful but not using kerchunk. I work in an agile environment and the ticket I had was completed. Nevertheless, I've flagged kerchunk as something to research.