Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of COSMO-REA6 gribfiles to netcdf using cfgrib causes a westward shift of the data of about 10-15 km #386

Open
LidewijvdB opened this issue Jun 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@LidewijvdB
Copy link

What happened?

I downloaded COSMO-REA6 grib files for both wind gust and u and v component of wind speed. The wind gust data I did not convert to netcdf but only to zarr using xarray, while the u and v component of wind speed was converted to netcdf first using the xarray code shown below. Several processing and repojection steps follow, but they are identical for both files. ot I end up with a wind gust file with a perfect projection, whereas the wind speed file shows a westward shift in its projection for Southern Europe only (northern UErope is not affected or less affected. It seems to get worse going south.

This is the code we have used (see below)

we always upgrade the eccodes library before running the script to esnrue it is using the latest version. Sicne the res tof the steps are the same, but the outcome is different, we suspect this conversion is causing the issue. Could you come up with a solution fo r us? We have found no other way to convert grib to netcdf

What are the steps to reproduce the bug?

ds = xr.open_mfdataset(file, combine='nested', coords='minimal', compat='override', parallel=False, engine='cfgrib', backend_kwargs={'indexpath': ''})

print("save netcdf file")
ds.to_netcdf(new_file_path+'.nc', engine = 'netcdf4')

#you could use this on raw data files of consmo-rea6 found overhere:
#wind gust: https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/hourly/2D/VMAX_10M/
#u and v component of wind speed:
#https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/hourly/2D/U_10M/
#https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/hourly/2D/V_10M/

#for reprojection raster we have used the following CDO commands:
/root/miniconda/bin/cdo remapdis,COSMO-REA6_grid_in_CDO.txt,2 COSMO_REA6_VMAX_max_10M_1991_2021.nc COSMO_REA6_VMAX_max_10M_1991_2021_remapdis_2.nc

#with the file COSMO-REA6_grid_in_CDO containing:
#gridtype = lonlat
#xsize = 10000
#ysize = 5500
#xfirst = -30
#yfirst = 20
#xinc = 0.01
#yinc = 0.01

Version

10.4

Platform (OS and architecture)

databricks

Relevant log output

no error messages were produced

Accompanying data

No response

Organisation

Royal HaskoningDHV

@LidewijvdB LidewijvdB added the bug Something isn't working label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant