-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add spatial interpolation with xr_interpolate
notebook
#1233
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
LGTM, really useful notebook with lots of cool bits. Only comments would be, when referring to 'z' value, you could keep describing it as 'our variable of interest z' or similar as I kept thinking it was elevation (it could be elevation) because of naming conventions, and that I think that the IDW power parameter is often referred to as 'p', yet we refer to it as 'k'. I think that's ok, as long as we are consistent. Overall its beautiful, useful, and well documented, and I'm happy to approve as is.
Yep, great suggestion! Will update, thanks @BexDunn! |
* Add updated `xr_regression` function for multi-dimensional linear regression (#1226) * Add updated xr_regression function * Add dask support for lazy computation * Set dtypes * Update docstring * Update docstring * Add MAD outliers * Update docstring * Remove lag functionality * Update docstrings * Add better error handling * Update stream gauge corr notebook to use new func * Adding DEAfrica Wetland Turbidity notebook for Australian study site (#1175) * Adding DEAfrica Wetland Turbidity notebook for Australian study site * change all instances of NDTI to NDTI2 to reflect usage at top of notebook * update notebook to use Collection 3 WO Statistics * rerun notebook --------- Co-authored-by: BexDunn <bex.dunn@ga.gov.au> * Add spatial interpolation with `xr_interpolate` notebook (#1233) * Add ensemble tide modelling functionality to model_tides * Update test_coastal.py * Remove test * Updates to IDW, xr_interpolate and ensemble tide modelling code" * Doco updates * Switch ensemble rankings from high to low = good * Update docstring * Fix doco * Add interpolation notebook * Remove coastal files from branch * Add points data * Review feedback; * Add p param to IDW * Fix test * Updates to product notebook Knowledge Hub links and DEA notebook content (#1221) * Move KH links into consistent alert box format * Update DEA notebook * Minor wording updates * Minor wording * Temporarily remove STAC notebook from tests * Add ensemble tide modelling functionality to `model_tides` (#1231) * Add ensemble tide modelling functionality to model_tides * Update test_coastal.py * Remove test * Updates to IDW, xr_interpolate and ensemble tide modelling code" * Doco updates * Switch ensemble rankings from high to low = good * Update docstring * Fix doco * Add interpolation notebook --------- Co-authored-by: Matt-dea <129345253+Matt-dea@users.noreply.github.com> Co-authored-by: BexDunn <bex.dunn@ga.gov.au>
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://private-user-images.githubusercontent.com/17680388/338793257-37d84b91-3621-40b5-bb11-c09c2c9c3e14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NjkyNDUsIm5iZiI6MTcyMDQ2ODk0NSwicGF0aCI6Ii8xNzY4MDM4OC8zMzg3OTMyNTctMzdkODRiOTEtMzYyMS00MGI1LWJiMTEtYzA5YzJjOWMzZTE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDIwMDIyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ5YzkxZDJlMWUxOTVmZGU4YTc5ZDUxODNhOWJmZGQ0NjUzNTIzMWVjOGJkMjQ1MGJhNDE3NTZlZDJhZDkwZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mc3Spbn-hDOyTblJwOAS_WAl-2QKnimSgkWEc_t3jcI)
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