Project

General

Profile

convert/remap curvilinear grid to regular grid CORDEX data

Added by Polina Franke about 2 years ago

I have a CORDEX data file: tas_EUR-11_MPI-M-MPI-ESM-LR_historical_r1i1p1_SMHI-RCA4_v1a_3hr_197501010000-197512312100.nc (the first timestep for the variable tas of this data is attached).

All CORDEX files seem to have 2 coordinate systems: the rotated pole coordinate system, which is linear and presented by the 1D rlon/rlat coordinate variables and the second one being 2D lon/lat coordinates, which are curvilinear and present “usual” geographical coordinates (compare sinfo.png and ncdump.png).

Tbh this already confuses my a lot...

I want to remap/convert to a somewhat "regular" coordinate systeme, e.g. lonlat, to be able to import my netCDF file as a raster layer to QGIS. But QGIS does not like curvilinear grids... I have already looked through the help pages here and tried the operators setgridtype and remapbil.
In the case of setgridtype,lonlat it got me the ERROR message: cdo setgridtype (Abort): Unsupported grid type!
And for remapbil,r360x180 the result looked not at all what I need it to be. But this makes sense, since I only have coordinates for Europe and not the whole world.

What I am trying to do is to import the netCDF file to QGIS to join it with a population grid from GEOSTAT (https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat) containing population data on a 1x1 km raster, which is in .csv format. Maybe there is another way to do so with CDO?? I am open for suggestion!

Really any help is much appreciated!!

I am using CDO version 1.9.3.


Replies (2)

RE: convert/remap curvilinear grid to regular grid CORDEX data - Added by Karin Meier-Fleischer about 2 years ago

Hi Polina,

just searching for 'cdo CORDEX remap lonlat' would have been much faster...

Your data isn't global, right, but the lon and lat coordinate variables contains the correct EUR-11 grid. CDO can handle the rotated data and remap it to e.g. 1x1 deg (r360x180) grid. It fills the grid cells without data on the global grid with missing values and you can extract the EUR subset with the sellonlatbox operator.

cdo -f nc -sellonlatbox,-44.59386,64.96438,21.98783,72.585 -remapbil,r360x180 tas_EUR_19700101.nc outfile.nc

I guess, the coordinates attribute of tas has to be deleted for QGIS because it contains height.

ncatted -O -a coordinates,tas,d,, outfile.nc

-Karin

tas CORDEX EUR-11 remap to lonlat grid

plot_quick_look_tas_t0.png (84.3 KB) plot_quick_look_tas_t0.png tas CORDEX EUR-11 remap to lonlat grid

RE: convert/remap curvilinear grid to regular grid CORDEX data - Added by Karin Meier-Fleischer about 2 years ago

Addendum: you can set the CDO environment variable IGNORE_ATT_COORDINATES to get rid of not needed stuff (then you do not need to use ncatted).

export IGNORE_ATT_COORDINATES=1

    (1-2/2)