Download a wind timeseries from CMEMS and deal with 'expver' issue

1) Access the Copernicus

image.png

2) In 'Download Data', select the options... in this case, only the wind components u e v at 10 m

3) Select the sub-region of the interest and the format

4) Click at 'Show API request', and the it will deliver the Python code for the query... copy & paste in the notebook!.

It is necessary to install the package 'cdsapi', and to have an account e be logged. The code is straghtforward, and can be changed accordingly. The example below I selecting data for a single point (0.5 degree resolution), so it is quite easy to find the nearesta point someone needs.

Exploring the content of the downloaded file!

This is better done in a second notebook. But let's do here for convenience. In the case of need to re-start the kernel, best to commnet the download part.

Load and show the fields

Checking the coordinates, and in fact, we have just one point!

Converting the model time to 'datetime'

It should start at 2022, 1, 1, 0, 0, 0 as requested in the API - Weird...

In fact, quite weird... and also considering that V10 and U10 have the dimensions "int16 v10(time, expver, latitude, longitude)"

What the fuck is 'expver'?

image.png

The last two dimensions are the coordinates, but what could be the 2.nd?

Exploring further...

https://confluence.ecmwf.int/pages/viewpage.action?pageId=173385064

So, it is the case to merge the data in a single column and sort it cronologically

Transforming in 'np.array', the symbol '--' changes to a numeric flag of missing data, and can be used to joint the data

Sorting cronologically...