ua-snap / cmip6-utils

Pipelines and utilites for working with CMIP6 data
0 stars 1 forks source link

Make regridded files GIS compatible #25

Closed kyleredilla closed 3 months ago

kyleredilla commented 4 months ago

We should try to add the necessary information to allow regridded files to open. See the wrf_utils repo for how to do this.

BobTorgerson commented 4 months ago

https://github.com/ua-snap/wrf_utils/blob/a11ed99a9a9128a17d957b2601e78859472d6b5a/restack_20km/restack.py#L413-L424

Joshdpaul commented 4 months ago

Made a bunch of progress on this. The indicators outputs seem to open fine in ArcPro when using their NetCDF toolset. For QGIS, we need to manually (or use rioxarray) to add CF-compliant CRS info to the .nc files. The relevant CRS info is included in both the attributes AND the encoding!

See this notebook for a workflow to add the right CRS info manually, and compare and contrast with the CRS info added by rioxarray. Both of the output files loaded in QGIS and the CRS was recognized.

prep_for_qgis.pdf

Joshdpaul commented 4 months ago

Double-check that the extents are correct, and that pixels are being drawn in their proper places with regard to coordinate location within the pixel (ie, "is the lat/lon pair the center of the pixel or the bottom left?").

When viewed against an OSM basemap in QGIS, the edges don't line up. This could simply be one of the models without a wall-to-wall coverage, or might be showing an error.... need to investigate further.

Vicinity of the "Rat Islands", far end of the Aleutian chain:

image