GetDataEA_Rain | R Documentation |
Extract rainfall data from the Environment Agency's Hydrology Data Explorer.
GetDataEA_Rain(
Lat = 54,
Lon = -2,
Range = 10,
WISKI_ID = NULL,
Period = "Daily",
From = NULL,
To = NULL
)
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 leave as NULL. |
To |
The end date of the data extraction in the form of "YYYY-MM-DD". To get data from the first date available leave as NULL. |
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". To extract all the available data leave the From and To arguments as Null.
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 / POSIXct in the first columns and rainfall in the second.
Anthony Hammond
#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
## Not run: HonisterDec2015 <- GetDataEA_Rain(WISKI_ID = "592463",
Period = "Hourly", From = "2015-12-01", To = "2015-12-31")
## End(Not run)
#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)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.