get_pot: A function to obtain Peaks-Over-Threshold (POT) data using...

View source: R/get_winfapapi.R

get_potR Documentation

A function to obtain Peaks-Over-Threshold (POT) data using the NRFA API

Description

The function queries the NRFA API for the .PT file similar to the WINFAP file for a given stations. It then processes the file in a fashion similar to read_pot.

Usage

get_pot(station, getAmax = FALSE)

Arguments

station

the NRFA station number for which peaks over threshold information should be obtained. It can also be a vector of station numbers

getAmax

logical. If TRUE information on the annual maxima values will be retrieved and attached to the WaterYearInfo table

Value

Like read_pot a list of three objects tablePOT, WaterYearInfo and dateRange.

tablePOT contains a table with all the peaks above the threshold present in the record

WaterYearInfo a table containing the information on the percentage of missing values in any water year for which some data is available in the POT record. This is useful to assess whether the lack of exceedances is genuine or the result of missing data and to assess whether the threshold exceedances present in tablePOT can be deemed to be representative of the whole year

dateRange a vector with the first and last date of recording for the POT record as provided in the [POT Details] field. Note that this period might be different than the period for which annual maxima records are available

See Also

read_pot. Information on the peaks over threshold records and river flow gauging in the UK can be found at the National River Flow Archive website https://nrfa.ceh.ac.uk

Examples


  ### the example take longer than 5 seconds to run
  p40003 <- get_pot(40003) # the Medway at Teston / East Farleigh
  p40003$tablePOT[p40003$tablePOT$WaterYear > 1969 &
        p40003$tablePOT$WaterYear < 1977,]
  ### no events in 1971 nor 1975
  p40003$WaterYearInfo[p40003$WaterYearInfo$WaterYear > 1969 &
        p40003$WaterYearInfo$WaterYear < 1977,]
  # in 1971 all records are valid,
  # in 1975 no exceedances
  # might be due to the fact that almost no valid record are available

  p40003 <- get_pot(40003, getAmax = TRUE)
  p40003$WaterYearInfo[p40003$WaterYearInfo$WaterYear > 1969 &
       p40003$WaterYearInfo$WaterYear < 1977,]
  # the annual maximum in 1971 and 1975 was below the threshold
  # no events exceeded the threshold


winfapReader documentation built on Sept. 8, 2022, 5:08 p.m.