Spatial subsetting of CORDEX data

Hello all,

I am trying to put together a simple subsetting operation on CORDEX data. It is effectively the simplest data retrieval command followed by ct.cube.select(data, extent=[28., 42., -3., 0.]). The app, however, crashes out with the error "ValueError: dimensions or multi-index levels ['lat', 'lon'] do not exist". As is the case with most CORDEX files, the data arrays use a rotated pole coordinate system and the corresponding dimensions are called "rlat" and "rlon", so the error is easily enough explained. Does anyone know how to work around this problem?

Thanks for your help.

Since youre question is 3 years old already, have your found a way yourself that you could share?

Unfortunately not but I must say that I have not looked at the toolbox for a long time.

Instead, I am using package ncdfCFin R which does the job without a hassle. Specifically, call something like myvar$subset(lon = NA, lat = NA)(where lon and lat are the names of the auxiliary coordinate variables, as they are called in the CF Metadata Conventions) to convert a data variable to a regular latitude-longitude grid. You can also supply specific coordinate ranges to lon and lat to get an actual subset, possibly with other axes, like time, if so needed.

In Python there is package cf-python which can do the same but I have no experience with it.

In both environments you first have to download the data variable as a netCDF file so that’s a bit of a bummer, although you could subset over other axes before downloading.