Skip to content

Commit

Permalink
🏁 Correct shift of training tiles by half a pixel
Browse files Browse the repository at this point in the history
Adjusting the bounding box positions of (some) tiles by half a pixel (roughly 500m). Fixed a poorly written unit test for the data_prep.get_window_bounds function introduced in ab0295e right before release v0.4.0, and refactored the function to make it work correctly with newer libraries. Strangely enough, after recreating the geojson tiles, the coordinate changes are only for the Operation Ice Bridge/CRESIS Basler and TO grids, and we still have exactly 2347 tiles!

Specifically, we've switched from using xarray.open_rasterio to xarray.open_dataarray as xarray's rasterio backend fails to read NetCDF georeferencing information properly with rasterio >= 1.0.14 (see #84). The projection information is monkey-patched into the xarray grid using salem. Most important bit is to ensure that we go from xarray's centre-based pixel coordinate system to rasterio's corner-based pixel coordinate system (accomplished with dataset.salem.grid.corner_grid) via a manually set Affine transformation.
  • Loading branch information
weiji14 committed Jun 4, 2019
1 parent 6969a88 commit 9d8ebdf
Show file tree
Hide file tree
Showing 5 changed files with 1,364 additions and 1,337 deletions.
Loading

0 comments on commit 9d8ebdf

Please sign in to comment.