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:
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).
Fixed some minor bugs in xr_interpolate (coordinates where being passed around in the wrong order)
Added extensive automated tests for the xr_interpolate andidw` functions
[x] Remove any unused Python packages from Load packages
[x] Remove any unused/empty code cells
[x] Remove any guidance cells (e.g. General advice)
[x] Ensure that all code cells follow the PEP8 standard for code. The jupyterlab_code_formatter tool can be used to format code cells to a consistent style: select each code cell, then click Edit and then one of the Apply X Formatter options (YAPF or Black are recommended).
[x] Include relevant tags in the final notebook cell (refer to the DEA Tags Index, and re-use tags if possible)
[x] Clear all outputs, run notebook from start to finish, and save the notebook in the state where all cells have been sequentially evaluated
[ ] Test notebook on both the NCI and DEA Sandbox (flag if not working as part of PR and ask for help to solve if needed)
[ ] If applicable, update the Notebook currently compatible with the NCI|DEA Sandbox environment only line below the notebook title to reflect the environments the notebook is compatible with
[x] Check for any spelling mistakes using the DEA Sandbox's built-in spellchecker (double click on markdown cells then right-click on pink highlighted words). For example:
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:
dea_tools.spatial.idw
Inverse Weighted Distance Interpolation function, and updateddea_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).xr_interpolate
(coordinates where being passed around in the wrong order)xr_interpolate and
idw` functionsIDW interpolation example:![image](https://github.com/GeoscienceAustralia/dea-notebooks/assets/17680388/37d84b91-3621-40b5-bb11-c09c2c9c3e14)
Checklist
Load packages
General advice
)jupyterlab_code_formatter
tool can be used to format code cells to a consistent style: select each code cell, then clickEdit
and then one of theApply X Formatter
options (YAPF
orBlack
are recommended).NCI
andDEA Sandbox
(flag if not working as part of PR and ask for help to solve if needed)Notebook currently compatible with the NCI|DEA Sandbox environment only
line below the notebook title to reflect the environments the notebook is compatible with