Closed robbibt closed 10 months ago
Attention: 11 lines
in your changes are missing coverage. Please review.
Comparison is base (
eb12c48
) 98.12% compared to head (40330a7
) 97.91%. Report is 12 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
odc/geo/_xr_interop.py | 88.37% | 5 Missing :warning: |
odc/geo/overlap.py | 33.33% | 4 Missing :warning: |
odc/geo/geobox.py | 95.12% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚀 Deployed on https://658f9d0bfef25b2b78f663a8--odc-geo-docs.netlify.app
This is great, thanks Robbi.
Can you please add this method to docs, here:
I think it might be better to expose 2 methods:
.mask(geom, ...options) -> xr.DataArray | xr.Dataset
returning masked result in the source geobox.crop(geom, ...options) -> xr.DataArray | xr.Dataset
returning cropped and possibly masked result@robbibt also when happy with changes please rebase it all to a single commit:
git reset --soft HEAD~<number of commits to merge into one>
git push --force-with-lease
I think it might be better to expose 2 methods:
.mask(geom, ...options) -> xr.DataArray | xr.Dataset
returning masked result in the source geobox.crop(geom, ...options) -> xr.DataArray | xr.Dataset
returning cropped and possibly masked result@robbibt also when happy with changes please rebase it all to a single commit:
git reset --soft HEAD~<number of commits to merge into one>
- commit everything again as a single change this time
- push to github:
git push --force-with-lease
I agree, both a mask
and crop
method would be useful. I'll have another shot soon and will rebase everything after.
@robbibt thanks for this, I think we should merge this as is, we can do further interface polishing, before next release.
Thanks @Kirill888 - should I combine the commits into one again? And what merge option do you use here?
I usually go with Rebase and merge for cleaner history
This PR introduces a new
.odc.crop
method that supports:xarray.Dataset
orxr.DataArray
to the spatial extent of a datacubeGeometry
polygonThis will be very useful for pixel drill workflows that regularly involve a sequence of loading data, cropping to a certain extent using
.sel()
, then rasterizing a polygon and applying it as a mask.I've tested that this works on both datasets and data arrays, and have included a check that the polygon overlaps with the geobox extent. Would welcome any other feedback to make this more robust!