Hello, i’ve been trying calculate the v wind and uwind components anomaly from monthly averaged reanalysis, but all my tries have been unsuccessful. can someone help?
Hi Fede,
Could you clarify your idea a bit further?
For instance, what percentile/quantile do you use as your anomaly value?
Do you use python/bash/R or something else?
My instinct would be to use Python with xarray (https://xarray.dev/) and roughly doing the following logic:
- Import both xarray & dask functionality (make sure to have the packages: netcdf4, cfgrib, ecmwflibs, eccodes, last three only if you have the data as grib files)
- Open the dataset with xarray (example if using grib files, netcdf is easier). For instance using the following snippet to start:
ds = xr.open_mfdataset('/path/to/files/*.grib', engine='cfgrib', # open grib files combine_dims="time", # combine all files in the time-dimension combine="nested", # make sure no sub-dimensions are made combine_attrs='drop_conflicts')
# keep the data attributes info of the first file instead of loosing all information
See Reading and writing files for more details. - Perform a groupby operation per month using
ds_anom = ds.groupby("time.month") - ds.groupby("time.month").mean()
- Now you have monthly anomaly data.
Hi,
I’ve been using Python with Xarray. In terms of use the package, it’s okay.
My doubts are about what I have to do with the variables v wind and u wind to calculate the anomaly.
I’ve been using this repository:
https://ecmwf-projects.github.io/copernicus-training-c3s/reanalysis-climatology.html
In the tab “Tutorial on reanalysis” → “Climatology” instead of calculate temperature i’ve changed the variable for v and u winds, but didn’t work.
If it’s not clear, I can try explain again, no problem.
Hi Fede,
The difficulty here is that you looking at the anomaly of both windspeed & direction at the same time. This won’t work. Furthermore, the type of variable you consider when looking at wind instead of temperature is quite important.
For Temperature you are allways far from its zero value & reasonably symetric. While the windcomponents are symetric in their behaviour, its centered around zero which makes the math a bit ‘funny’.
If you can clarify what your goal is with this investigation I could maybe think along, but without knowing what physical process you want to investigate, this is very difficult.
Best,
Laurens
Not sure if I got it correctly, but if you want to calculate the standard error of windspeed or wind direction, you can use U/V component spread from era5 ensemble and error propagation. Wikipedia show the error propagation for wind speed as an example: sqrt((σu^2 U^2 + σv^2 V^2)/(U^2 + V^2))
. For wind direction: (180 sqrt((σu^2 V^2 + U^2 σv^2)/(U^2 + V^2)^2))/π
. I implemented it here.