handle_cka_station: Get weather data from Campus Klein Altendorf in 'chillR'...

View source: R/handle_cka_station.R

handle_cka_stationR Documentation

Get weather data from Campus Klein Altendorf in chillR format

Description

This function allows to handle weather data recorded by the weather station located in Campus Klein Altendorf in Rhineland, Germany. Normally, the access to the data is restricted to CKA staff but, any person could ask for it at: https://www.cka.uni-bonn.de/forschung/wetterdaten/aktuelle-wetterdaten. It is important to note that CKA has the data organized into daily '.csv' files for the recent period as well as in '.zip' files for each year. This function only works for data downloaded and extracted as '.csv' files into one common folder. This means, all the files need to be in the same folder, independent of the year. The function returns the most important variables for agricultural production. Among these, temperature, rainfall, wind speed, PAR, among others.

Usage

handle_cka_station(
  folder_path,
  sep = ",",
  vars = c("Temp"),
  time_step = "hourly",
  check_data = TRUE
)

Arguments

folder_path

Character string. This is the complete directory name where the files are stored

sep

Separator to be passed to utils::read.csv

vars

Character string. Variables of interest returned by the function. These are: "Wind_speed" (m/s), "Wind_direction" (degrees), "Temp" (Celsius), "Tmean" (Celsius), "Tmax" (Celsius), "Tmin" (Celsius), "Humidity" (%), "Above_Ground_Temp" (Celsius), "Soil_Temp" (Celsius), "Precipitation" (mm), "Radiation" (W/m2) and "PAR" (umol/m2/s). Default is set to temperature ("Temp") in an hourly basis

time_step

Character string. This is related to the frequency in which the data was recorded. Normally, CKA records weather parameters each 10 min. However, this function summarizes values into hourly and daily basis. Default is set to hourly

check_data

Boolean parameter to define whether the data should be quality checked or not. This means to look for missing observations and fill them through chillR::interpolate_gaps_hourly. This only works for temperature records

Details

It is important to note that the data has to be downloaded by hand from the website or requested to the staff at CKA. The output is a data frame useful for further analysis with chillR or this package. Tmin, Tmean and Tmax only work for daily time step whereas Temp only does for hourly time step.

Examples


# As each user has different path for the folder this example is not running until "#"
# is removed

# path <- "C:/Users/...../...."

# handle_cka_station(folder_path = path, vars = c("Tmin", "Tmean", "Tmax"),
# time_step = "daily", check_data = TRUE)


EduardoFernandezC/dormancyR documentation built on Aug. 24, 2022, 7:21 a.m.