openradar / xradar

A tool to work in weather radar data in xarray
https://docs.openradarscience.org/projects/xradar
MIT License
85 stars 17 forks source link

open_datatree_from_Zarr (?) #171

Open aladinor opened 2 months ago

aladinor commented 2 months ago

Description

Hi everyone,

I was wondering if we should create an io method that allows us to read zarr back to xradar. Something like xradar.io.open_zarr given that we can now store/save the xradar hierarchical structure object using zarr.

Please let me know your thoughts.

kmuehlbauer commented 2 months ago

@aladinor doesn't this work out-of-the-box with datatree? If I'm reading the documentation https://xarray-datatree.readthedocs.io/en/latest/io.html?highlight=zarr#zarr this should just work, no?

There is also work currently to integrate datatree into xarray pushed by NASA, NSIDC: https://github.com/pydata/xarray/projects/9

There is a weekly open dev meeting for that purpose, if you are interested: https://github.com/pydata/xarray/issues/8747

But good chance I'm missing something, so please give a bit more detail.

aladinor commented 2 months ago

Hi @kmuehlbauer. Well, I was thinking of a wrapper that uses datatree functionality to read Zarr files back into xradar. I'm not sure if I could call it a "backend" for reading Zarr files within xradar. Currently, if we want to read data, we have to use datatree.open_datatree, which is okay, but I was thinking of something like xradar.io.open_datatree. I wasn't thinking about a whole development. Sorry for the misunderstanding.

Something like

def open_datatree(path, **kwargs):
    """Function that opens datatree within xradar"""
    return datatree.open_datatree(path, kwargs)

Let me know your thoughts