-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ XpySTACAssetReader for reading COG, NetCDF & Zarr STAC assets #87
Conversation
Extend xarray.open_dataset to accept pystac objects!
An implementation of chunked, compressed, N-dimensional arrays for Python!
An iterable-style DataPipe for STAC asset data like Cloud-Optimized GeoTIFFs and Zarr! Uses xpystac for the I/O. Included a doctest and unit test, added a new section in the API docs and some more intersphinx mappings.
Include xpystac and zarr in the 'docs' extras dependencies to fix ReadtheDocs build.
Async http client/server framework (asyncio)! Needed to fix `ModuleNotFoundError: No module named 'aiohttp'` when accessing NetCDF files from https://nasagddp.blob.core.windows.net/nex-gddp-cmip6-references/ACCESS-CM2_historical.json
Mention that xpystac and zarr is installed with the 'raster' extras on the main index.md page. Also mentioned that NetCDF files can be read, and added some blank lines in the XpySTACAssetReader doctest example.
Bump torchdata from 0.4.0 to 0.6.0, Run CI on Python 3.11 and Publish to TestPyPI/PyPI via OIDC.
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.1 to 3.8.4. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.8.1...v3.8.4)
Ensure that a STAC asset pointing to a Zarr file can be loaded using XpySTACAssetReader. Using the Daymet Annual Hawaii STAC Collection at https://planetarycomputer.microsoft.com/dataset/daymet-annual-hi for this unit test. Also edited previous unit test to specify that it is for a Cloud-Optimized GeoTIFF STAC Asset.
docs/index.md
Outdated
| `pip install zen3geo[raster]` | rioxarray, torchdata, xbatcher, xpystac, zarr | | ||
| `pip install zen3geo[spatial]` | rioxarray, torchdata, datashader, spatialpandas | | ||
| `pip install zen3geo[stac]` | rioxarray, torchdata, pystac, pystac-client, stackstac | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debating on whether to put xpystac
under the 'raster' or 'stac' extras 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to go with xpystac
under the 'stac' extras for now (done at commit 49c29b1) since xpystac
depends on pystac
, xarray
, and somewhat optionally on stackstac
, so the Venn diagram overlaps more with the STAC ecosystem than raster-like stuff like xarray and Zarr.
Decided that xpystac fits better under the 'stac' extras, because it depends on just pystac and xarray, and has a somewhat optional dependency on stackstac. This enables a more streamlined I/O option for reading STAC Assets into an xarray.Dataset. Note that Zarr is kept under the 'raster' extras.
Need to use trailing underscores for RST-style URLs, and remove the `pystac.Asset` type hint so that zen3geo works without `pystac` being installed.
An iterable-style DataPipe for STAC asset data like Cloud-Optimized GeoTIFFs, NetCDF and Zarr!
Preview at https://zen3geo--87.org.readthedocs.build/en/87/api.html#zen3geo.datapipes.XpySTACAssetReader
Usage
TODO:
Personally, I've been debating whether to add
xr.open_dataset
and/orxr.open_zarr
to zen3geo for months because:open_zarr
at Deprecate open_zarr in favor of open_dataset(..., engine='zarr') pydata/xarray#7495. Didn't want to wrapopen_zarr
only to have to drop it later.These concerns become moot with the availability of
xr.open_dataset(..., engine="stac")
enabled byxpystac
! It provides a single entrypoint to Zarr, Cloud-Optimized GeoTIFFs, and potentially more STAC Asset based datasets, and since STAC is spatiotemporal (read: geo), this fits naturally within zen3geo 😄References: