Skip to content
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

fix: bump rasterio and correctly reproject ukcp18 2.2km #17

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

ciaransweet
Copy link

@ciaransweet ciaransweet commented Sep 9, 2024

What this PR is

Thanks to @j08lue and his rasterio magic abilities, this PR implements a fix which correctly handles rotated pole coordinates for the UKCP18 2.2km data

It bumps rasterio to >=1.4b1 so as to be able to use the src_geoloc_array parameter in rasterio.warp.reproject

How you can test it

I've updated the notebook to show examples of all resolution/domain variants and the results saved in the notebook are a 2.2km run

However you can also see the correct alignment here:

Screen.Recording.2024-09-09.at.09.58.42.mov

@ciaransweet ciaransweet requested a review from j08lue September 9, 2024 08:59
Copy link
Member

@j08lue j08lue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the notebook and then converted the resulting Zarr (Xarray version) to GeoTIFF for checking in QGIS with

import xarray as xr
import rioxarray
import zarr

store = zarr.DirectoryStore("./src/test/test_output/hazard/hazard.zarr/chronic_heat/osc/v2/days_tas_above_15c_ukcp18_rcp85_2030_xarray")
ds = xr.open_dataset(store, engine="zarr")
ds.rio.to_raster("days_tas_above_15c_ukcp18_rcp85_2030.tif")

and can confirm that the output is correctly georeferenced.

@ciaransweet ciaransweet merged commit 45e35e2 into main Sep 10, 2024
3 checks passed
@ciaransweet ciaransweet deleted the ukcp18-2-2km-fix branch September 10, 2024 12:49
ciaransweet added a commit that referenced this pull request Sep 10, 2024
* fix: bump rasterio and correctly reproject ukcp18 2.2km

* feat: bump cwl image

* Fix env var name and use pathlib

---------

Co-authored-by: j08lue <[email protected]>
Signed-off-by: Ciaran Sweet <[email protected]>
ciaransweet added a commit that referenced this pull request Nov 4, 2024
…mate#124)

* fix: bump rasterio and correctly reproject ukcp18 2.2km

* feat: bump cwl image

* Fix env var name and use pathlib

---------

Signed-off-by: Ciaran Sweet <[email protected]>
Co-authored-by: j08lue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants