Closed clausmichele closed 1 year ago
Thanks for taking a stab at this @clausmichele :+1:
The design in #296 would be to load the band data in separate variables so you can do this:
xds = rioxarray.open_rasterio('./results/S2_L2A_data_mod.tiff',band_as_variable=True)
xds["B02"]
This enables storing the description, nodata values, etc separately in the attributes of each variable.
An example implementation is here: https://github.com/bopen/xarray-gdal/blob/main/xarray_gdal/xarray_plugin.py
Ok, second iteration, thanks for the link to xarray_gdal
, it was really helpful!
@clausmichele thanks for working on this. I added some comments and will try to do a more thorough review later.
Okay, this got me down a rabbit hole to a different implementation to preserve the lazy loading (see #600). Want to give it a try and see what you think?
First draft of a possible implementation of
read_variable_as_bands
. @snowman2 what do you think? Is it too naive as an approach?docs/history.rst
for all changes anddocs/rioxarray.rst
for new API