GeoscienceAustralia / dea-notebooks

Repository for Digital Earth Australia Jupyter Notebooks: tools and workflows for geospatial analysis with Open Data Cube and Xarray
https://docs.dea.ga.gov.au/notebooks/
Apache License 2.0
433 stars 127 forks source link

Add spatial interpolation with `xr_interpolate` notebook #1233

Closed robbibt closed 1 month ago

robbibt commented 1 month ago

Proposed changes

This PR updates the xr_interpolate function with new interpolation functionality, and adds a new Jupyter Notebook guide to using the function to spatially interpolate data.

Key changes include:

  1. Added a new dea_tools.spatial.idw Inverse Weighted Distance Interpolation function, and updated dea_tools.spatial.xr_interpolate to use this instead of previous bespoke code. Supports spatially interpolating both 1D and 2D input values (e.g. interpolating one or multiple datasets into the spatial extents of another).
  2. Fixed some minor bugs in xr_interpolate (coordinates where being passed around in the wrong order)
  3. Added extensive automated tests for the xr_interpolate andidw` functions

IDW interpolation example: image

Checklist

sandbox_spellchecker

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

robbibt commented 1 month ago

Yep, great suggestion! Will update, thanks @BexDunn!