GetDataEA_Rain {UKFE}R Documentation

Get Environment Agency rainfall data (England).

Description

Extract rainfall data from the Environment Agency's Hydrology Data Explorer.

Usage

GetDataEA_Rain(
  Lat = 54,
  Lon = -2,
  Range = 10,
  WISKI_ID = NULL,
  Period = "Daily",
  From = "2015-12-01",
  To = "2015-12-31"
)

Arguments

Lat

Latitude (as a decimal) for the centre of the search for gauges. You can convert BNG to Lat and Lon using the GridRefConvert function.

Lon

Longitude (as a decimal) for the centre of the search for gauges. You can convert BNG to Lat and Lon using the GridRefConvert function.

Range

The radius (km) from the point of interest (Lat, Lon) for which the user wants rain gauge information (currently it only seems to work to just over 20km).

WISKI_ID

The WISKI identification (as "character") for the rain gauge of interest

Period

The sampling rate of the rainfall in hours. Either "Daily", "15Mins", "Hourly".

From

The start date of the data extraction in the form of "YYYY-MM-DD". To get data from the first date available put in an arbitrarily early date such as "1901-01-01".

To

The end date of the data extraction in the form of "YYYY-MM-DD". If you put in a future date, data up to the most recent available will be returned.

Details

The function provides one of two outputs. Either information about available local rain gauges, or the data from a specified gauge (specified by WISKI ID). The process is to find the local information (including WISKI ID) by using the latitude and longitude and range (You can convert BNG to Lat and Lon using the GridRefConvert function). Then use the WISKI ID to get the data. If data requested is not available, for example - outside the date range or not available at the requested sampling rate, an error message is returned stating "no lines available in input". Currently there is a 2 million line limit for each use. That is over 5000 years of daily data or 57 years of 15 minute data. However, the 15 minute data can take quite a while and if it takes over 60 seconds a timeout message is returned. When testing the function I could get 20 years at a time but not 30. Presumably it depends on the connection?

Value

If searching for rain gauge details with the Latitude and Longitude a dataframe of gauges is returned. If extracting rainfall using the WISKI_ID, a dataframe is returned with Date or POSIXct in the first columns and rainfall in the second.

Author(s)

Anthony Hammond

Examples

#Get information about available rain gauges.
#within a 10km radius of Lat = 54.5, Lon = -3.2
## Not run:  GetDataEA_Rain(Lat = 54.5, Lon = -3.2) 
#Now we'll use the WISKI reference for the Honister rain gauge
# to get some hourly rain data for the Dec 2015 (default dates)
## Not run:  HonisterDec2015 <- GetDataEA_Rain(WISKI_ID = "592463", Period = "Hourly") 
#Now we'll have a look at the top of the data and plot it
## Not run:  head(HonisterDec2015) 
## Not run:  plot(HonisterDec2015, type = "h", ylab = "Rainfall (mm)") 

[Package UKFE version 0.3.8 Index]