Skip to content

Instantly share code, notes, and snippets.

View BaptisteVandecrux's full-sized avatar

Baptiste Vandecrux BaptisteVandecrux

View GitHub Profile
@BaptisteVandecrux
BaptisteVandecrux / CARRA_projection.py
Last active February 26, 2024 10:45
Projection information for the CARRA reanalysis west domain grid
# CARRA homepage: https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-carra-single-levels?tab=overview
# The West domain's grid is described as "Lambert conformal conic grid with 1069 x 1269 grid points for the CARRA-West domain"
# but no proj4 description is given on the website nor on the GRIB/NetCDF files that are distributed.
# The CRS was found in a static file distributed by ECMWF: fraction.west.nc
# It had the same grid size as the CARRA west domain and following projection information:
# proj4 = " +units=m +a=6371229.0 +b=6371229.0 +y_0=-9872984.57134 +lon_0=-36.0 +proj=lcc +x_0=-0.0 +lat_2=72.0 +lat_1=72.0"
# To read a grib file and add the CRS information the following script can be used:
import xarray as xr
import rioxarray