From 6a2c2fe360d633b306b08289ab39841cd4830837 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 15:36:52 +0200 Subject: [PATCH 1/6] initial reading uk --- NEWS.md | 1 + R/get_pvol.R | 1 + R/get_pvol_uk.R | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 R/get_pvol_uk.R diff --git a/NEWS.md b/NEWS.md index e92fc1c..e6e66dc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Use options for urls so they can be changes without a package update (#120). * Add `getRad.progress` option to silence progress. +* Support reading data from the United Kingdom (#202). # getRad 0.3.0 diff --git a/R/get_pvol.R b/R/get_pvol.R index dd69c05..1eb859c 100644 --- a/R/get_pvol.R +++ b/R/get_pvol.R @@ -160,6 +160,7 @@ select_get_pvol_function <- function(radar, ..., call = rlang::caller_env()) { cntry_code == "se" ~ "get_pvol_se", cntry_code == "ro" ~ "get_pvol_ro", cntry_code == "sk" ~ "get_pvol_sk", + cntry_code == "uk" ~ "get_pvol_uk", .default = NA )) if (rlang::is_na(fun)) { diff --git a/R/get_pvol_uk.R b/R/get_pvol_uk.R new file mode 100644 index 0000000..ae70694 --- /dev/null +++ b/R/get_pvol_uk.R @@ -0,0 +1,48 @@ +get_pvol_uk <- function(radar, time, pulse_type=c("lp", "sp"), ..., call = rlang::caller_env()) { + uk_odim_map<-c(ukcle = "clee-hill", + ukham = "hameldon-hill", + ukche = "chenies", + ukcas = "castor-bay", + ukpre = "predannack", + uking = "ingham", + ukcyg = "crug-y-gorrllwyn", + ukhhd = "holehead", + ukjer = "jersey", + ukdud = "dudwick", + uklew = "druima-starraig", + ukcob = "cobbacombe", + ukdea = "deanhill", + ukthu = "thurnham", + ukmun = "munduff-hill", + ukhmy = "high-moorsley") + uk_odim_map_radar_number<-c(ukcle = 3, + ukham = 4, + ukche = 5, + ukcas = 7, + ukpre = 8, + uking = 9, + ukcyg = 10, + ukhhd = 18, + ukjer = 12, + ukdud = 14, + uklew = 15, + ukcob = 16, + ukdea = 21, + ukthu = 20, + ukmun = 19, + ukhmy = 23) + pulse_type<- rlang::arg_match(pulse_type) + # TODO wardon-hill code 11 no odim coe + withr::with_file("file.h5", { + req <- httr2::request(glue::glue( + "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{uk_odim_map[radar]}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', uk_odim_map_radar_number[radar])}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" + )) |> + req_user_agent_getrad() |> + httr2::req_perform(path = "file.h5", error_call = call) + pvol <- bioRad::read_pvolfile(req$body, ...) + }) + return(pvol) +} + + + From 6580f7c27deb5c44524195d745e3274c02421fff Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 15:42:10 +0200 Subject: [PATCH 2/6] document pulse type --- R/get_pvol.R | 5 ++++- man/get_pvol.Rd | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/get_pvol.R b/R/get_pvol.R index 1eb859c..f0dd6ff 100644 --- a/R/get_pvol.R +++ b/R/get_pvol.R @@ -24,7 +24,10 @@ #' - A [lubridate::interval()] or two [`POSIXct`][base::DateTimeClasses], #' between which all data files are downloaded. #' @param ... Additional arguments passed on to reading functions, for example -#' `param = c("DBZH", "VRADH")` to the [bioRad::read_pvolfile()]. +#' `param = c("DBZH", "VRADH")` to the [bioRad::read_pvolfile()]. For date +#' from the United Kingdom the option exist to select either short pulse or +#' long pulse data using `pulse_type = "sp"` or `pulse_type = "lp"`. By +#' default long pulse data is read. #' @returns Either a polar volume or a list of polar volumes. See #' [bioRad::summary.pvol()] for details. #' @export diff --git a/man/get_pvol.Rd b/man/get_pvol.Rd index 59bfdfa..42b7a2f 100644 --- a/man/get_pvol.Rd +++ b/man/get_pvol.Rd @@ -20,7 +20,10 @@ between which all data files are downloaded. }} \item{...}{Additional arguments passed on to reading functions, for example -\code{param = c("DBZH", "VRADH")} to the \code{\link[bioRad:read_pvolfile]{bioRad::read_pvolfile()}}.} +\code{param = c("DBZH", "VRADH")} to the \code{\link[bioRad:read_pvolfile]{bioRad::read_pvolfile()}}. For date +from the United Kingdom the option exist to select either short pulse or +long pulse data using \code{pulse_type = "sp"} or \code{pulse_type = "lp"}. By +default long pulse data is read.} } \value{ Either a polar volume or a list of polar volumes. See From 01e7c5a0ef981db6dc4e6c011750e488b3b4ce6a Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 16:20:12 +0200 Subject: [PATCH 3/6] add error messaging and tests --- R/get_pvol_uk.R | 23 +++++++++++++++----- tests/testthat/test-get_pvol_uk.R | 36 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 tests/testthat/test-get_pvol_uk.R diff --git a/R/get_pvol_uk.R b/R/get_pvol_uk.R index ae70694..41b4c50 100644 --- a/R/get_pvol_uk.R +++ b/R/get_pvol_uk.R @@ -31,14 +31,27 @@ get_pvol_uk <- function(radar, time, pulse_type=c("lp", "sp"), ..., call = rlang ukthu = 20, ukmun = 19, ukhmy = 23) - pulse_type<- rlang::arg_match(pulse_type) - # TODO wardon-hill code 11 no odim coe + pulse_type<- rlang::arg_match(pulse_type, error_call = call) + time<-lubridate::with_tz(time, "UTC") + # TODO wardon-hill code 11 no odim code + if(pulse_type=="sp" && time !=lubridate::floor_date(time,"10 mins")){ + cli::cli_abort(call=call, c(x="Short pulse data is only available every ten minutes.", i="To resolve round the {.arg time} to the nearest 10 minutes."), class="getRad_error_uk_no_sp_data") + } withr::with_file("file.h5", { - req <- httr2::request(glue::glue( + url<-glue::glue( "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{uk_odim_map[radar]}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', uk_odim_map_radar_number[radar])}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" - )) |> + ) + req <- tryCatch(httr2::request(url) |> req_user_agent_getrad() |> - httr2::req_perform(path = "file.h5", error_call = call) + httr2::req_perform(path = "file.h5", error_call = call), + httr2_http_404 = function(cnd) { + cli::cli_abort(c(x="No data was found for this radar ({.val {radar}}) at the specified search time ({.val {time}})", i="The url constructed was: {.url {url}}."), + call = call, + cnd = cnd, + class = "getRad_error_uk_no_data_404" + ) + } + ) pvol <- bioRad::read_pvolfile(req$body, ...) }) return(pvol) diff --git a/tests/testthat/test-get_pvol_uk.R b/tests/testthat/test-get_pvol_uk.R new file mode 100644 index 0000000..667788d --- /dev/null +++ b/tests/testthat/test-get_pvol_uk.R @@ -0,0 +1,36 @@ +test_that("Pvol for uk can be downloaded", { + skip_if_offline("ncas-radar-o.s3-ext.jc.rl.ac.uk") + time <- + as.POSIXct("2022-4-1 10:00:00", tz = "Europe/Helsinki") + pvol <- expect_s3_class(get_pvol("ukjer", time, param = "all"), "pvol") + expect_true(bioRad::is.pvol(pvol)) + expect_identical( + lubridate::floor_date(pvol$datetime, "5 mins"), + lubridate::with_tz(time, "UTC") + ) + pvolsp <- expect_s3_class(get_pvol("ukjer", pulse_type="sp", time, param = "all"), "pvol") + expect_true(bioRad::is.pvol(pvolsp)) + expect_identical( + lubridate::floor_date(pvolsp$datetime, "5 mins"), + lubridate::with_tz(time, "UTC") + ) + expect_false(identical(pvol, pvolsp)) +}) + +test_that("plusetype argument",{ + expect_error(get_pvol("ukcas", Sys.time(), pulse_type="ll"),"pulse_type") + expect_error(get_pvol("ukcas", Sys.time(), pulse_type=1),"pulse_type") +}) +test_that("404 no data",{ + skip_if_offline("ncas-radar-o.s3-ext.jc.rl.ac.uk") + expect_error(get_pvol("ukcas", as.POSIXct("2012-4-1 10:00:10")),class="getRad_error_uk_no_data_404") +}) + +test_that("no sp data",{ + skip_if_offline("ncas-radar-o.s3-ext.jc.rl.ac.uk") + time <- + as.POSIXct("2022-4-1 10:05:10", tz = "Europe/Helsinki") + expect_error(get_pvol("ukcas", time, pulse_type="sp"),class="getRad_error_uk_no_sp_data") +}) + + From 326b10fb8465468138293b8b7e92f6f06ac2b610 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 16:21:36 +0200 Subject: [PATCH 4/6] format code --- R/get_pvol_uk.R | 123 +++++++++++++++++------------- tests/testthat/test-get_pvol_uk.R | 27 ++++--- 2 files changed, 88 insertions(+), 62 deletions(-) diff --git a/R/get_pvol_uk.R b/R/get_pvol_uk.R index 41b4c50..0a3775e 100644 --- a/R/get_pvol_uk.R +++ b/R/get_pvol_uk.R @@ -1,61 +1,80 @@ -get_pvol_uk <- function(radar, time, pulse_type=c("lp", "sp"), ..., call = rlang::caller_env()) { - uk_odim_map<-c(ukcle = "clee-hill", - ukham = "hameldon-hill", - ukche = "chenies", - ukcas = "castor-bay", - ukpre = "predannack", - uking = "ingham", - ukcyg = "crug-y-gorrllwyn", - ukhhd = "holehead", - ukjer = "jersey", - ukdud = "dudwick", - uklew = "druima-starraig", - ukcob = "cobbacombe", - ukdea = "deanhill", - ukthu = "thurnham", - ukmun = "munduff-hill", - ukhmy = "high-moorsley") - uk_odim_map_radar_number<-c(ukcle = 3, - ukham = 4, - ukche = 5, - ukcas = 7, - ukpre = 8, - uking = 9, - ukcyg = 10, - ukhhd = 18, - ukjer = 12, - ukdud = 14, - uklew = 15, - ukcob = 16, - ukdea = 21, - ukthu = 20, - ukmun = 19, - ukhmy = 23) - pulse_type<- rlang::arg_match(pulse_type, error_call = call) - time<-lubridate::with_tz(time, "UTC") +get_pvol_uk <- function( + radar, + time, + pulse_type = c("lp", "sp"), + ..., + call = rlang::caller_env() +) { + uk_odim_map <- c( + ukcle = "clee-hill", + ukham = "hameldon-hill", + ukche = "chenies", + ukcas = "castor-bay", + ukpre = "predannack", + uking = "ingham", + ukcyg = "crug-y-gorrllwyn", + ukhhd = "holehead", + ukjer = "jersey", + ukdud = "dudwick", + uklew = "druima-starraig", + ukcob = "cobbacombe", + ukdea = "deanhill", + ukthu = "thurnham", + ukmun = "munduff-hill", + ukhmy = "high-moorsley" + ) + uk_odim_map_radar_number <- c( + ukcle = 3, + ukham = 4, + ukche = 5, + ukcas = 7, + ukpre = 8, + uking = 9, + ukcyg = 10, + ukhhd = 18, + ukjer = 12, + ukdud = 14, + uklew = 15, + ukcob = 16, + ukdea = 21, + ukthu = 20, + ukmun = 19, + ukhmy = 23 + ) + pulse_type <- rlang::arg_match(pulse_type, error_call = call) + time <- lubridate::with_tz(time, "UTC") # TODO wardon-hill code 11 no odim code - if(pulse_type=="sp" && time !=lubridate::floor_date(time,"10 mins")){ - cli::cli_abort(call=call, c(x="Short pulse data is only available every ten minutes.", i="To resolve round the {.arg time} to the nearest 10 minutes."), class="getRad_error_uk_no_sp_data") + if (pulse_type == "sp" && time != lubridate::floor_date(time, "10 mins")) { + cli::cli_abort( + call = call, + c( + x = "Short pulse data is only available every ten minutes.", + i = "To resolve round the {.arg time} to the nearest 10 minutes." + ), + class = "getRad_error_uk_no_sp_data" + ) } withr::with_file("file.h5", { - url<-glue::glue( + url <- glue::glue( "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{uk_odim_map[radar]}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', uk_odim_map_radar_number[radar])}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" ) - req <- tryCatch(httr2::request(url) |> - req_user_agent_getrad() |> - httr2::req_perform(path = "file.h5", error_call = call), - httr2_http_404 = function(cnd) { - cli::cli_abort(c(x="No data was found for this radar ({.val {radar}}) at the specified search time ({.val {time}})", i="The url constructed was: {.url {url}}."), - call = call, - cnd = cnd, - class = "getRad_error_uk_no_data_404" - ) - } - ) + req <- tryCatch( + httr2::request(url) |> + req_user_agent_getrad() |> + httr2::req_perform(path = "file.h5", error_call = call), + httr2_http_404 = function(cnd) { + cli::cli_abort( + c( + x = "No data was found for this radar ({.val {radar}}) at the specified search time ({.val {time}})", + i = "The url constructed was: {.url {url}}." + ), + call = call, + cnd = cnd, + class = "getRad_error_uk_no_data_404" + ) + } + ) pvol <- bioRad::read_pvolfile(req$body, ...) }) return(pvol) } - - - diff --git a/tests/testthat/test-get_pvol_uk.R b/tests/testthat/test-get_pvol_uk.R index 667788d..9a0d16f 100644 --- a/tests/testthat/test-get_pvol_uk.R +++ b/tests/testthat/test-get_pvol_uk.R @@ -8,7 +8,10 @@ test_that("Pvol for uk can be downloaded", { lubridate::floor_date(pvol$datetime, "5 mins"), lubridate::with_tz(time, "UTC") ) - pvolsp <- expect_s3_class(get_pvol("ukjer", pulse_type="sp", time, param = "all"), "pvol") + pvolsp <- expect_s3_class( + get_pvol("ukjer", pulse_type = "sp", time, param = "all"), + "pvol" + ) expect_true(bioRad::is.pvol(pvolsp)) expect_identical( lubridate::floor_date(pvolsp$datetime, "5 mins"), @@ -17,20 +20,24 @@ test_that("Pvol for uk can be downloaded", { expect_false(identical(pvol, pvolsp)) }) -test_that("plusetype argument",{ - expect_error(get_pvol("ukcas", Sys.time(), pulse_type="ll"),"pulse_type") - expect_error(get_pvol("ukcas", Sys.time(), pulse_type=1),"pulse_type") +test_that("plusetype argument", { + expect_error(get_pvol("ukcas", Sys.time(), pulse_type = "ll"), "pulse_type") + expect_error(get_pvol("ukcas", Sys.time(), pulse_type = 1), "pulse_type") }) -test_that("404 no data",{ +test_that("404 no data", { skip_if_offline("ncas-radar-o.s3-ext.jc.rl.ac.uk") - expect_error(get_pvol("ukcas", as.POSIXct("2012-4-1 10:00:10")),class="getRad_error_uk_no_data_404") + expect_error( + get_pvol("ukcas", as.POSIXct("2012-4-1 10:00:10")), + class = "getRad_error_uk_no_data_404" + ) }) -test_that("no sp data",{ +test_that("no sp data", { skip_if_offline("ncas-radar-o.s3-ext.jc.rl.ac.uk") time <- as.POSIXct("2022-4-1 10:05:10", tz = "Europe/Helsinki") - expect_error(get_pvol("ukcas", time, pulse_type="sp"),class="getRad_error_uk_no_sp_data") + expect_error( + get_pvol("ukcas", time, pulse_type = "sp"), + class = "getRad_error_uk_no_sp_data" + ) }) - - From 19b3976e353d07ad3280e985bc148095f10162eb Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 16:53:39 +0200 Subject: [PATCH 5/6] update reader function --- R/get_pvol_uk.R | 116 ++++++++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/R/get_pvol_uk.R b/R/get_pvol_uk.R index ae70694..0a3775e 100644 --- a/R/get_pvol_uk.R +++ b/R/get_pvol_uk.R @@ -1,48 +1,80 @@ -get_pvol_uk <- function(radar, time, pulse_type=c("lp", "sp"), ..., call = rlang::caller_env()) { - uk_odim_map<-c(ukcle = "clee-hill", - ukham = "hameldon-hill", - ukche = "chenies", - ukcas = "castor-bay", - ukpre = "predannack", - uking = "ingham", - ukcyg = "crug-y-gorrllwyn", - ukhhd = "holehead", - ukjer = "jersey", - ukdud = "dudwick", - uklew = "druima-starraig", - ukcob = "cobbacombe", - ukdea = "deanhill", - ukthu = "thurnham", - ukmun = "munduff-hill", - ukhmy = "high-moorsley") - uk_odim_map_radar_number<-c(ukcle = 3, - ukham = 4, - ukche = 5, - ukcas = 7, - ukpre = 8, - uking = 9, - ukcyg = 10, - ukhhd = 18, - ukjer = 12, - ukdud = 14, - uklew = 15, - ukcob = 16, - ukdea = 21, - ukthu = 20, - ukmun = 19, - ukhmy = 23) - pulse_type<- rlang::arg_match(pulse_type) - # TODO wardon-hill code 11 no odim coe +get_pvol_uk <- function( + radar, + time, + pulse_type = c("lp", "sp"), + ..., + call = rlang::caller_env() +) { + uk_odim_map <- c( + ukcle = "clee-hill", + ukham = "hameldon-hill", + ukche = "chenies", + ukcas = "castor-bay", + ukpre = "predannack", + uking = "ingham", + ukcyg = "crug-y-gorrllwyn", + ukhhd = "holehead", + ukjer = "jersey", + ukdud = "dudwick", + uklew = "druima-starraig", + ukcob = "cobbacombe", + ukdea = "deanhill", + ukthu = "thurnham", + ukmun = "munduff-hill", + ukhmy = "high-moorsley" + ) + uk_odim_map_radar_number <- c( + ukcle = 3, + ukham = 4, + ukche = 5, + ukcas = 7, + ukpre = 8, + uking = 9, + ukcyg = 10, + ukhhd = 18, + ukjer = 12, + ukdud = 14, + uklew = 15, + ukcob = 16, + ukdea = 21, + ukthu = 20, + ukmun = 19, + ukhmy = 23 + ) + pulse_type <- rlang::arg_match(pulse_type, error_call = call) + time <- lubridate::with_tz(time, "UTC") + # TODO wardon-hill code 11 no odim code + if (pulse_type == "sp" && time != lubridate::floor_date(time, "10 mins")) { + cli::cli_abort( + call = call, + c( + x = "Short pulse data is only available every ten minutes.", + i = "To resolve round the {.arg time} to the nearest 10 minutes." + ), + class = "getRad_error_uk_no_sp_data" + ) + } withr::with_file("file.h5", { - req <- httr2::request(glue::glue( + url <- glue::glue( "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{uk_odim_map[radar]}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', uk_odim_map_radar_number[radar])}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" - )) |> - req_user_agent_getrad() |> - httr2::req_perform(path = "file.h5", error_call = call) + ) + req <- tryCatch( + httr2::request(url) |> + req_user_agent_getrad() |> + httr2::req_perform(path = "file.h5", error_call = call), + httr2_http_404 = function(cnd) { + cli::cli_abort( + c( + x = "No data was found for this radar ({.val {radar}}) at the specified search time ({.val {time}})", + i = "The url constructed was: {.url {url}}." + ), + call = call, + cnd = cnd, + class = "getRad_error_uk_no_data_404" + ) + } + ) pvol <- bioRad::read_pvolfile(req$body, ...) }) return(pvol) } - - - From b88c188b76c2fc7084d44ed8762b1999c471e0bb Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 4 Aug 2026 17:00:19 +0200 Subject: [PATCH 6/6] use recode function --- R/get_pvol_uk.R | 15 ++++++++++----- tests/testthat/test-get_pvol_uk.R | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/R/get_pvol_uk.R b/R/get_pvol_uk.R index 0a3775e..ef3a428 100644 --- a/R/get_pvol_uk.R +++ b/R/get_pvol_uk.R @@ -5,7 +5,9 @@ get_pvol_uk <- function( ..., call = rlang::caller_env() ) { - uk_odim_map <- c( + radar_name <- radar_recode( + radar, + call = call, ukcle = "clee-hill", ukham = "hameldon-hill", ukche = "chenies", @@ -23,7 +25,9 @@ get_pvol_uk <- function( ukmun = "munduff-hill", ukhmy = "high-moorsley" ) - uk_odim_map_radar_number <- c( + radar_number <- radar_recode( + radar, + call = call, ukcle = 3, ukham = 4, ukche = 5, @@ -55,9 +59,10 @@ get_pvol_uk <- function( ) } withr::with_file("file.h5", { - url <- glue::glue( - "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{uk_odim_map[radar]}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', uk_odim_map_radar_number[radar])}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" - ) + url <- glue::glue(getOption( + "getRad.uk_url", + "https://ncas-radar-o.s3-ext.jc.rl.ac.uk/uk-wsr-visualizer-public/ukmo-nimrod/pvol/{radar_name}/{format(time,'%Y/%m/%d')}/{pulse_type}/{format(time,'%Y%m%d')}_polar_pl_radar{sprintf('%02d', radar_number)}_aggregate_{pulse_type}_{format(time,'%H%M')}.h5" + )) req <- tryCatch( httr2::request(url) |> req_user_agent_getrad() |> diff --git a/tests/testthat/test-get_pvol_uk.R b/tests/testthat/test-get_pvol_uk.R index 9a0d16f..fff9c4d 100644 --- a/tests/testthat/test-get_pvol_uk.R +++ b/tests/testthat/test-get_pvol_uk.R @@ -30,6 +30,10 @@ test_that("404 no data", { get_pvol("ukcas", as.POSIXct("2012-4-1 10:00:10")), class = "getRad_error_uk_no_data_404" ) + expect_error( + get_pvol("ukcos", as.POSIXct("2012-4-1 10:00:10")), + class = "getRad_error_radar_not_found" + ) }) test_that("no sp data", {