-
Notifications
You must be signed in to change notification settings - Fork 98
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
DRAFT: Wind data from COSMO REA6 reanalysis #308
base: master
Are you sure you want to change the base?
Conversation
Cool, I like it. Someone from the team will have a more detailed look soon. |
Hi @euronion, thanks for sharing your thoughts. What do you think the next step should be? Should I start trying to improve the implementation or should we wait for more comments from the team? |
Hi @joAschauer , We had another chat internally yesterday. We think COSMO REA6 would be a great addition to One last question on the impacts of adapting the dataset Otherwise, big YES: Regarding your earlier questions/TODOs
I don't think there is much added value from this. We should focus on getting the wind speeds at enough heights to have usable interpolation to any hub height the user might request. Bascially once created, the user should not have to worry about redownloading the wind speeds at yet another height just because they didn't download them earlier. This gives rise to another question: How to handle interpolation to a specific hub height? For ERA5 we (for now) use the roughness also retrieved. Does COSMO REA6 provide a similar indicator? Else we would either have to retrieve the roughness from ERA5 or consider implementing a different interpolation method (which might be reasonable, given the high number of steps at which wind speeds are available with COSMO REA6).
Maybe @FabianHofmann has an idea how to do this quick and practically?
Requesting a cutout with bounds exceeding the COSMO REA6 coverage should simply throw an error and not be allowed.
We can figure that out together. As long as the Looking at the COSMO-REA6 website I see a number of other data also available, not only wind data. Would there be some merit in making the data module directly compatible with those as well? Or are those values only available with restrictions and a not-so-straightforward-implementation? |
Hi @euronion, thanks for your reply. As suggested, I have made capacity factor maps for Germany with the To address your points from above:
Then we need to decide which heights to include by default.
Roughness is also available for COSMO REA6. I have already included it in the "wind" feature of this PR. So the interpolation between height levels could remain the same. In any case, if we decide to use a different interpolation method, I think this should be done in a separate PR.
Okay, this sounds reasonable.
This is not clear to me. What do you mean by "do not overlap"?
You are right, there are other variables available. See https://opendata.dwd.de/climate_environment/REA/Readme_intro_REA-OD.pdf for a general description of what is available on the opendata.dwd.de server. A detailed list of parameters can be found at https://opendata.dwd.de/climate_environment/REA/ParameterTabellen.pdf. The variables air density, u- and v-component, wind direction and wind speed are available in a converted netcdf format at https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/converted/ in daily, hourly and monthly resolution:
This converted format is what I have been using so far. The other variables are available in grib format and I didn't read them in and don't know if the regridding gets more complicated, but I guess so. On top of the curvilinear grid present in the "converted" netcdfs, there will be a rotated pole coordinated system in the grib files. However, if you think this would be a big advantage, I can take a look at it. I think it should be possible without relying on non-Python tools like What variables do you think are of particular interest for atlite? |
I'm amazed by the resolution improvement, thanks @joAschauer ! :) Differences in CFs We also see the higher CFs with COSMO in coastal and mountainous regions, a limitation ERA5 is known for which we could eliminate with the new data. Sweet. Heights to include by default
These will capture most current and future turbine heights offshore and onshore. Having roughness from COSMO is even better, compatibility with the existing method makes me happy. Other interpolation methods are still something we need to look into, but that's a different issue and yes, would be a separate PR.
Each dataset provides one or more features, for COSMO REA6 those are at the moment
The same feature Speaking of features and other variables: Can you also implement atlite/atlite/datasets/era5.py Lines 125 to 127 in 549d0fd
Thank you for those tables. I think in general all the variables which would substitute ERA5 for Europe (-> higher resolution) would be beneficial, i.e. these features from the ERA5 dataset: atlite/atlite/datasets/era5.py Lines 45 to 60 in 549d0fd
I would have to dig a bit into the COSMO dataset to understand how they relate to the variables offered. But I don't consider the other features as important as wind for now. They are less dependent on local variations to roughness and for solar radiation we also support SARAH datasets which have generally a better quality. If you want to have a look feel free, but I would suggest we go with the |
Hi @joAschuaer,
I don't think there's much overlap with your project;
Anyway some notes are under https://gist.github.com/denis-bz Added 16 Sept, a couple of nasties in opendata.dwd.de WS files -> xarray
Also, to compare cosmo and era5, a good testcase is January 2018 with 100kmh storms across Europe. comments welcome |
Change proposed in this Pull Request
Once ready, this pull requests would add the possibility to include wind data from the COSMO REA6 reanalysis into atlite. This is a first version which I made for a specific use-case. It is already working for my needs (i.e. on a small spatial domain in central Europe) but is neither robust nor tested exhaustively. If you think this adds value to atlite and would be good to be included, I can try to continue working on it and make it more robust, make the regridding faster, add tests etc.
Description
A new module
cosmo_rea6
is added toatlite.datasets
. The module can download data from the opendata.dwd server and restructures the data in order to fit into the atlite framework and conventions. Only the wind feature is supported.A dedicated directory to store the downloaded raw netcdfs was chosen instead of tempdir approach as in the era5 module. This allows users to download the data however they want and then reuse it in atlite without letting atlite handle the download.
Issues, Questions and Todos
As there are many height levels available from the dwd server, it would be nice if the user could select only needed height levels and not load the complete
wind
feature with all levels. I tried to intruduce a creation_paramtercosmo_rea6_height_levels
but this is not working due to the way missing (sub)features are searched indata.cutout_prepare()
. Is there an easy way of selecting subfeatures for a Cutout? Another way would be to preselect avaliable height levels in thefeatures
list of thecomso_rea6
module which would then not be available to the users (what I did now for testing purposes).The COSMO data is provided on a curvilinear grid with rotated pole. For the wind speed on https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/converted data, 2D coordinate fields are already provided in WGS84. In order to work with atlite (compatibility with other datasets, layout capacity mapping), regridding to a rectilinear grid is necessary. As far as I understood, this is something different as done in
atlite.gis.regrid
and unfortunately on I didn't find an easy way for doing it on a windows platform (see Does interp() work on curvilinear grids (2D coordinates) ? pydata/xarray#2281) while it would have been easily possible on linux (e.g. with xESMF https://xesmf.readthedocs.io/en/latest/notebooks/Curvilinear_grid.html). Therefore, I implemented a hacky solution withscipy.griddata
which is terribly slow for now. I guess this should be sorted out before merging, atleast xr.apply_ufunc should be used somehow.Right now, no checks are done whether the cutout extent is within the COSMO REA6 domain. I need to check if the regridding is working when the domain is larger than the COSMO domain.
I did not test whether it is easily possible to combine the
cosmo_rea6
module with other data modules such asera5
andsarah
.Motivation and Context
The COSMO REA6 reanalysis is a regional reanalysis product for Europe. It has a spatial resolution of ~6km and is able to represent local wind speeds significantly better than e.g. ERA5 (see Kaspar et al. 2020, https://doi.org/10.5194/asr-17-115-2020 for a review). However, Urraca et al. (2018, https://doi.org/10.1016/j.solener.2018.02.059) conclude that satellite based products such as SARAH are performing better than COSMO REA6 for radiation. Therefore, it probably only makes sense to include wind from COSMO REA6 into atlite which is what this PR does.
On the opendata.dwd.de server, wind speed at 10, 40, 60, 80, 100, 125, 150, 175 and 200 m height above ground is available at daily and hourly resolution (e.g. https://opendata.dwd.de/climate_environment/REA/COSMO_REA6/converted/hourly/2D/).
How Has This Been Tested?
I only created a dedicated wind cutout for 2012 in Germany and reproduced this example from the documenation. Below you can see the same plots as in the example that compare the different data sources.
Type of change
Checklist
pytest
inside the repository and no unexpected problems came up.doc/
.environment.yaml
file.doc/release_notes.rst
.pre-commit run --all
to lint/format/check my contribution