# Spatial subsetting of CORDEX data

**URL:** <https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411>\
**Category:** API\
**Tags:** api, c3s, cordex\
**Created:** [7 June 2022 12:30 UTC](https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411 "2022-06-07T12:30:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Laake](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@Patrick\_Van\_Laake](https://forum.ecmwf.int/u/Patrick_Van_Laake)\
**Post date:** [7 June 2022 12:30 UTC](https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411/1 "2022-06-07T12:30:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Henry\_Hiemenz](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/h/6a8cbe/32.png) [@Henry\_Hiemenz](https://forum.ecmwf.int/u/Henry_Hiemenz)\
**Post date:** [29 August 2025 08:32 UTC](https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411/2 "2025-08-29T08:32:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Laake](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@Patrick\_Van\_Laake](https://forum.ecmwf.int/u/Patrick_Van_Laake)\
**Post date:** [29 August 2025 12:50 UTC](https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411/3 "2025-08-29T12:50:42Z")

</div>

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

Instead, I am using package `ncdfCF`in 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.

---

<div class="post-metadata">

**Author:** ![Christopher\_Goddard](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@Christopher\_Goddard](https://forum.ecmwf.int/u/Christopher_Goddard)\
**Post date:** [10 July 2026 11:14 UTC](https://forum.ecmwf.int/t/spatial-subsetting-of-cordex-data/1411/4 "2026-07-10T11:14:46Z")

</div>

Please note that spatial subsetting is now available directly in the CORDEX catalogue entry: [New features implemented for CORDEX regional climate model data on single levels on the CDS](https://forum.ecmwf.int/t/new-features-implemented-for-cordex-regional-climate-model-data-on-single-levels-on-the-cds/15145)
