get_SMCdata: get_SMCdata

View source: R/get_SMCdata.R

get_SMCdataR Documentation

get_SMCdata

Description

This is a function to download DWD data based on a buffer distance. The meteorological variables are provide in data.frame per station id.

Usage

get_SMCdata(
  lat_center,
  lon_center,
  radius_km,
  time_lag = "daily",
  meteo_var = "soil",
  start_date,
  end_date,
  data_dir = tempdir()
)

Arguments

lat_center

latitude central point for the buffer

lon_center

longitude central point for the buffer

radius_km

for the buffer

time_lag

default "hourly" , it can be change for daily or other timestamp available

meteo_var

type of meteorological data target in the DWD ftp (see option below)

start_date

select stations with date later than

end_date

select stations with date earlier than

data_dir

where to save the downlaod data, default temporary.

period

default "historical", if change to "recent" you get one year lag up to "now".

var_name

variable name target in the the downloaded meteo_var file (see option below)

Value

a list with: 1- a data.frame with the selected variable per station id for the set timestamp, and 2- a data.frame with metadata information, such as stations_id, start_date, end_date, station_height, latitude, longitude, stations_name, region, time_lag, variable, period, file, distance, url.

Examples

#########
SMC_daily <- get_SMCdata(lat_center = 52.4537,
                         lon_center = 13.3017,
                         radius_km = 70,
                         time_lag = "daily",
                         meteo_var = "soil",
                         start_date = "2019-01-01",
                         end_date = "2020-12-31");

SMC_daily[[1]][[1]];
summary(SMC_daily[[1]][[1]]);


AlbyDR/rSCOPE documentation built on Dec. 19, 2024, 7:29 p.m.