diff --git a/docs/src/gis.md b/docs/src/gis.md index 715cf4f17c6b68d5b473a9e04092f3a07cf0f864..8f64bd914b24ec7e89ad32d82a34ee2e81d4d239 100644 --- a/docs/src/gis.md +++ b/docs/src/gis.md @@ -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 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). -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). 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 -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 Eichsfeld:** +- **Region Eichsfeld:** station number 02925 ("Leinefelde") - **Region Thüringer Becken:** station number 00896 ("Dachwig") -- **Region Hohenlohe:** -- **Region Bodensee:** -- **Region Nördlicher Oberrhein:** - -From the link above, download the ZIP file associated with the station number. -Check the included meta-data if there is any important missing data, or other relevant -information (e.g. the station moved position). - -Then use `data/extract_weather_data.R` to process the data into the format needed -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).* +- **Region Hohenlohe:** station number 03761 ("Oehringen") +- **Region Bodensee:** station number 06263 ("Singen") +- **Region Nördlicher Oberrhein:** station number 05275 ("Waghäusel-Kirrlach") + +The script `data/regions/auxiliary/extract_weather_data.R` can be used to download +and process the data into the format needed by Persefone. This uses the +[`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 +CSV file can be copied into the respective region folder.