-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature/pyramid reproject map blocks #12
Conversation
updates: - [github.com/pre-commit/pre-commit-hooks: v3.4.0 → v4.1.0](pre-commit/pre-commit-hooks@v3.4.0...v4.1.0) - https://github.com/ambv/black → https://github.com/psf/black - [github.com/psf/black: 20.8b1 → 21.12b0](psf/black@20.8b1...21.12b0) - https://gitlab.com/pycqa/flake8 → https://github.com/PyCQA/flake8 - [github.com/PyCQA/flake8: 3.9.0 → 4.0.1](PyCQA/flake8@3.9.0...4.0.1) - https://github.com/pre-commit/mirrors-isort → https://github.com/PyCQA/isort - [github.com/PyCQA/isort: v5.8.0 → 5.10.1](PyCQA/isort@v5.8.0...5.10.1)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pyramid[lkey] = xr.Dataset(attrs=ds.attrs) | ||
shape = (dim, dim) | ||
for k, da in ds.items(): | ||
template_shape = (chunked_dim_sizes) + shape # TODO: pick up here. |
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.
where is chunked_dim_sizes
supposed to come from?
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.
Good question. Clearly I didn't finish this part.
If I recall correctly, this is mean to support cases where non-spatial dims are chunked. The most common examples would be chunks along the band
or time
dimensions.
To do this, we need to construct a template that includes the correct shape for each block.
Co-authored-by: Anderson Banihirwe <[email protected]>
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Thanks for starting work on this Joe and Anderson! I'm planning to pick this feature up, but since the code base has changed a bunch it'll be easier to work in a fresh PR so I'll close this one now. |
This PR adds a new feature to the
pyramid_reproject
function. Rather than iterating over extra dimensions in each DataArray, we now allow the DataArray to be chunked as a dask.array. Under the hood we usexarray.map_blocks
to execute rioxarray's reproject function.