Skip to content
Snippets Groups Projects
Commit b7a3886f authored by xo30xoqa's avatar xo30xoqa
Browse files

Updated documentation on preparing weather input data

parent c346859a
Branches
Tags
No related merge requests found
...@@ -136,53 +136,23 @@ Currently, Persefone uses historical weather data from the closest weather stati ...@@ -136,53 +136,23 @@ Currently, Persefone uses historical weather data from the closest weather stati
as its weather input. (In future, this may be changed to a more detailed raster as its weather input. (In future, this may be changed to a more detailed raster
input, which could then also provide future weather predictions under climate change.) input, which could then also provide future weather predictions under climate change.)
Weather data can be downloaded from the [German weather service (DWD)](https://www.dwd.de/DE/leistungen/cdc/cdc_ueberblick-klimadaten.html?nn=16102). Weather data can be downloaded from the [German weather service (DWD)](https://www.dwd.de/DE/leistungen/cdc/cdc_ueberblick-klimadaten.html?nn=16102).
The relevant data are in the folder [`daily/kl/historical`](https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/daily/kl/historical/).
The description of this data set and the list of weather stations can be found in the The description of these data sets and the list of weather stations can be found in the
Persefone repository, in the `docs` folder (or downloaded from the link above). Persefone repository, in the `docs` folder (or downloaded from the link above).
Using the list of weather stations, select the one closest to the area of study. Using the list of weather stations, select the one closest to the area of study.
Note that not all stations were continuously in operation; make sure that the selected Note that not all stations were continuously in operation; make sure that the selected
station covers the years of interest. station covers the years of interest. The currently included regions have the following
station codes:
- **Region Jena:** station number 02444 ("Jena (Sternwarte)") - **Region Jena:** station number 02444 ("Jena (Sternwarte)")
- **Region Eichsfeld:** - **Region Eichsfeld:** station number 02925 ("Leinefelde")
- **Region Thüringer Becken:** station number 00896 ("Dachwig") - **Region Thüringer Becken:** station number 00896 ("Dachwig")
- **Region Hohenlohe:** - **Region Hohenlohe:** station number 03761 ("Oehringen")
- **Region Bodensee:** - **Region Bodensee:** station number 06263 ("Singen")
- **Region Nördlicher Oberrhein:** - **Region Nördlicher Oberrhein:** station number 05275 ("Waghäusel-Kirrlach")
From the link above, download the ZIP file associated with the station number. The script `data/regions/auxiliary/extract_weather_data.R` can be used to download
Check the included meta-data if there is any important missing data, or other relevant and process the data into the format needed by Persefone. This uses the
information (e.g. the station moved position). [`rdwd`](https://bookdown.org/brry/rdwd/) package. To use it, simply specify the
desired `region`, adding its ID to the `stationid` list if necessary. The produced
Then use `data/extract_weather_data.R` to process the data into the format needed CSV file can be copied into the respective region folder.
by Persefone:
```R
library(tidyverse)
## replace this with the correct file name
weatherfile = "produkt_klima_tag_18210101_20221231_02444.txt"
data = read.table(weatherfile, sep=";", header=T)
weather = data %>%
## drop values before 2000 to save space
filter(MESS_DATUM>=20000101) %>%
## select relevant variables and convert place-holder values to NA
select(MESS_DATUM, FM, RSK, SDK, VPM, TMK, TXK, TNK) %>%
mutate(date=MESS_DATUM, MESS_DATUM=NULL,
mean_windspeed=na_if(FM, -999), FM=NULL,
precipitation=na_if(RSK, -999), RSK=NULL,
sunshine_hours=na_if(SDK, -999), SDK=NULL,
mean_vapour_pressure=na_if(VPM, -999), VPM=NULL,
mean_temperature=na_if(TMK, -999), TMK=NULL,
max_temperature=na_if(TXK, -999), TXK=NULL,
min_temperature=na_if(TNK, -999), TNK=NULL)
## replace with the desired file name
write.csv(weather, file="weather_jena.csv", row.names=FALSE)
```
*Note: for calculating the reference evapotranspiration ET_0 (needed for the AquaCrop model),
use the [FAO Penman-Monteith equation](https://www.fao.org/3/X0490E/x0490e06.htm#equation).*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment