From d34c345cab07ad14590cab825306ab2629ca28dc Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 15:11:12 -0400 Subject: [PATCH 01/34] added nexrad to sources in get_vpts --- R/get_vpts.R | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/R/get_vpts.R b/R/get_vpts.R index 9b3826c..7030044 100644 --- a/R/get_vpts.R +++ b/R/get_vpts.R @@ -34,8 +34,8 @@ #' - A vector of datetimes or dates, between which all data files are #' downloaded. #' - A [lubridate::interval()], between which all data files are downloaded. -#' @param source Source of the data. One of `"baltrad"`, `"uva"`, `"ecog-04003"` -#' or `"rmi"`. Only one source can be queried at a time. If not provided, +#' @param source Source of the data. One of `"baltrad"`, `"uva"`, `"ecog-04003"`, +#' `"rmi"`, or `"nexrad"`. Only one source can be queried at a time. If not provided, #' `"baltrad"` is used. Alternatively a local directory can be specified, #' see details for an explanation of the file format. #' @param return_type Type of object that should be returned. Either: @@ -77,10 +77,12 @@ #' source = "baltrad", #' return_type = "tibble" #' ) +#' #' Get VPTS data from the public BirdCast NEXRAD archive +#' get_vpts(radar = "KABR", datetime = "2023-01-01", source = "nexrad") get_vpts <- function( radar, datetime, - source = c("baltrad", "uva", "ecog-04003", "rmi"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), return_type = c("vpts", "tibble") ) { # Input checks ---- @@ -205,14 +207,19 @@ get_vpts <- function( # Query the selected radars ---- # Directing to the correct get_vpts_* helper based on source. cl <- rlang::caller_env(0) + + aloft_sources <- eval(formals("get_vpts_aloft")$source) + + source_type <- dplyr::case_when( + source == "rmi" ~ "rmi", + source == "nexrad" ~ "nexrad", + source %in% aloft_sources ~ "aloft", + dir.exists(source) ~ "local" + ) + fetched_vpts <- switch( - dplyr::case_when( - source == "rmi" ~ "rmi", - source %in% eval(formals("get_vpts_aloft")$source) ~ "aloft", - # this is the last option to avoid using a local source if an online exists - dir.exists(source) ~ "local" - ), + source_type, rmi = purrr::map( radar, ~ get_vpts_rmi(.x, rounded_interval), @@ -227,6 +234,14 @@ get_vpts <- function( ), .purrr_error_call = cl ), + nexrad = purrr::map( + radar, + ~ get_vpts_nexrad( + .x, + rounded_interval = rounded_interval + ), + .purrr_error_call = cl + ), local = get_vpts_local(radar, rounded_interval, directory = source) ) |> radar_to_name() From c398060b3bb21a42a9e94bbb589574d3e37d76e5 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 15:11:50 -0400 Subject: [PATCH 02/34] added get_vpts_nexrad helper function and associated test --- R/get_vpts_nexrad.R | 82 +++++++++++++++++++++++++++ tests/testthat/test-get_vpts_nexrad.R | 54 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 R/get_vpts_nexrad.R create mode 100644 tests/testthat/test-get_vpts_nexrad.R diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R new file mode 100644 index 0000000..502e309 --- /dev/null +++ b/R/get_vpts_nexrad.R @@ -0,0 +1,82 @@ +#' Get VPTS data from the public BirdCast NEXRAD archive +#' +#' Gets VPTS data from the public BirdCast NEXRAD archive. +#' +#' @details +#' By default, data are retrieved from the public BirdCast S3 archive at +#' `https://birdcastdata.s3.amazonaws.com/nexrad`. +#' +#' The default path format is monthly: +#' `"{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz"`. +#' +#' To read daily files, set: +#' `options(getRad.vpts_nexrad_path_format = +#' "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv")`. +#' +#' @section Inner working: +#' - Constructs the S3 paths for the VPTS files based on the input. +#' - Performs parallel HTTP requests to fetch the VPTS CSV data. +#' - Parses the response bodies with the shared VPTS column classes. +#' - Uses uppercase NEXRAD radar codes for archive paths. +#' - Adds a column with the radar source. +#' +#' @param radar NEXRAD radar code. +#' @param rounded_interval Interval to fetch data for, rounded to nearest day. +#' @return A tibble with VPTS data. +#' @keywords internal +get_vpts_nexrad <- function(radar, rounded_interval) { + radar <- toupper(radar) + + path_format <- getOption( + "getRad.vpts_nexrad_path_format", + "{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz" + ) + + prefix <- if (grepl("\\{day\\}", path_format)) { + "daily" + } else { + "monthly" + } + + base_url <- file.path( + "https://birdcastdata.s3.amazonaws.com/nexrad", + prefix + ) + + dates <- seq( + lubridate::as_date(lubridate::int_start(rounded_interval)), + lubridate::as_date(lubridate::int_end(rounded_interval)), + by = "day" + ) + + paths <- purrr::map_chr( + dates, + \(date) { + glue::glue( + path_format, + radar = radar, + year = lubridate::year(date), + month = sprintf("%02d", lubridate::month(date)), + day = sprintf("%02d", lubridate::day(date)), + date = date + ) + } + ) + + urls <- unique(file.path(base_url, paths)) + + out <- + read_vpts_from_url(urls) |> + purrr::keep(.p = ~ as.logical(nrow(.x))) |> + purrr::list_rbind() + + if (nrow(out) == 0) { + return(tibble::tibble()) + } + + out |> + dplyr::mutate( + radar = tolower(.data$radar), + source = "nexrad" + ) +} \ No newline at end of file diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R new file mode 100644 index 0000000..33e5015 --- /dev/null +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -0,0 +1,54 @@ +test_that("get_vpts_nexrad() can fetch monthly VPTS data from BirdCast archive", { + skip_if_offline() + + nexrad_vpts_tbl <- get_vpts_nexrad( + radar = "KABR", + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ) + + expect_type( + nexrad_vpts_tbl, + "list" + ) + + expect_s3_class( + nexrad_vpts_tbl, + "tbl_df" + ) + + expect_named( + nexrad_vpts_tbl, + c( + "datetime", + "radar", + "height", + "u", + "v", + "w", + "ff", + "dd", + "sd_vvp", + "gap", + "eta", + "dens", + "dbz", + "dbz_all", + "n", + "n_dbz", + "n_all", + "n_dbz_all", + "rcs", + "sd_vvp_threshold", + "vcp", + "radar_latitude", + "radar_longitude", + "radar_height", + "radar_wavelength", + "source_file", + "source" + ) + ) + + expect_true(all(nexrad_vpts_tbl$radar == "kabr")) + expect_true(all(nexrad_vpts_tbl$source == "nexrad")) +}) \ No newline at end of file From 1531b523329b7bea5cedfef71f8999b8104c75f8 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:01:53 -0400 Subject: [PATCH 03/34] added nexrad to generic get_vpts_coverage file --- R/get_vpts_coverage.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/get_vpts_coverage.R b/R/get_vpts_coverage.R index 303aa66..4fb95fb 100644 --- a/R/get_vpts_coverage.R +++ b/R/get_vpts_coverage.R @@ -3,7 +3,7 @@ #' Gets the VPTS file coverage from supported sources per radar and date. #' #' @param source Source of the data. One or more of `"baltrad"`, `"uva"`, -#' `"ecog-04003"` or `"rmi"`. If not provided, `"baltrad"` is used. +#' `"ecog-04003"` or `"rmi"` or `"nexrad"`. If not provided, `"baltrad"` is used. #' Alternatively `"all"` can be used if data from all sources should be #' returned. #' @param ... Arguments passed on to internal functions. @@ -13,7 +13,7 @@ #' @examplesIf interactive() #' get_vpts_coverage() get_vpts_coverage <- function( - source = c("baltrad", "uva", "ecog-04003", "rmi"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), ... ) { # argument all returns all possible sources @@ -40,7 +40,8 @@ get_vpts_coverage <- function( rmi = get_vpts_coverage_rmi, baltrad = get_vpts_coverage_aloft, uva = get_vpts_coverage_aloft, - "ecog-04003" = get_vpts_coverage_aloft + "ecog-04003" = get_vpts_coverage_aloft, + nexrad = get_vpts_coverage_nexrad ) cl <- rlang::caller_env(0) # Run the helpers, but every helper only once. @@ -52,4 +53,4 @@ get_vpts_coverage <- function( dplyr::bind_rows() |> dplyr::filter(source %in% !!source) |> dplyr::relocate("source", "radar", "date") -} +} \ No newline at end of file From dc161c1df4e1feea99dcd00d0c2fbab1b8391ea6 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:06:54 -0400 Subject: [PATCH 04/34] added separate getRad.nexrad_vpts_data_url as the processed data URL differs from the raw data URL --- R/zzz.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/zzz.R b/R/zzz.R index c5bfef3..0f6eb39 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -21,6 +21,7 @@ ), getRad.aloft_data_url = "https://aloftdata.s3-eu-west-1.amazonaws.com", getRad.nexrad_data_url = "https://unidata-nexrad-level2.s3.amazonaws.com", + getRad.nexrad_vpts_data_url = "https://birdcastdata.s3.amazonaws.com", getRad.cache = cachem::cache_mem( max_size = 128 * 1024^2, max_age = 60^2 * 24 From 4250dce72a6bf57500c347e37a726ebfb67f4d72 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:07:30 -0400 Subject: [PATCH 05/34] changed to getRad.nexrad_vpts_data_url --- R/get_vpts_coverage_nexrad.R | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 R/get_vpts_coverage_nexrad.R diff --git a/R/get_vpts_coverage_nexrad.R b/R/get_vpts_coverage_nexrad.R new file mode 100644 index 0000000..d8b6954 --- /dev/null +++ b/R/get_vpts_coverage_nexrad.R @@ -0,0 +1,49 @@ +#' Get VPTS file coverage from the public BirdCast NEXRAD archive +#' +#' Gets the VPTS file coverage from the public BirdCast NEXRAD archive. This is +#' derived from a coverage file at +#' <`r file.path(getOption("getRad.nexrad_vpts_data_url"), "coverage.csv")`>. By +#' default this file is cached for 6 hours. +#' +#' @param call A call used for error messaging. +#' @inheritParams req_cache_getrad +#' @return A data frame of the coverage file in the NEXRAD VPTS archive. +#' @noRd +#' @examplesIf interactive() +#' get_vpts_coverage_nexrad() +get_vpts_coverage_nexrad <- function( + use_cache = TRUE, + ..., + call = rlang::caller_env() +) { + nexrad_vpts_data_url <- getOption("getRad.nexrad_vpts_data_url") + + coverage_raw <- + httr2::request(nexrad_vpts_data_url) |> + httr2::req_url_path_append("coverage.csv") |> + req_user_agent_getrad() |> + req_retry_getrad() |> + req_cache_getrad(use_cache = use_cache) |> + httr2::req_progress(type = "down") |> + httr2::req_perform(error_call = call) |> + httr2::resp_body_raw() + + coverage <- + vroom::vroom( + coverage_raw, + progress = FALSE, + show_col_types = FALSE + ) |> + dplyr::mutate( + source = string_extract(.data$directory, "^[^/]+"), + radar = string_extract(.data$directory, "(?<=daily\\/)[A-Z0-9]{4}"), + date = as.Date( + string_extract( + .data$directory, + "[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$" + ) + ) + ) + + return(coverage) +} \ No newline at end of file From d299ff4cb8116b85f0310b358922f0569b085aa4 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:12:44 -0400 Subject: [PATCH 06/34] added nexrad test to generic test-get_vpts_coverage file --- tests/testthat/test-get_vpts_coverage.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-get_vpts_coverage.R b/tests/testthat/test-get_vpts_coverage.R index 2c69aa9..50d1173 100644 --- a/tests/testthat/test-get_vpts_coverage.R +++ b/tests/testthat/test-get_vpts_coverage.R @@ -10,7 +10,7 @@ test_that("Source argument as expected", { ) }) -test_that("format as expect for aloft", { +test_that("format as expected for aloft", { skip_if_offline() data <- get_vpts_coverage("uva") @@ -19,7 +19,7 @@ test_that("format as expect for aloft", { expect_true(all(is_odim(data$radar))) }) -test_that("format as expect for rmi", { +test_that("format as expected for rmi", { skip_if_offline("opendata.meteo.be") data <- get_vpts_coverage("rmi") @@ -28,6 +28,16 @@ test_that("format as expect for rmi", { expect_true(all(is_odim(data$radar))) }) +test_that("format as expected for nexrad", { + skip_if_offline() + + data <- get_vpts_coverage("nexrad") + expect_true(all(c("source", "radar", "date") %in% names(data))) + expect_s3_class(data$date, "Date") + expect_true(all(grepl("^[A-Z0-9]{4}$", data$radar))) + expect_true(all(data$source == "nexrad")) +}) + test_that("combined retrieval works", { skip_if_offline("opendata.meteo.be") From 8085e44807f94fce2f85b747574a6cccc3dd01cc Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:13:03 -0400 Subject: [PATCH 07/34] added specific test-get_vpts_coverage_nexrad test --- .../testthat/test-get_vpts_coverage_nexrad.R | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/testthat/test-get_vpts_coverage_nexrad.R diff --git a/tests/testthat/test-get_vpts_coverage_nexrad.R b/tests/testthat/test-get_vpts_coverage_nexrad.R new file mode 100644 index 0000000..9fca606 --- /dev/null +++ b/tests/testthat/test-get_vpts_coverage_nexrad.R @@ -0,0 +1,28 @@ +test_that("get_vpts_coverage_nexrad() returns a tibble", { + skip_if_offline() + + expect_s3_class( + get_vpts_coverage_nexrad(), + "tbl_df" + ) +}) + +test_that("get_vpts_coverage_nexrad() returns the expected columns", { + skip_if_offline() + + expect_named( + get_vpts_coverage_nexrad(), + c("directory", "file_count", "source", "radar", "date") + ) +}) + +test_that("get_vpts_coverage_nexrad() returns expected NEXRAD values", { + skip_if_offline() + + coverage <- get_vpts_coverage_nexrad() + + expect_true(all(coverage$source == "nexrad")) + expect_s3_class(coverage$date, "Date") + expect_true(all(grepl("^[A-Z0-9]{4}$", coverage$radar))) + expect_true(all(grepl("^nexrad/daily/[A-Z0-9]{4}/[0-9]{4}/[0-9]{2}/[0-9]{2}$", coverage$directory))) +}) \ No newline at end of file From 483630aae6f6a1045552b82e8383ef77691e76e8 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 16:17:49 -0400 Subject: [PATCH 08/34] regenerated docs --- man/get_vpts.Rd | 8 +++++--- man/get_vpts_coverage.Rd | 7 +++++-- man/get_vpts_nexrad.Rd | 41 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 man/get_vpts_nexrad.Rd diff --git a/man/get_vpts.Rd b/man/get_vpts.Rd index dd6512a..6036d63 100644 --- a/man/get_vpts.Rd +++ b/man/get_vpts.Rd @@ -7,7 +7,7 @@ get_vpts( radar, datetime, - source = c("baltrad", "uva", "ecog-04003", "rmi"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), return_type = c("vpts", "tibble") ) } @@ -26,8 +26,8 @@ downloaded. \item A \code{\link[lubridate:interval]{lubridate::interval()}}, between which all data files are downloaded. }} -\item{source}{Source of the data. One of \code{"baltrad"}, \code{"uva"}, \code{"ecog-04003"} -or \code{"rmi"}. Only one source can be queried at a time. If not provided, +\item{source}{Source of the data. One of \code{"baltrad"}, \code{"uva"}, \code{"ecog-04003"}, +\code{"rmi"}, or \code{"nexrad"}. Only one source can be queried at a time. If not provided, \code{"baltrad"} is used. Alternatively a local directory can be specified, see details for an explanation of the file format.} @@ -101,5 +101,7 @@ get_vpts( source = "baltrad", return_type = "tibble" ) +#' Get VPTS data from the public BirdCast NEXRAD archive +get_vpts(radar = "KABR", datetime = "2023-01-01", source = "nexrad") \dontshow{\}) # examplesIf} } diff --git a/man/get_vpts_coverage.Rd b/man/get_vpts_coverage.Rd index af8087e..2564e31 100644 --- a/man/get_vpts_coverage.Rd +++ b/man/get_vpts_coverage.Rd @@ -4,11 +4,14 @@ \alias{get_vpts_coverage} \title{Get VPTS file coverage from supported sources} \usage{ -get_vpts_coverage(source = c("baltrad", "uva", "ecog-04003", "rmi"), ...) +get_vpts_coverage( + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + ... +) } \arguments{ \item{source}{Source of the data. One or more of \code{"baltrad"}, \code{"uva"}, -\code{"ecog-04003"} or \code{"rmi"}. If not provided, \code{"baltrad"} is used. +\code{"ecog-04003"} or \code{"rmi"} or \code{"nexrad"}. If not provided, \code{"baltrad"} is used. Alternatively \code{"all"} can be used if data from all sources should be returned.} diff --git a/man/get_vpts_nexrad.Rd b/man/get_vpts_nexrad.Rd new file mode 100644 index 0000000..fd7423f --- /dev/null +++ b/man/get_vpts_nexrad.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_vpts_nexrad.R +\name{get_vpts_nexrad} +\alias{get_vpts_nexrad} +\title{Get VPTS data from the public BirdCast NEXRAD archive} +\usage{ +get_vpts_nexrad(radar, rounded_interval) +} +\arguments{ +\item{radar}{NEXRAD radar code.} + +\item{rounded_interval}{Interval to fetch data for, rounded to nearest day.} +} +\value{ +A tibble with VPTS data. +} +\description{ +Gets VPTS data from the public BirdCast NEXRAD archive. +} +\details{ +By default, data are retrieved from the public BirdCast S3 archive at +\verb{https://birdcastdata.s3.amazonaws.com/nexrad}. + +The default path format is monthly: +\code{"{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz"}. + +To read daily files, set: +\code{options(getRad.vpts_nexrad_path_format = "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv")}. +} +\section{Inner working}{ + +\itemize{ +\item Constructs the S3 paths for the VPTS files based on the input. +\item Performs parallel HTTP requests to fetch the VPTS CSV data. +\item Parses the response bodies with the shared VPTS column classes. +\item Uses uppercase NEXRAD radar codes for archive paths. +\item Adds a column with the radar source. +} +} + +\keyword{internal} From 54c79a127051d9bf905f67e15e5795ceca6de531 Mon Sep 17 00:00:00 2001 From: iskandari Date: Fri, 8 May 2026 23:59:30 -0400 Subject: [PATCH 09/34] change get-vpts_nexrad to only read daily not to gunzip --- R/get_vpts_nexrad.R | 40 +++++++-------------------- tests/testthat/test-get_vpts_nexrad.R | 13 ++++----- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 502e309..1e679f2 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -4,17 +4,13 @@ #' #' @details #' By default, data are retrieved from the public BirdCast S3 archive at -#' `https://birdcastdata.s3.amazonaws.com/nexrad`. +#' `https://birdcastdata.s3.amazonaws.com/nexrad/daily`. #' -#' The default path format is monthly: -#' `"{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz"`. -#' -#' To read daily files, set: -#' `options(getRad.vpts_nexrad_path_format = -#' "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv")`. +#' The expected path format is: +#' `"{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv"`. #' #' @section Inner working: -#' - Constructs the S3 paths for the VPTS files based on the input. +#' - Constructs the S3 paths for the daily VPTS files based on the input. #' - Performs parallel HTTP requests to fetch the VPTS CSV data. #' - Parses the response bodies with the shared VPTS column classes. #' - Uses uppercase NEXRAD radar codes for archive paths. @@ -27,46 +23,30 @@ get_vpts_nexrad <- function(radar, rounded_interval) { radar <- toupper(radar) - path_format <- getOption( - "getRad.vpts_nexrad_path_format", - "{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz" - ) - - prefix <- if (grepl("\\{day\\}", path_format)) { - "daily" - } else { - "monthly" - } - - base_url <- file.path( - "https://birdcastdata.s3.amazonaws.com/nexrad", - prefix - ) - dates <- seq( lubridate::as_date(lubridate::int_start(rounded_interval)), lubridate::as_date(lubridate::int_end(rounded_interval)), by = "day" ) - paths <- purrr::map_chr( + s3_paths <- purrr::map_chr( dates, \(date) { glue::glue( - path_format, + "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv", radar = radar, year = lubridate::year(date), month = sprintf("%02d", lubridate::month(date)), - day = sprintf("%02d", lubridate::day(date)), - date = date + day = sprintf("%02d", lubridate::day(date)) ) } ) - urls <- unique(file.path(base_url, paths)) + base_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" out <- - read_vpts_from_url(urls) |> + paste(base_url, s3_paths, sep = "/") |> + read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> purrr::list_rbind() diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R index 33e5015..0e3fd5e 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -1,16 +1,11 @@ -test_that("get_vpts_nexrad() can fetch monthly VPTS data from BirdCast archive", { +test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { skip_if_offline() - nexrad_vpts_tbl <- get_vpts_nexrad( + nexrad_vpts_tbl <- getRad:::get_vpts_nexrad( radar = "KABR", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ) - expect_type( - nexrad_vpts_tbl, - "list" - ) - expect_s3_class( nexrad_vpts_tbl, "tbl_df" @@ -19,9 +14,10 @@ test_that("get_vpts_nexrad() can fetch monthly VPTS data from BirdCast archive", expect_named( nexrad_vpts_tbl, c( - "datetime", "radar", + "datetime", "height", + "height_reference", "u", "v", "w", @@ -49,6 +45,7 @@ test_that("get_vpts_nexrad() can fetch monthly VPTS data from BirdCast archive", ) ) + expect_true(nrow(nexrad_vpts_tbl) > 0) expect_true(all(nexrad_vpts_tbl$radar == "kabr")) expect_true(all(nexrad_vpts_tbl$source == "nexrad")) }) \ No newline at end of file From dc82da0a87ff99cf81248037ccd00ec3fd5c386e Mon Sep 17 00:00:00 2001 From: iskandari Date: Sat, 9 May 2026 00:06:32 -0400 Subject: [PATCH 10/34] added coverage functionality to get_vpts_nexrad --- R/get_vpts_nexrad.R | 77 ++++++++++++++++++--------- tests/testthat/test-get_vpts_nexrad.R | 64 ++++++++++++++++++++++ 2 files changed, 115 insertions(+), 26 deletions(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 1e679f2..43efa9b 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -10,7 +10,9 @@ #' `"{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv"`. #' #' @section Inner working: -#' - Constructs the S3 paths for the daily VPTS files based on the input. +#' - Checks that the requested radar is present in the NEXRAD coverage file. +#' - Checks that data exist for the requested radar/date combination. +#' - Constructs the S3 paths for the daily VPTS files from the coverage file. #' - Performs parallel HTTP requests to fetch the VPTS CSV data. #' - Parses the response bodies with the shared VPTS column classes. #' - Uses uppercase NEXRAD radar codes for archive paths. @@ -18,43 +20,66 @@ #' #' @param radar NEXRAD radar code. #' @param rounded_interval Interval to fetch data for, rounded to nearest day. +#' @param coverage A data frame containing the coverage of the BirdCast NEXRAD +#' archive. If not provided, it will be fetched via the internet. #' @return A tibble with VPTS data. #' @keywords internal -get_vpts_nexrad <- function(radar, rounded_interval) { +get_vpts_nexrad <- function( + radar, + rounded_interval, + coverage = get_vpts_coverage_nexrad() +) { radar <- toupper(radar) - dates <- seq( - lubridate::as_date(lubridate::int_start(rounded_interval)), - lubridate::as_date(lubridate::int_end(rounded_interval)), - by = "day" + # Check that only one radar is provided. + check_odim_scalar(radar) + + # Check if the requested radar is present in the coverage. + if (!all(radar %in% coverage$radar)) { + missing_radar <- radar[!radar %in% coverage$radar] + + cli::cli_abort( + "Can't find radar {.val {missing_radar}} in the NEXRAD coverage file + (see {.fun get_vpts_coverage}).", + missing_radar = missing_radar, + class = "getRad_error_nexrad_radar_not_found" + ) + } + + # Check if the requested radar/date combination is present in the coverage. + filtered_coverage <- dplyr::filter( + coverage, + .data$radar %in% radar, + .data$date %within% rounded_interval ) - s3_paths <- purrr::map_chr( - dates, - \(date) { - glue::glue( + if (nrow(filtered_coverage) == 0) { + cli::cli_abort( + "Can't find any data for the requested radar(s) and date(s).", + class = "getRad_error_date_not_found" + ) + } + + # Convert the selected coverage rows into paths on the BirdCast NEXRAD archive. + s3_paths <- filtered_coverage |> + dplyr::mutate( + path = glue::glue( "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv", - radar = radar, - year = lubridate::year(date), - month = sprintf("%02d", lubridate::month(date)), - day = sprintf("%02d", lubridate::day(date)) + radar = .data$radar, + year = lubridate::year(.data$date), + month = sprintf("%02d", lubridate::month(.data$date)), + day = sprintf("%02d", lubridate::day(.data$date)) ) - } - ) + ) |> + dplyr::pull(.data$path) - base_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" + # Read the VPTS CSV files. + nexrad_data_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" - out <- - paste(base_url, s3_paths, sep = "/") |> + paste(nexrad_data_url, s3_paths, sep = "/") |> read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> - purrr::list_rbind() - - if (nrow(out) == 0) { - return(tibble::tibble()) - } - - out |> + purrr::list_rbind() |> dplyr::mutate( radar = tolower(.data$radar), source = "nexrad" diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R index 0e3fd5e..94b97bc 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -1,3 +1,62 @@ +test_that("get_vpts_nexrad() returns error on invalid radar code", { + expect_error( + getRad:::get_vpts_nexrad( + radar = "KAB", + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ), + class = "getRad_error_radar_not_single_odim_string" + ) + + expect_error( + getRad:::get_vpts_nexrad( + radar = 12345, + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ), + class = "getRad_error_radar_not_single_odim_string" + ) +}) + +test_that("get_vpts_nexrad() returns error when multiple radars are queried", { + expect_error( + getRad:::get_vpts_nexrad( + radar = c("KABR", "KABX"), + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ), + class = "getRad_error_radar_not_single_odim_string" + ) +}) + +test_that("get_vpts_nexrad() returns error when radar is not found in coverage", { + expect_error( + getRad:::get_vpts_nexrad( + radar = "ZZZZZ", + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ), + class = "getRad_error_nexrad_radar_not_found" + ) + + expect_identical( + rlang::catch_cnd( + getRad:::get_vpts_nexrad( + radar = "ZZZZZ", + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + ), + classes = "getRad_error_nexrad_radar_not_found" + )$missing_radar, + "ZZZZZ" + ) +}) + +test_that("get_vpts_nexrad() returns error when date is requested not in coverage", { + expect_error( + getRad:::get_vpts_nexrad( + radar = "KABR", + rounded_interval = lubridate::interval("1900-01-01", "1900-01-02") + ), + class = "getRad_error_date_not_found" + ) +}) + test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { skip_if_offline() @@ -6,6 +65,11 @@ test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ) + expect_type( + nexrad_vpts_tbl, + "list" + ) + expect_s3_class( nexrad_vpts_tbl, "tbl_df" From 152d6067feb6ba150e81418fd799f726ad057fab Mon Sep 17 00:00:00 2001 From: iskandari Date: Sat, 9 May 2026 00:09:33 -0400 Subject: [PATCH 11/34] test against check_odim_nexrad_scalar() --- tests/testthat/test-get_vpts_nexrad.R | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R index 94b97bc..70406b4 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -4,7 +4,7 @@ test_that("get_vpts_nexrad() returns error on invalid radar code", { radar = "KAB", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ), - class = "getRad_error_radar_not_single_odim_string" + class = "getRad_error_radar_not_single_odim_nexrad" ) expect_error( @@ -12,7 +12,7 @@ test_that("get_vpts_nexrad() returns error on invalid radar code", { radar = 12345, rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ), - class = "getRad_error_radar_not_single_odim_string" + class = "getRad_error_radar_not_single_odim_nexrad" ) }) @@ -22,14 +22,14 @@ test_that("get_vpts_nexrad() returns error when multiple radars are queried", { radar = c("KABR", "KABX"), rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ), - class = "getRad_error_radar_not_single_odim_string" + class = "getRad_error_radar_not_single_odim_nexrad" ) }) test_that("get_vpts_nexrad() returns error when radar is not found in coverage", { expect_error( getRad:::get_vpts_nexrad( - radar = "ZZZZZ", + radar = "ZZZZ", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ), class = "getRad_error_nexrad_radar_not_found" @@ -38,12 +38,12 @@ test_that("get_vpts_nexrad() returns error when radar is not found in coverage", expect_identical( rlang::catch_cnd( getRad:::get_vpts_nexrad( - radar = "ZZZZZ", + radar = "ZZZZ", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ), classes = "getRad_error_nexrad_radar_not_found" )$missing_radar, - "ZZZZZ" + "ZZZZ" ) }) @@ -65,15 +65,8 @@ test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") ) - expect_type( - nexrad_vpts_tbl, - "list" - ) - - expect_s3_class( - nexrad_vpts_tbl, - "tbl_df" - ) + expect_type(nexrad_vpts_tbl, "list") + expect_s3_class(nexrad_vpts_tbl, "tbl_df") expect_named( nexrad_vpts_tbl, From 62ddfef38932f48068d963a15b7ace15fa1202a7 Mon Sep 17 00:00:00 2001 From: iskandari Date: Sat, 9 May 2026 00:11:00 -0400 Subject: [PATCH 12/34] test against check_odim_nexrad_scalar() --- R/get_vpts_nexrad.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 43efa9b..771426c 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -32,7 +32,7 @@ get_vpts_nexrad <- function( radar <- toupper(radar) # Check that only one radar is provided. - check_odim_scalar(radar) + check_odim_nexrad_scalar(radar) # Check if the requested radar is present in the coverage. if (!all(radar %in% coverage$radar)) { From 0a9397a665c7ddbd7188bcb31ab6200d5f62cb7d Mon Sep 17 00:00:00 2001 From: iskandari Date: Sat, 9 May 2026 00:20:39 -0400 Subject: [PATCH 13/34] lowercase what is in function argument, not the file --- R/get_vpts_nexrad.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 771426c..732f97f 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -81,7 +81,7 @@ get_vpts_nexrad <- function( purrr::keep(.p = ~ as.logical(nrow(.x))) |> purrr::list_rbind() |> dplyr::mutate( - radar = tolower(.data$radar), + radar = tolower(radar), source = "nexrad" ) } \ No newline at end of file From c2f57721154e5ad541190adba8423e6ba2252807 Mon Sep 17 00:00:00 2001 From: iskandari Date: Sun, 10 May 2026 00:03:38 -0400 Subject: [PATCH 14/34] create small test coverage tibble as opposed to downloading entire coverage.csv --- R/get_vpts_nexrad.R | 3 ++- tests/testthat/test-get_vpts_nexrad.R | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 732f97f..c46c201 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -75,13 +75,14 @@ get_vpts_nexrad <- function( # Read the VPTS CSV files. nexrad_data_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" + radar_out <- tolower(radar) paste(nexrad_data_url, s3_paths, sep = "/") |> read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> purrr::list_rbind() |> dplyr::mutate( - radar = tolower(radar), + radar = .env$radar_out, source = "nexrad" ) } \ No newline at end of file diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R index 70406b4..87f625c 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -1,8 +1,14 @@ +nexrad_coverage <- tibble::tibble( + radar = "KABR", + date = as.Date(c("2013-09-01", "2013-09-02")) +) + test_that("get_vpts_nexrad() returns error on invalid radar code", { expect_error( getRad:::get_vpts_nexrad( radar = "KAB", - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) @@ -10,7 +16,8 @@ test_that("get_vpts_nexrad() returns error on invalid radar code", { expect_error( getRad:::get_vpts_nexrad( radar = 12345, - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) @@ -20,7 +27,8 @@ test_that("get_vpts_nexrad() returns error when multiple radars are queried", { expect_error( getRad:::get_vpts_nexrad( radar = c("KABR", "KABX"), - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) @@ -30,7 +38,8 @@ test_that("get_vpts_nexrad() returns error when radar is not found in coverage", expect_error( getRad:::get_vpts_nexrad( radar = "ZZZZ", - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ), class = "getRad_error_nexrad_radar_not_found" ) @@ -39,7 +48,8 @@ test_that("get_vpts_nexrad() returns error when radar is not found in coverage", rlang::catch_cnd( getRad:::get_vpts_nexrad( radar = "ZZZZ", - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ), classes = "getRad_error_nexrad_radar_not_found" )$missing_radar, @@ -51,7 +61,8 @@ test_that("get_vpts_nexrad() returns error when date is requested not in coverag expect_error( getRad:::get_vpts_nexrad( radar = "KABR", - rounded_interval = lubridate::interval("1900-01-01", "1900-01-02") + rounded_interval = lubridate::interval("1900-01-01", "1900-01-02"), + coverage = nexrad_coverage ), class = "getRad_error_date_not_found" ) @@ -62,7 +73,8 @@ test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { nexrad_vpts_tbl <- getRad:::get_vpts_nexrad( radar = "KABR", - rounded_interval = lubridate::interval("2013-09-01", "2013-09-02") + rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), + coverage = nexrad_coverage ) expect_type(nexrad_vpts_tbl, "list") From c7fc5314d65f8d0d99353e4061ac90d363c864fb Mon Sep 17 00:00:00 2001 From: iskandari Date: Sun, 10 May 2026 00:06:38 -0400 Subject: [PATCH 15/34] formatted modified files with styler --- R/get_vpts_coverage.R | 7 +++---- R/get_vpts_coverage_nexrad.R | 9 ++++----- R/get_vpts_nexrad.R | 9 ++++----- tests/testthat/test-get_vpts_coverage_nexrad.R | 2 +- tests/testthat/test-get_vpts_nexrad.R | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/R/get_vpts_coverage.R b/R/get_vpts_coverage.R index 4fb95fb..cbf4b4f 100644 --- a/R/get_vpts_coverage.R +++ b/R/get_vpts_coverage.R @@ -13,9 +13,8 @@ #' @examplesIf interactive() #' get_vpts_coverage() get_vpts_coverage <- function( - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), - ... -) { + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + ...) { # argument all returns all possible sources if (rlang::is_scalar_character(source) && source == "all") { source <- rlang::eval_bare(formals(rlang::caller_fn(0))[["source"]]) @@ -53,4 +52,4 @@ get_vpts_coverage <- function( dplyr::bind_rows() |> dplyr::filter(source %in% !!source) |> dplyr::relocate("source", "radar", "date") -} \ No newline at end of file +} diff --git a/R/get_vpts_coverage_nexrad.R b/R/get_vpts_coverage_nexrad.R index d8b6954..61a5e50 100644 --- a/R/get_vpts_coverage_nexrad.R +++ b/R/get_vpts_coverage_nexrad.R @@ -12,10 +12,9 @@ #' @examplesIf interactive() #' get_vpts_coverage_nexrad() get_vpts_coverage_nexrad <- function( - use_cache = TRUE, - ..., - call = rlang::caller_env() -) { + use_cache = TRUE, + ..., + call = rlang::caller_env()) { nexrad_vpts_data_url <- getOption("getRad.nexrad_vpts_data_url") coverage_raw <- @@ -46,4 +45,4 @@ get_vpts_coverage_nexrad <- function( ) return(coverage) -} \ No newline at end of file +} diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index c46c201..599af73 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -25,10 +25,9 @@ #' @return A tibble with VPTS data. #' @keywords internal get_vpts_nexrad <- function( - radar, - rounded_interval, - coverage = get_vpts_coverage_nexrad() -) { + radar, + rounded_interval, + coverage = get_vpts_coverage_nexrad()) { radar <- toupper(radar) # Check that only one radar is provided. @@ -85,4 +84,4 @@ get_vpts_nexrad <- function( radar = .env$radar_out, source = "nexrad" ) -} \ No newline at end of file +} diff --git a/tests/testthat/test-get_vpts_coverage_nexrad.R b/tests/testthat/test-get_vpts_coverage_nexrad.R index 9fca606..6b8f126 100644 --- a/tests/testthat/test-get_vpts_coverage_nexrad.R +++ b/tests/testthat/test-get_vpts_coverage_nexrad.R @@ -25,4 +25,4 @@ test_that("get_vpts_coverage_nexrad() returns expected NEXRAD values", { expect_s3_class(coverage$date, "Date") expect_true(all(grepl("^[A-Z0-9]{4}$", coverage$radar))) expect_true(all(grepl("^nexrad/daily/[A-Z0-9]{4}/[0-9]{4}/[0-9]{2}/[0-9]{2}$", coverage$directory))) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_nexrad.R index 87f625c..be4cb94 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_nexrad.R @@ -117,4 +117,4 @@ test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { expect_true(nrow(nexrad_vpts_tbl) > 0) expect_true(all(nexrad_vpts_tbl$radar == "kabr")) expect_true(all(nexrad_vpts_tbl$source == "nexrad")) -}) \ No newline at end of file +}) From 0690ec8321c41917f742f08b404fbdf1dad3a23e Mon Sep 17 00:00:00 2001 From: iskandari Date: Sun, 10 May 2026 00:12:42 -0400 Subject: [PATCH 16/34] Apply air formatting --- R/get_vpts_coverage.R | 5 +++-- R/get_vpts_coverage_nexrad.R | 7 ++++--- R/get_vpts_nexrad.R | 7 ++++--- data/nexrad_stations.rda | Bin 0 -> 886 bytes tests/testthat/test-get_vpts_coverage_nexrad.R | 5 ++++- 5 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 data/nexrad_stations.rda diff --git a/R/get_vpts_coverage.R b/R/get_vpts_coverage.R index cbf4b4f..b086c2c 100644 --- a/R/get_vpts_coverage.R +++ b/R/get_vpts_coverage.R @@ -13,8 +13,9 @@ #' @examplesIf interactive() #' get_vpts_coverage() get_vpts_coverage <- function( - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), - ...) { + source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + ... +) { # argument all returns all possible sources if (rlang::is_scalar_character(source) && source == "all") { source <- rlang::eval_bare(formals(rlang::caller_fn(0))[["source"]]) diff --git a/R/get_vpts_coverage_nexrad.R b/R/get_vpts_coverage_nexrad.R index 61a5e50..2fc0d75 100644 --- a/R/get_vpts_coverage_nexrad.R +++ b/R/get_vpts_coverage_nexrad.R @@ -12,9 +12,10 @@ #' @examplesIf interactive() #' get_vpts_coverage_nexrad() get_vpts_coverage_nexrad <- function( - use_cache = TRUE, - ..., - call = rlang::caller_env()) { + use_cache = TRUE, + ..., + call = rlang::caller_env() +) { nexrad_vpts_data_url <- getOption("getRad.nexrad_vpts_data_url") coverage_raw <- diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 599af73..c791e5c 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -25,9 +25,10 @@ #' @return A tibble with VPTS data. #' @keywords internal get_vpts_nexrad <- function( - radar, - rounded_interval, - coverage = get_vpts_coverage_nexrad()) { + radar, + rounded_interval, + coverage = get_vpts_coverage_nexrad() +) { radar <- toupper(radar) # Check that only one radar is provided. diff --git a/data/nexrad_stations.rda b/data/nexrad_stations.rda new file mode 100644 index 0000000000000000000000000000000000000000..a837fd194e279618abc60c64fbf20afc2affb4f7 GIT binary patch literal 886 zcmV-+1Bv`XT4*^jL0KkKS#oMpqW}duf5QLz$p8QY2tYso|M0)(-oQWr5C8xH&;vet z_p`g4?&7=#il^Z)ifQ3b(i1_WLqISIf_h9e5i)3xL8Qs1kst;H02u%P2%2fB=ucAx zO{t)00000001YyxB-*B)njj2=8ca+RCXF;?0j3fuqGdG7dQVDZGJ1xZ4FJjNVF1uQ zMKZm^GFK+kA#YAGx=ctyqXqb8@ANUVOycj)bF;Uycbl+4X2U#bg{heD;=7w8zwA=d5}0zSipp=BIeE6*y2@vFR|kZVEeog5HRnB5GBENiS4Cl zXS;=Nsixao1CyiA+W`HKbDV&Bi}SaZA1E3c07_{fNuWbWX$d6_4YmS8h>{SJ)$@>) z)f|moA8pq9@%TA7JF(^OM;61#6>0KBxU>3*L`GEZ&9yDwrV9jKX1YaE)j{BL6Sxz} zR_CsOq>L5K0Etd6Q5LiamL%ZZOJN$t1$SCPf=mkxr3V@e7bt4?y<=koLQ!BuP(|Gi zbe;irlMF{jg{avJ*>M1@Niv3&aYahiX}Abt05lL*t#gexa9>*JR2}jO+R$Z;sx;#MH5@*z18FC&ge*n8$Y z)FyBeqzJ4)M3y=Vj>}sa-GTu`k@!~!w5(DQz2y-lTR=heVh8~ig4Q%ZLJb3ikmGYH zOLyzE{AXcyfKVed-%72v>ZL263dw*VGl@3tn}U$!j*q24BrITY5{WPZmLm}mU{F}V z7&XPbD7fRBa;BnTi9gd0P75>z!nK>4PMB(AM!8NG3LGC~jO1>;F0BrSn1-a8Qr=wAc=J5`vNf z7?KZ!#FzC?5{0LNWMCs0 MkxmpO9GaA Date: Sun, 10 May 2026 00:21:35 -0400 Subject: [PATCH 17/34] regenerated docs --- man/get_vpts_nexrad.Rd | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/man/get_vpts_nexrad.Rd b/man/get_vpts_nexrad.Rd index fd7423f..3fddbfc 100644 --- a/man/get_vpts_nexrad.Rd +++ b/man/get_vpts_nexrad.Rd @@ -4,12 +4,15 @@ \alias{get_vpts_nexrad} \title{Get VPTS data from the public BirdCast NEXRAD archive} \usage{ -get_vpts_nexrad(radar, rounded_interval) +get_vpts_nexrad(radar, rounded_interval, coverage = get_vpts_coverage_nexrad()) } \arguments{ \item{radar}{NEXRAD radar code.} \item{rounded_interval}{Interval to fetch data for, rounded to nearest day.} + +\item{coverage}{A data frame containing the coverage of the BirdCast NEXRAD +archive. If not provided, it will be fetched via the internet.} } \value{ A tibble with VPTS data. @@ -19,18 +22,17 @@ Gets VPTS data from the public BirdCast NEXRAD archive. } \details{ By default, data are retrieved from the public BirdCast S3 archive at -\verb{https://birdcastdata.s3.amazonaws.com/nexrad}. - -The default path format is monthly: -\code{"{radar}/{year}/{radar}_vpts_{year}{month}.csv.gz"}. +\verb{https://birdcastdata.s3.amazonaws.com/nexrad/daily}. -To read daily files, set: -\code{options(getRad.vpts_nexrad_path_format = "{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv")}. +The expected path format is: +\code{"{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv"}. } \section{Inner working}{ \itemize{ -\item Constructs the S3 paths for the VPTS files based on the input. +\item Checks that the requested radar is present in the NEXRAD coverage file. +\item Checks that data exist for the requested radar/date combination. +\item Constructs the S3 paths for the daily VPTS files from the coverage file. \item Performs parallel HTTP requests to fetch the VPTS CSV data. \item Parses the response bodies with the shared VPTS column classes. \item Uses uppercase NEXRAD radar codes for archive paths. From 85f0548f07c90618fc7c6cd30b7a36b0e582e6f7 Mon Sep 17 00:00:00 2001 From: iskandari Date: Sun, 10 May 2026 02:11:36 -0400 Subject: [PATCH 18/34] removed nexrad_stations.rda; removed nexrad form vpts_coverage vignette --- R/get_vpts_nexrad.R | 13 +++++++------ data/nexrad_stations.rda | Bin 886 -> 0 bytes tests/testthat/test-get_pvol_ee.R | 24 +++++++++++++++--------- vignettes/articles/vpts_coverage.Rmd | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) delete mode 100644 data/nexrad_stations.rda diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index c791e5c..7bf701f 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -77,12 +77,13 @@ get_vpts_nexrad <- function( nexrad_data_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" radar_out <- tolower(radar) - paste(nexrad_data_url, s3_paths, sep = "/") |> + out <- paste(nexrad_data_url, s3_paths, sep = "/") |> read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> - purrr::list_rbind() |> - dplyr::mutate( - radar = .env$radar_out, - source = "nexrad" - ) + purrr::list_rbind() + + out$radar <- radar_out + out$source <- "nexrad" + + out } diff --git a/data/nexrad_stations.rda b/data/nexrad_stations.rda deleted file mode 100644 index a837fd194e279618abc60c64fbf20afc2affb4f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 886 zcmV-+1Bv`XT4*^jL0KkKS#oMpqW}duf5QLz$p8QY2tYso|M0)(-oQWr5C8xH&;vet z_p`g4?&7=#il^Z)ifQ3b(i1_WLqISIf_h9e5i)3xL8Qs1kst;H02u%P2%2fB=ucAx zO{t)00000001YyxB-*B)njj2=8ca+RCXF;?0j3fuqGdG7dQVDZGJ1xZ4FJjNVF1uQ zMKZm^GFK+kA#YAGx=ctyqXqb8@ANUVOycj)bF;Uycbl+4X2U#bg{heD;=7w8zwA=d5}0zSipp=BIeE6*y2@vFR|kZVEeog5HRnB5GBENiS4Cl zXS;=Nsixao1CyiA+W`HKbDV&Bi}SaZA1E3c07_{fNuWbWX$d6_4YmS8h>{SJ)$@>) z)f|moA8pq9@%TA7JF(^OM;61#6>0KBxU>3*L`GEZ&9yDwrV9jKX1YaE)j{BL6Sxz} zR_CsOq>L5K0Etd6Q5LiamL%ZZOJN$t1$SCPf=mkxr3V@e7bt4?y<=koLQ!BuP(|Gi zbe;irlMF{jg{avJ*>M1@Niv3&aYahiX}Abt05lL*t#gexa9>*JR2}jO+R$Z;sx;#MH5@*z18FC&ge*n8$Y z)FyBeqzJ4)M3y=Vj>}sa-GTu`k@!~!w5(DQz2y-lTR=heVh8~ig4Q%ZLJb3ikmGYH zOLyzE{AXcyfKVed-%72v>ZL263dw*VGl@3tn}U$!j*q24BrITY5{WPZmLm}mU{F}V z7&XPbD7fRBa;BnTi9gd0P75>z!nK>4PMB(AM!8NG3LGC~jO1>;F0BrSn1-a8Qr=wAc=J5`vNf z7?KZ!#FzC?5{0LNWMCs0 MkxmpO9GaA group_by(radar) |> arrange(status) |> From 82f1494360e04e3f38a8fc3937e4c620c9948dca Mon Sep 17 00:00:00 2001 From: iskandari Date: Sun, 10 May 2026 02:26:04 -0400 Subject: [PATCH 19/34] added newline at end of test-get_pvol_ee --- tests/testthat/test-get_pvol_ee.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-get_pvol_ee.R b/tests/testthat/test-get_pvol_ee.R index bfcfcd3..087cf24 100644 --- a/tests/testthat/test-get_pvol_ee.R +++ b/tests/testthat/test-get_pvol_ee.R @@ -7,20 +7,19 @@ test_that("Pvol for estonia can be downloaded", { # The API frequently sends 429/500 responses, therefore this test is allowed # to skip when the download is unsuccessful. pvol <- tryCatch( - get_pvol( - "eesur", - time, - param = "all" - ), + get_pvol("eesur", time, param = "all"), error = function(e) NULL ) skip_if_not( inherits(pvol, "pvol"), - message = "PVOL download for Estonia was unsuccessful; success is variable in testing environments" + message = paste( + "PVOL download for Estonia was unsuccessful;", + "success is variable in testing environments" + ) ) expect_s3_class(pvol, "pvol") expect_true(bioRad::is.pvol(pvol)) expect_identical(pvol$datetime, lubridate::with_tz(time, "UTC")) -}) \ No newline at end of file +}) From f308a39a7a4f9101db4259621416c43a1bba8fe0 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 13:40:40 +0200 Subject: [PATCH 20/34] update vignette to also include birdcast dataset, also use svg output to keep vignette size reasonable --- vignettes/articles/vpts_coverage.Rmd | 104 +++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 12 deletions(-) diff --git a/vignettes/articles/vpts_coverage.Rmd b/vignettes/articles/vpts_coverage.Rmd index 266deca..0c215d9 100644 --- a/vignettes/articles/vpts_coverage.Rmd +++ b/vignettes/articles/vpts_coverage.Rmd @@ -23,12 +23,91 @@ library(htmltools) ``` ```{r data} -cvr <- get_vpts_coverage(c("baltrad", "uva", "ecog-04003", "rmi")) -wr <- get_weather_radars("opera") |> +cvr <- get_vpts_coverage("all") +wr <- get_weather_radars("all") |> group_by(radar) |> arrange(status) |> slice_tail(n = 1) ``` +```{r} +# there is a with issue in the svg, here is a temporary solution: https://github.com/r-spatial/leafpop/issues/25 +assignInNamespace("popupSVGraph",function(graphs, #dsn = tempdir(), + width = 300, height = 300, ...) { + lapply(1:length(graphs), function(i) { + #nm = paste0("tmp_", i, ".svg") + #fls = file.path(dsn, nm) + + inch_wdth = width / 96 + inch_hght = height / 96 + + #svg(filename = fls, width = inch_wdth, height = inch_hght, ...) + #print(graphs[[i]]) + #dev.off() + lns <- svglite::svgstring( + width = inch_wdth, + height = inch_hght, + standalone = FALSE + ) + print(graphs[[i]]) + dev.off() + + svg_str <- lns() + + # this is a temporary solution to work around svglite + # non-specific CSS styles + # perhaps we should separate out into its own function/utility + # also adds uuid dependency + svg_id <- paste0("x",uuid::UUIDgenerate()) + svg_str <- gsub( + x = svg_str, + pattern = " + # %s + # + # " , + # width, + # height, + # svg_str + # ) + # ) + pop = sprintf( + "
%s
", + width, + height, + svg_str + ) + + popTemplate = system.file("templates/popup-graph.brew", package = "leafpop") + myCon = textConnection("outputObj", open = "w") + brew::brew(popTemplate, output = myCon) + outputObj = outputObj + close(myCon) + + return(paste(outputObj, collapse = ' ')) + + }) +} +,"leafpop") +``` ```{r} @@ -48,20 +127,21 @@ for (i in unique(cvr$source)) { years <- seq(min(cvrsub$year), max(cvrsub$year), 1) cvrsub |> group_by(radar) |> - summarize(grph = list(ggplot(data = pick(everything())) + - geom_tile(aes(x = month, y = year, fill = (n / n_max) * 100)) + - scale_fill_viridis_c("Coverage", limits = c(0, 100), breaks = (0:5) * 20, labels = paste0((0:5) * 20, " [%]"), direction = -1) + + summarize(grph = list(ggplot(data = bind_rows(expand.grid(year=years, month=month.name, n=NA, n_max=NA), pick(everything())))+ + scale_x_discrete("Month", breaks = month.name, labels = month.name, limits = month.name) + + geom_raster(aes(x = month, y = year, fill = (n / n_max) * 100)) + + scale_fill_viridis_c("Coverage", limits = c(0, 100), breaks = (0:5) * 20, labels = paste0((0:5) * 20, " [%]"), direction = -1, na.value = "#FFF0") + theme_minimal() + - scale_y_continuous("Year", breaks = years, limits = range(years) + c(-.51, .51)) + + scale_y_continuous("Year", breaks=if(length(years)<6){ years}else{pretty(years)} , limits = range(years) + c(-.51, .51)) + theme( axis.text.x = element_text(angle = -90, vjust = 0.5, hjust = 0), plot.title = element_text(hjust = 0.5), - panel.grid = element_blank() + panel.grid = element_blank(), + legend.ticks = element_blank() ) + - ggtitle(radar) + - scale_x_discrete("Month", breaks = month.name, labels = month.name, limits = month.name))) -> res - res$grph[[1]] - suppressWarnings(res |> left_join(wr, by = join_by(radar))) -> res + ggtitle(radar) )) -> res +# res$grph[[1]] + suppressWarnings(res |> left_join(wr |> select(radar, longitude, latitude), by = join_by(radar))) -> res ll <- NULL if (any(is.na(res$longitude))) { ll <- p(glue::glue("The following radars were omitted from the map because they lack location information in OPERA: {glue::glue_collapse(res$radar[is.na(res$longitude)], ', ', last = ' and ' )}.")) @@ -74,7 +154,7 @@ for (i in unique(cvr$source)) { lat = res$latitude, label = res$radar, clusterOptions = markerClusterOptions(maxClusterRadius = 30), - popup = popupGraph(res$grph) + popup = popupGraph(res$grph, type = "svg") ) html <- c(html, list(h3(i), lft, ll)) } From 21f10b7c18f9e4f89a371766f81c65809893d030 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 13:54:57 +0200 Subject: [PATCH 21/34] Ensure radar is taken from environment (was attempting to many downloads) --- R/get_vpts_nexrad.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 7bf701f..211841b 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -49,7 +49,7 @@ get_vpts_nexrad <- function( # Check if the requested radar/date combination is present in the coverage. filtered_coverage <- dplyr::filter( coverage, - .data$radar %in% radar, + .data$radar %in% .env$radar, .data$date %within% rounded_interval ) From 9d211f23deac8740469e7af4961b053d69e0aeb9 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 13:59:36 +0200 Subject: [PATCH 22/34] make sure proper call is used for errors --- R/get_vpts_aloft.R | 13 +++++++++---- R/get_vpts_nexrad.R | 10 +++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/R/get_vpts_aloft.R b/R/get_vpts_aloft.R index 29a51b5..77cb1a1 100644 --- a/R/get_vpts_aloft.R +++ b/R/get_vpts_aloft.R @@ -30,7 +30,9 @@ get_vpts_aloft <- function( radar_odim_code, rounded_interval, source = c("baltrad", "uva", "ecog-04003"), - coverage = get_vpts_coverage_aloft() + coverage = get_vpts_coverage_aloft(), + ..., + call = rlang::caller_env() ) { # rename source argument for readability selected_source <- source @@ -45,7 +47,8 @@ get_vpts_aloft <- function( "Can't find radar {.val {missing_radar}} in the coverage file (see {.fun get_vpts_coverage}).", missing_radar = missing_radar, - class = "getRad_error_aloft_radar_not_found" + class = "getRad_error_aloft_radar_not_found", + call = call ) } @@ -61,7 +64,8 @@ get_vpts_aloft <- function( if (!at_least_one_radar_date_combination_exists) { cli::cli_abort( "Can't find any data for the requested radar(s) and date(s).", - class = "getRad_error_date_not_found" + class = "getRad_error_date_not_found", + call = call ) } @@ -79,7 +83,8 @@ get_vpts_aloft <- function( cli::cli_abort( "Can't find radar{?s} {.val {missing_radars}} in the coverage file (see {.fun get_vpts_coverage}).", - class = "getRad_error_radar_not_found" + class = "getRad_error_radar_not_found", + call = call ) } diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 211841b..107ba1d 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -27,7 +27,9 @@ get_vpts_nexrad <- function( radar, rounded_interval, - coverage = get_vpts_coverage_nexrad() + coverage = get_vpts_coverage_nexrad(), + ..., + call = rlang::caller_env() ) { radar <- toupper(radar) @@ -42,7 +44,8 @@ get_vpts_nexrad <- function( "Can't find radar {.val {missing_radar}} in the NEXRAD coverage file (see {.fun get_vpts_coverage}).", missing_radar = missing_radar, - class = "getRad_error_nexrad_radar_not_found" + class = "getRad_error_nexrad_radar_not_found", + call = call ) } @@ -56,7 +59,8 @@ get_vpts_nexrad <- function( if (nrow(filtered_coverage) == 0) { cli::cli_abort( "Can't find any data for the requested radar(s) and date(s).", - class = "getRad_error_date_not_found" + class = "getRad_error_date_not_found", + call = call ) } From f18b7ef6214374261614575e5f7840e2242886d6 Mon Sep 17 00:00:00 2001 From: bart1 <1662852+bart1@users.noreply.github.com> Date: Tue, 19 May 2026 14:06:54 +0200 Subject: [PATCH 23/34] Update R/get_vpts_nexrad.R --- R/get_vpts_nexrad.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 107ba1d..2be2d5f 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -78,10 +78,10 @@ get_vpts_nexrad <- function( dplyr::pull(.data$path) # Read the VPTS CSV files. - nexrad_data_url <- "https://birdcastdata.s3.amazonaws.com/nexrad/daily" + nexrad_data_url <- getOption("getRad.nexrad_vpts_data_url") radar_out <- tolower(radar) - out <- paste(nexrad_data_url, s3_paths, sep = "/") |> + out <- paste(nexrad_data_url, "nexrad", "daily", s3_paths, sep = "/") |> read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> purrr::list_rbind() From 2187bc299fb803cc3f396beb0012cc274c46a50e Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 14:47:14 +0200 Subject: [PATCH 24/34] import .env and update documentation --- CITATION.cff | 475 +++++++++++++++++++++++++++++++++++++- DESCRIPTION | 2 +- NAMESPACE | 1 + R/getRad-package.R | 1 + man/getRad-package.Rd | 2 +- man/get_pvol.Rd | 2 +- man/get_vpts.Rd | 2 +- man/get_vpts_aloft.Rd | 4 +- man/get_vpts_coverage.Rd | 2 +- man/get_vpts_nexrad.Rd | 8 +- man/get_weather_radars.Rd | 2 +- 11 files changed, 492 insertions(+), 9 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 5625ca1..c901d9d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "getRad" in publications use:' type: software license: MIT title: 'getRad: Download Radar Data for Biological Research' -version: 0.2.4 +version: 0.2.4.9000 doi: 10.32614/CRAN.package.getRad abstract: Load polar volume and vertical profile data for aeroecological research directly into R. With 'getRad' you can access data from several sources in Europe @@ -45,4 +45,477 @@ keywords: - r-package - radar - rstats +references: +- type: software + title: 'R: A Language and Environment for Statistical Computing' + notes: Depends + url: https://www.R-project.org/ + authors: + - name: R Core Team + institution: + name: R Foundation for Statistical Computing + address: Vienna, Austria + year: '2026' + version: '>= 4.1.0' +- type: software + title: bioRad + abstract: 'bioRad: Biological Analysis and Visualization of Weather Radar Data' + notes: Imports + url: https://github.com/adokter/bioRad/ + repository: https://CRAN.R-project.org/package=bioRad + authors: + - family-names: Dokter + given-names: Adriaan M. + email: biorad@cornell.edu + orcid: https://orcid.org/0000-0001-6573-066X + - family-names: Desmet + given-names: Peter + email: peter.desmet@inbo.be + orcid: https://orcid.org/0000-0002-8442-8025 + - family-names: Kranstauber + given-names: Bart + email: b.kranstauber@uva.nl + orcid: https://orcid.org/0000-0001-8303-780X + - family-names: Nilsson + given-names: Cecilia + email: cecilia.nilsson709@gmail.com + orcid: https://orcid.org/0000-0001-8957-4411 + - family-names: Tedeschi + given-names: Alexander + email: alexander.tedeschi@cornell.edu + orcid: https://orcid.org/0000-0003-0772-6931 + - family-names: Van Hoey + given-names: Stijn + email: stijnvanhoey@gmail.com + orcid: https://orcid.org/0000-0001-6413-3185 + year: '2026' + doi: 10.32614/CRAN.package.bioRad +- type: software + title: cachem + abstract: 'cachem: Cache R Objects with Automatic Pruning' + notes: Imports + url: https://cachem.r-lib.org/ + repository: https://CRAN.R-project.org/package=cachem + authors: + - family-names: Chang + given-names: Winston + email: winston@posit.co + year: '2026' + doi: 10.32614/CRAN.package.cachem +- type: software + title: cli + abstract: 'cli: Helpers for Developing Command Line Interfaces' + notes: Imports + url: https://cli.r-lib.org + repository: https://CRAN.R-project.org/package=cli + authors: + - family-names: Csárdi + given-names: Gábor + email: gabor@posit.co + year: '2026' + doi: 10.32614/CRAN.package.cli +- type: software + title: dplyr + abstract: 'dplyr: A Grammar of Data Manipulation' + notes: Imports + url: https://dplyr.tidyverse.org + repository: https://CRAN.R-project.org/package=dplyr + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + orcid: https://orcid.org/0000-0003-4757-117X + - family-names: François + given-names: Romain + orcid: https://orcid.org/0000-0002-2444-4226 + - family-names: Henry + given-names: Lionel + - family-names: Müller + given-names: Kirill + orcid: https://orcid.org/0000-0002-1416-3412 + - family-names: Vaughan + given-names: Davis + email: davis@posit.co + orcid: https://orcid.org/0000-0003-4777-038X + year: '2026' + doi: 10.32614/CRAN.package.dplyr + version: '>= 1.1.0' +- type: software + title: glue + abstract: 'glue: Interpreted String Literals' + notes: Imports + url: https://glue.tidyverse.org/ + repository: https://CRAN.R-project.org/package=glue + authors: + - family-names: Hester + given-names: Jim + orcid: https://orcid.org/0000-0002-2739-7082 + - family-names: Bryan + given-names: Jennifer + email: jenny@posit.co + orcid: https://orcid.org/0000-0002-6983-2759 + year: '2026' + doi: 10.32614/CRAN.package.glue +- type: software + title: httr2 + abstract: 'httr2: Perform HTTP Requests and Process the Responses' + notes: Imports + url: https://httr2.r-lib.org + repository: https://CRAN.R-project.org/package=httr2 + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2026' + doi: 10.32614/CRAN.package.httr2 + version: '>= 1.1.1' +- type: software + title: lubridate + abstract: 'lubridate: Make Dealing with Dates a Little Easier' + notes: Imports + url: https://lubridate.tidyverse.org + repository: https://CRAN.R-project.org/package=lubridate + authors: + - family-names: Spinu + given-names: Vitalie + email: spinuvit@gmail.com + - family-names: Grolemund + given-names: Garrett + - family-names: Wickham + given-names: Hadley + year: '2026' + doi: 10.32614/CRAN.package.lubridate +- type: software + title: purrr + abstract: 'purrr: Functional Programming Tools' + notes: Imports + url: https://purrr.tidyverse.org/ + repository: https://CRAN.R-project.org/package=purrr + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + orcid: https://orcid.org/0000-0003-4757-117X + - family-names: Henry + given-names: Lionel + email: lionel@posit.co + year: '2026' + doi: 10.32614/CRAN.package.purrr + version: '>= 1.0.0' +- type: software + title: rlang + abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features' + notes: Imports + url: https://rlang.r-lib.org + repository: https://CRAN.R-project.org/package=rlang + authors: + - family-names: Henry + given-names: Lionel + email: lionel@posit.co + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2026' + doi: 10.32614/CRAN.package.rlang +- type: software + title: tibble + abstract: 'tibble: Simple Data Frames' + notes: Imports + url: https://tibble.tidyverse.org/ + repository: https://CRAN.R-project.org/package=tibble + authors: + - family-names: Müller + given-names: Kirill + email: kirill@cynkra.com + orcid: https://orcid.org/0000-0002-1416-3412 + - family-names: Wickham + given-names: Hadley + email: hadley@rstudio.com + year: '2026' + doi: 10.32614/CRAN.package.tibble +- type: software + title: tools + abstract: 'R: A Language and Environment for Statistical Computing' + notes: Imports + authors: + - name: R Core Team + institution: + name: R Foundation for Statistical Computing + address: Vienna, Austria + year: '2026' +- type: software + title: utils + abstract: 'R: A Language and Environment for Statistical Computing' + notes: Imports + authors: + - name: R Core Team + institution: + name: R Foundation for Statistical Computing + address: Vienna, Austria + year: '2026' +- type: software + title: vroom + abstract: 'vroom: Read and Write Rectangular Text Data Quickly' + notes: Imports + url: https://vroom.tidyverse.org + repository: https://CRAN.R-project.org/package=vroom + authors: + - family-names: Hester + given-names: Jim + orcid: https://orcid.org/0000-0002-2739-7082 + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + orcid: https://orcid.org/0000-0003-4757-117X + - family-names: Bryan + given-names: Jennifer + email: jenny@posit.co + orcid: https://orcid.org/0000-0002-6983-2759 + year: '2026' + doi: 10.32614/CRAN.package.vroom +- type: software + title: withr + abstract: 'withr: Run Code ''With'' Temporarily Modified Global State' + notes: Imports + url: https://withr.r-lib.org + repository: https://CRAN.R-project.org/package=withr + authors: + - family-names: Hester + given-names: Jim + - family-names: Henry + given-names: Lionel + email: lionel@posit.co + - family-names: Müller + given-names: Kirill + email: krlmlr+r@mailbox.org + - family-names: Ushey + given-names: Kevin + email: kevinushey@gmail.com + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + - family-names: Chang + given-names: Winston + year: '2026' + doi: 10.32614/CRAN.package.withr +- type: software + title: xml2 + abstract: 'xml2: Parse XML' + notes: Imports + url: https://xml2.r-lib.org + repository: https://CRAN.R-project.org/package=xml2 + authors: + - family-names: Wickham + given-names: Hadley + - family-names: Hester + given-names: Jim + - family-names: Ooms + given-names: Jeroen + email: jeroenooms@gmail.com + year: '2026' + doi: 10.32614/CRAN.package.xml2 +- type: software + title: askpass + abstract: 'askpass: Password Entry Utilities for R, Git, and SSH' + notes: Suggests + url: https://r-lib.r-universe.dev/askpass + repository: https://CRAN.R-project.org/package=askpass + authors: + - family-names: Ooms + given-names: Jeroen + email: jeroenooms@gmail.com + orcid: https://orcid.org/0000-0002-4035-0289 + year: '2026' + doi: 10.32614/CRAN.package.askpass +- type: software + title: htmltools + abstract: 'htmltools: Tools for HTML' + notes: Suggests + url: https://rstudio.github.io/htmltools/ + repository: https://CRAN.R-project.org/package=htmltools + authors: + - family-names: Cheng + given-names: Joe + email: joe@posit.co + - family-names: Sievert + given-names: Carson + email: carson@posit.co + orcid: https://orcid.org/0000-0002-4958-2844 + - family-names: Schloerke + given-names: Barret + email: barret@posit.co + orcid: https://orcid.org/0000-0001-9986-114X + - family-names: Chang + given-names: Winston + email: winston@posit.co + orcid: https://orcid.org/0000-0002-1576-2126 + - family-names: Xie + given-names: Yihui + email: yihui@posit.co + - family-names: Allen + given-names: Jeff + year: '2026' + doi: 10.32614/CRAN.package.htmltools +- type: software + title: keyring + abstract: 'keyring: Access the System Credential Store from R' + notes: Suggests + url: https://keyring.r-lib.org/ + repository: https://CRAN.R-project.org/package=keyring + authors: + - family-names: Csárdi + given-names: Gábor + email: csardi.gabor@gmail.com + year: '2026' + doi: 10.32614/CRAN.package.keyring +- type: software + title: knitr + abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R' + notes: Suggests + url: https://yihui.org/knitr/ + repository: https://CRAN.R-project.org/package=knitr + authors: + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + year: '2026' + doi: 10.32614/CRAN.package.knitr +- type: software + title: leaflet + abstract: 'leaflet: Create Interactive Web Maps with the JavaScript ''Leaflet'' + Library' + notes: Suggests + url: https://rstudio.github.io/leaflet/ + repository: https://CRAN.R-project.org/package=leaflet + authors: + - family-names: Cheng + given-names: Joe + email: joe@posit.co + - family-names: Schloerke + given-names: Barret + email: barret@posit.co + orcid: https://orcid.org/0000-0001-9986-114X + - family-names: Karambelkar + given-names: Bhaskar + - family-names: Xie + given-names: Yihui + - family-names: Aden-Buie + given-names: Garrick + email: garrick@posit.co + orcid: https://orcid.org/0000-0002-7111-0077 + year: '2026' + doi: 10.32614/CRAN.package.leaflet +- type: software + title: rhdf5 + abstract: 'rhdf5: R Interface to HDF5' + notes: Suggests + url: https://github.com/Huber-group-EMBL/rhdf5 + repository: https://bioconductor.org/ + authors: + - family-names: Fischer + given-names: Bernd + - family-names: Smith + given-names: Mike + email: mike.smith@embl.de + orcid: https://orcid.org/0000-0002-7800-3848 + - family-names: Pau + given-names: Gregoire + year: '2026' + doi: 10.18129/B9.bioc.rhdf5 +- type: software + title: rnaturalearth + abstract: 'rnaturalearth: World Map Data from Natural Earth' + notes: Suggests + url: https://docs.ropensci.org/rnaturalearth/ + repository: https://CRAN.R-project.org/package=rnaturalearth + authors: + - family-names: Massicotte + given-names: Philippe + email: pmassicotte@hotmail.com + orcid: https://orcid.org/0000-0002-5919-4116 + - family-names: South + given-names: Andy + email: southandy@gmail.com + year: '2026' + doi: 10.32614/CRAN.package.rnaturalearth +- type: software + title: rnaturalearthdata + abstract: 'rnaturalearthdata: World Vector Map Data from Natural Earth Used in ''rnaturalearth''' + notes: Suggests + url: https://docs.ropensci.org/rnaturalearthdata/ + repository: https://CRAN.R-project.org/package=rnaturalearthdata + authors: + - family-names: South + given-names: Andy + email: southandy@gmail.com + orcid: https://orcid.org/0000-0003-4051-6135 + - family-names: Michael + given-names: Schramm + email: mpschramm@gmail.com + - family-names: Massicotte + given-names: Philippe + email: pmassicotte@hotmail.com + orcid: https://orcid.org/0000-0002-5919-4116 + year: '2026' + doi: 10.32614/CRAN.package.rnaturalearthdata +- type: software + title: sf + abstract: 'sf: Simple Features for R' + notes: Suggests + url: https://r-spatial.github.io/sf/ + repository: https://CRAN.R-project.org/package=sf + authors: + - family-names: Pebesma + given-names: Edzer + email: edzer.pebesma@uni-muenster.de + orcid: https://orcid.org/0000-0001-8049-7069 + year: '2026' + doi: 10.32614/CRAN.package.sf +- type: software + title: testthat + abstract: 'testthat: Unit Testing for R' + notes: Suggests + url: https://testthat.r-lib.org + repository: https://CRAN.R-project.org/package=testthat + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2026' + doi: 10.32614/CRAN.package.testthat + version: '>= 3.0.0' +- type: software + title: tidyr + abstract: 'tidyr: Tidy Messy Data' + notes: Suggests + url: https://tidyr.tidyverse.org + repository: https://CRAN.R-project.org/package=tidyr + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + - family-names: Vaughan + given-names: Davis + email: davis@posit.co + - family-names: Girlich + given-names: Maximilian + year: '2026' + doi: 10.32614/CRAN.package.tidyr +- type: software + title: vol2birdR + abstract: 'vol2birdR: Vertical Profiles of Biological Signals in Weather Radar Data' + notes: Suggests + url: https://github.com/adokter/vol2birdR/ + repository: https://CRAN.R-project.org/package=vol2birdR + authors: + - family-names: Henja + given-names: Anders + email: anders.henja@gmail.com + - family-names: Dokter + given-names: Adriaan M. + email: vol2birdr@cornell.edu + orcid: https://orcid.org/0000-0001-6573-066X + year: '2026' + doi: 10.32614/CRAN.package.vol2birdR diff --git a/DESCRIPTION b/DESCRIPTION index c025fd2..f7c20ab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -65,7 +65,7 @@ VignetteBuilder: Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Config/Needs/website: rmarkdown, leafpop, diff --git a/NAMESPACE b/NAMESPACE index 365c657..46be60d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,3 +8,4 @@ export(get_weather_radars) export(set_secret) importFrom(dplyr,.data) importFrom(lubridate,"%within%") +importFrom(rlang,.env) diff --git a/R/getRad-package.R b/R/getRad-package.R index 0c6cd51..7036fb9 100644 --- a/R/getRad-package.R +++ b/R/getRad-package.R @@ -3,6 +3,7 @@ ## usethis namespace: start #' @importFrom dplyr .data +#' @importFrom rlang .env #' @importFrom lubridate %within% ## usethis namespace: end NULL diff --git a/man/getRad-package.Rd b/man/getRad-package.Rd index 0c0c6c5..b05a2f5 100644 --- a/man/getRad-package.Rd +++ b/man/getRad-package.Rd @@ -32,7 +32,7 @@ Other contributors: \item Alexander Tedeschi \email{at744@cornell.edu} (\href{https://orcid.org/0000-0003-0772-6931}{ORCID}) (Cornell Lab of Ornithology) [contributor] \item Hidde Leijnse (\href{https://orcid.org/0000-0001-7835-4480}{ORCID}) (Royal Netherlands Meteorological Institute) [contributor] \item Bart Hoekstra (\href{https://orcid.org/0000-0002-7085-3805}{ORCID}) (University of Amsterdam) [contributor] - \item University of Amsterdam (04dkp9463) [copyright holder] + \item University of Amsterdam (\href{https://ror.org/04dkp9463}{ROR}) [copyright holder] \item Biodiversa+ (https://hirad.science/) [funder] } diff --git a/man/get_pvol.Rd b/man/get_pvol.Rd index 5e54b67..1960ec2 100644 --- a/man/get_pvol.Rd +++ b/man/get_pvol.Rd @@ -42,7 +42,7 @@ with the Terminal Doppler Weather Radar (TDWR) program can not be read. These ca be identified using the \code{stntype} column in \code{get_weather_radars("nexrad")}. } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive()) withAutoprint(\{ # examplesIf} # Get PVOL data for a single radar and datetime get_pvol("deess", as.POSIXct(Sys.Date())) diff --git a/man/get_vpts.Rd b/man/get_vpts.Rd index 6036d63..fdad21f 100644 --- a/man/get_vpts.Rd +++ b/man/get_vpts.Rd @@ -68,7 +68,7 @@ data is stored in aloft data Besides the examples above there is a \code{date} object available for formatting. } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive()) withAutoprint(\{ # examplesIf} # Get VPTS data for a single radar and date get_vpts(radar = "bejab", datetime = "2023-01-01", source = "baltrad") get_vpts(radar = "bejab", datetime = "2020-01-19", source = "rmi") diff --git a/man/get_vpts_aloft.Rd b/man/get_vpts_aloft.Rd index 3245158..f66c4d1 100644 --- a/man/get_vpts_aloft.Rd +++ b/man/get_vpts_aloft.Rd @@ -8,7 +8,9 @@ get_vpts_aloft( radar_odim_code, rounded_interval, source = c("baltrad", "uva", "ecog-04003"), - coverage = get_vpts_coverage_aloft() + coverage = get_vpts_coverage_aloft(), + ..., + call = rlang::caller_env() ) } \arguments{ diff --git a/man/get_vpts_coverage.Rd b/man/get_vpts_coverage.Rd index 2564e31..d7d789d 100644 --- a/man/get_vpts_coverage.Rd +++ b/man/get_vpts_coverage.Rd @@ -25,7 +25,7 @@ A \code{data.frame} or \code{tibble} with at least three columns, \code{source}, Gets the VPTS file coverage from supported sources per radar and date. } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive()) withAutoprint(\{ # examplesIf} get_vpts_coverage() \dontshow{\}) # examplesIf} } diff --git a/man/get_vpts_nexrad.Rd b/man/get_vpts_nexrad.Rd index 3fddbfc..4871772 100644 --- a/man/get_vpts_nexrad.Rd +++ b/man/get_vpts_nexrad.Rd @@ -4,7 +4,13 @@ \alias{get_vpts_nexrad} \title{Get VPTS data from the public BirdCast NEXRAD archive} \usage{ -get_vpts_nexrad(radar, rounded_interval, coverage = get_vpts_coverage_nexrad()) +get_vpts_nexrad( + radar, + rounded_interval, + coverage = get_vpts_coverage_nexrad(), + ..., + call = rlang::caller_env() +) } \arguments{ \item{radar}{NEXRAD radar code.} diff --git a/man/get_weather_radars.Rd b/man/get_weather_radars.Rd index ae12c98..81d352d 100644 --- a/man/get_weather_radars.Rd +++ b/man/get_weather_radars.Rd @@ -37,7 +37,7 @@ from. } } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive()) withAutoprint(\{ # examplesIf} # Get radar metadata from OPERA get_weather_radars(source = "opera") From 18e3ce06dbb2089a91e995e8188370996633e9ec Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 14:51:02 +0200 Subject: [PATCH 25/34] add news item --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 5715e90..0561c20 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # getRad (development version) +* Implement download of `vpts` data from birdcast by Alexander Tedeschi. * Implement reading `vpts` data from a local directory (#135). * Clarify HTTP 429 error for the Netherlands (#165). * For Romania match deviating file format (thanks to Sorin Burcea, #167). From c96a961ef19093d88d4e498d4f01e105d92c25f8 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 19 May 2026 16:57:16 +0200 Subject: [PATCH 26/34] Fix swedish test, seems that old data is not removed if no recent data is added --- tests/testthat/test-get_pvol_se.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-get_pvol_se.R b/tests/testthat/test-get_pvol_se.R index 963e67e..0a1fd72 100644 --- a/tests/testthat/test-get_pvol_se.R +++ b/tests/testthat/test-get_pvol_se.R @@ -34,8 +34,8 @@ test_that("Pvol for Sweden can be downloaded", { test_that("Pvol for Sweden fails out of time range", { skip_if_offline("opendata-download-radar.smhi.se") + skip_if_se_not_updated("hudiksvall", Sys.time() - lubridate::hours(4)) time <- Sys.time() - lubridate::hours(40) - skip_if_se_not_updated("hudiksvall", time) expect_error( get_pvol("sehuv", time), From d0db93e08f1d437e00eb0ae0eff27bc94c31a2dc Mon Sep 17 00:00:00 2001 From: bart1 <1662852+bart1@users.noreply.github.com> Date: Tue, 26 May 2026 13:28:34 +0200 Subject: [PATCH 27/34] Change documentation from internal to noRd --- R/get_vpts_nexrad.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_nexrad.R index 2be2d5f..0724451 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_nexrad.R @@ -23,7 +23,7 @@ #' @param coverage A data frame containing the coverage of the BirdCast NEXRAD #' archive. If not provided, it will be fetched via the internet. #' @return A tibble with VPTS data. -#' @keywords internal +#' @noRd get_vpts_nexrad <- function( radar, rounded_interval, From a517ee96d82e093f84892a30a0987a2816b2bb3f Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 26 May 2026 13:29:27 +0200 Subject: [PATCH 28/34] run document --- man/get_vpts_nexrad.Rd | 49 ------------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 man/get_vpts_nexrad.Rd diff --git a/man/get_vpts_nexrad.Rd b/man/get_vpts_nexrad.Rd deleted file mode 100644 index 4871772..0000000 --- a/man/get_vpts_nexrad.Rd +++ /dev/null @@ -1,49 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/get_vpts_nexrad.R -\name{get_vpts_nexrad} -\alias{get_vpts_nexrad} -\title{Get VPTS data from the public BirdCast NEXRAD archive} -\usage{ -get_vpts_nexrad( - radar, - rounded_interval, - coverage = get_vpts_coverage_nexrad(), - ..., - call = rlang::caller_env() -) -} -\arguments{ -\item{radar}{NEXRAD radar code.} - -\item{rounded_interval}{Interval to fetch data for, rounded to nearest day.} - -\item{coverage}{A data frame containing the coverage of the BirdCast NEXRAD -archive. If not provided, it will be fetched via the internet.} -} -\value{ -A tibble with VPTS data. -} -\description{ -Gets VPTS data from the public BirdCast NEXRAD archive. -} -\details{ -By default, data are retrieved from the public BirdCast S3 archive at -\verb{https://birdcastdata.s3.amazonaws.com/nexrad/daily}. - -The expected path format is: -\code{"{radar}/{year}/{radar}_vpts_{year}{month}{day}.csv"}. -} -\section{Inner working}{ - -\itemize{ -\item Checks that the requested radar is present in the NEXRAD coverage file. -\item Checks that data exist for the requested radar/date combination. -\item Constructs the S3 paths for the daily VPTS files from the coverage file. -\item Performs parallel HTTP requests to fetch the VPTS CSV data. -\item Parses the response bodies with the shared VPTS column classes. -\item Uses uppercase NEXRAD radar codes for archive paths. -\item Adds a column with the radar source. -} -} - -\keyword{internal} From e499b782015b3d0d14a1afdf20eda664c0483d16 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 2 Jun 2026 22:47:48 +0200 Subject: [PATCH 29/34] rename to birdcast --- R/get_vpts.R | 12 ++-- R/{get_vpts_nexrad.R => get_vpts_birdcast.R} | 14 ++-- R/get_vpts_coverage.R | 6 +- ..._nexrad.R => get_vpts_coverage_birdcast.R} | 14 ++-- R/zzz.R | 2 +- man/getRad-package.Rd | 15 ++-- man/get_vpts.Rd | 10 +-- man/get_vpts_coverage.Rd | 4 +- ...vpts_nexrad.R => test-get_vpts_birdcast.R} | 68 +++++++++++-------- ...ad.R => test-get_vpts_coverage_birdcast.R} | 12 ++-- 10 files changed, 85 insertions(+), 72 deletions(-) rename R/{get_vpts_nexrad.R => get_vpts_birdcast.R} (87%) rename R/{get_vpts_coverage_nexrad.R => get_vpts_coverage_birdcast.R} (73%) rename tests/testthat/{test-get_vpts_nexrad.R => test-get_vpts_birdcast.R} (51%) rename tests/testthat/{test-get_vpts_coverage_nexrad.R => test-get_vpts_coverage_birdcast.R} (58%) diff --git a/R/get_vpts.R b/R/get_vpts.R index 7030044..6fc3707 100644 --- a/R/get_vpts.R +++ b/R/get_vpts.R @@ -35,7 +35,7 @@ #' downloaded. #' - A [lubridate::interval()], between which all data files are downloaded. #' @param source Source of the data. One of `"baltrad"`, `"uva"`, `"ecog-04003"`, -#' `"rmi"`, or `"nexrad"`. Only one source can be queried at a time. If not provided, +#' `"rmi"`, or `"birdcast"`. Only one source can be queried at a time. If not provided, #' `"baltrad"` is used. Alternatively a local directory can be specified, #' see details for an explanation of the file format. #' @param return_type Type of object that should be returned. Either: @@ -78,11 +78,11 @@ #' return_type = "tibble" #' ) #' #' Get VPTS data from the public BirdCast NEXRAD archive -#' get_vpts(radar = "KABR", datetime = "2023-01-01", source = "nexrad") +#' get_vpts(radar = "KABR", datetime = "2023-01-01", source = "birdcast") get_vpts <- function( radar, datetime, - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "birdcast"), return_type = c("vpts", "tibble") ) { # Input checks ---- @@ -212,7 +212,7 @@ get_vpts <- function( source_type <- dplyr::case_when( source == "rmi" ~ "rmi", - source == "nexrad" ~ "nexrad", + source == "birdcast" ~ "birdcast", source %in% aloft_sources ~ "aloft", dir.exists(source) ~ "local" ) @@ -234,9 +234,9 @@ get_vpts <- function( ), .purrr_error_call = cl ), - nexrad = purrr::map( + birdcast = purrr::map( radar, - ~ get_vpts_nexrad( + ~ get_vpts_birdcast( .x, rounded_interval = rounded_interval ), diff --git a/R/get_vpts_nexrad.R b/R/get_vpts_birdcast.R similarity index 87% rename from R/get_vpts_nexrad.R rename to R/get_vpts_birdcast.R index 0724451..b7d14fe 100644 --- a/R/get_vpts_nexrad.R +++ b/R/get_vpts_birdcast.R @@ -24,10 +24,10 @@ #' archive. If not provided, it will be fetched via the internet. #' @return A tibble with VPTS data. #' @noRd -get_vpts_nexrad <- function( +get_vpts_birdcast <- function( radar, rounded_interval, - coverage = get_vpts_coverage_nexrad(), + coverage = get_vpts_coverage_birdcast(), ..., call = rlang::caller_env() ) { @@ -41,10 +41,10 @@ get_vpts_nexrad <- function( missing_radar <- radar[!radar %in% coverage$radar] cli::cli_abort( - "Can't find radar {.val {missing_radar}} in the NEXRAD coverage file + "Can't find radar {.val {missing_radar}} in the birdcast coverage file (see {.fun get_vpts_coverage}).", missing_radar = missing_radar, - class = "getRad_error_nexrad_radar_not_found", + class = "getRad_error_birdcast_radar_not_found", call = call ) } @@ -78,16 +78,16 @@ get_vpts_nexrad <- function( dplyr::pull(.data$path) # Read the VPTS CSV files. - nexrad_data_url <- getOption("getRad.nexrad_vpts_data_url") + birdcast_data_url <- getOption("getRad.birdcast_vpts_data_url") radar_out <- tolower(radar) - out <- paste(nexrad_data_url, "nexrad", "daily", s3_paths, sep = "/") |> + out <- paste(birdcast_data_url, "nexrad", "daily", s3_paths, sep = "/") |> read_vpts_from_url() |> purrr::keep(.p = ~ as.logical(nrow(.x))) |> purrr::list_rbind() out$radar <- radar_out - out$source <- "nexrad" + out$source <- "birdcast" out } diff --git a/R/get_vpts_coverage.R b/R/get_vpts_coverage.R index b086c2c..e9f9485 100644 --- a/R/get_vpts_coverage.R +++ b/R/get_vpts_coverage.R @@ -3,7 +3,7 @@ #' Gets the VPTS file coverage from supported sources per radar and date. #' #' @param source Source of the data. One or more of `"baltrad"`, `"uva"`, -#' `"ecog-04003"` or `"rmi"` or `"nexrad"`. If not provided, `"baltrad"` is used. +#' `"ecog-04003"` or `"rmi"` or `"birdcast"`. If not provided, `"baltrad"` is used. #' Alternatively `"all"` can be used if data from all sources should be #' returned. #' @param ... Arguments passed on to internal functions. @@ -13,7 +13,7 @@ #' @examplesIf interactive() #' get_vpts_coverage() get_vpts_coverage <- function( - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "birdcast"), ... ) { # argument all returns all possible sources @@ -41,7 +41,7 @@ get_vpts_coverage <- function( baltrad = get_vpts_coverage_aloft, uva = get_vpts_coverage_aloft, "ecog-04003" = get_vpts_coverage_aloft, - nexrad = get_vpts_coverage_nexrad + birdcast = get_vpts_coverage_birdcast ) cl <- rlang::caller_env(0) # Run the helpers, but every helper only once. diff --git a/R/get_vpts_coverage_nexrad.R b/R/get_vpts_coverage_birdcast.R similarity index 73% rename from R/get_vpts_coverage_nexrad.R rename to R/get_vpts_coverage_birdcast.R index 2fc0d75..231a2bd 100644 --- a/R/get_vpts_coverage_nexrad.R +++ b/R/get_vpts_coverage_birdcast.R @@ -2,24 +2,24 @@ #' #' Gets the VPTS file coverage from the public BirdCast NEXRAD archive. This is #' derived from a coverage file at -#' <`r file.path(getOption("getRad.nexrad_vpts_data_url"), "coverage.csv")`>. By +#' <`r file.path(getOption("getRad.birdcast_vpts_data_url"), "coverage.csv")`>. By #' default this file is cached for 6 hours. #' #' @param call A call used for error messaging. #' @inheritParams req_cache_getrad -#' @return A data frame of the coverage file in the NEXRAD VPTS archive. +#' @return A data frame of the coverage file in the birdcast VPTS archive. #' @noRd #' @examplesIf interactive() -#' get_vpts_coverage_nexrad() -get_vpts_coverage_nexrad <- function( +#' get_vpts_coverage_birdcast() +get_vpts_coverage_birdcast <- function( use_cache = TRUE, ..., call = rlang::caller_env() ) { - nexrad_vpts_data_url <- getOption("getRad.nexrad_vpts_data_url") + birdcast_vpts_data_url <- getOption("getRad.birdcast_vpts_data_url") coverage_raw <- - httr2::request(nexrad_vpts_data_url) |> + httr2::request(birdcast_vpts_data_url) |> httr2::req_url_path_append("coverage.csv") |> req_user_agent_getrad() |> req_retry_getrad() |> @@ -35,7 +35,7 @@ get_vpts_coverage_nexrad <- function( show_col_types = FALSE ) |> dplyr::mutate( - source = string_extract(.data$directory, "^[^/]+"), + source = "birdcast", radar = string_extract(.data$directory, "(?<=daily\\/)[A-Z0-9]{4}"), date = as.Date( string_extract( diff --git a/R/zzz.R b/R/zzz.R index 0f6eb39..bd016b2 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -21,7 +21,7 @@ ), getRad.aloft_data_url = "https://aloftdata.s3-eu-west-1.amazonaws.com", getRad.nexrad_data_url = "https://unidata-nexrad-level2.s3.amazonaws.com", - getRad.nexrad_vpts_data_url = "https://birdcastdata.s3.amazonaws.com", + getRad.birdcast_vpts_data_url = "https://birdcastdata.s3.amazonaws.com", getRad.cache = cachem::cache_mem( max_size = 128 * 1024^2, max_age = 60^2 * 24 diff --git a/man/getRad-package.Rd b/man/getRad-package.Rd index b05a2f5..786d872 100644 --- a/man/getRad-package.Rd +++ b/man/getRad-package.Rd @@ -18,20 +18,21 @@ Useful links: } \author{ -\strong{Maintainer}: Bart Kranstauber \email{b.kranstauber@uva.nl} (\href{https://orcid.org/0000-0001-8303-780X}{ORCID}) (University of Amsterdam) +\strong{Maintainer}: Bart Kranstauber \email{b.kranstauber@uva.nl} (\href{https://orcid.org/0000-0001-8303-780X}{ORCID}) (affiliation: University of Amsterdam) Authors: \itemize{ - \item Pieter Huybrechts \email{pieter.huybrechts@inbo.be} (\href{https://orcid.org/0000-0002-6658-6062}{ORCID}) (Research Institute for Nature and Forest (INBO)) - \item Peter Desmet \email{peter.desmet@inbo.be} (\href{https://orcid.org/0000-0002-8442-8025}{ORCID}) (Research Institute for Nature and Forest (INBO)) + \item Bart Kranstauber \email{b.kranstauber@uva.nl} (\href{https://orcid.org/0000-0001-8303-780X}{ORCID}) (affiliation: University of Amsterdam) + \item Pieter Huybrechts \email{pieter.huybrechts@inbo.be} (\href{https://orcid.org/0000-0002-6658-6062}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) + \item Peter Desmet \email{peter.desmet@inbo.be} (\href{https://orcid.org/0000-0002-8442-8025}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) } Other contributors: \itemize{ - \item Cecilia Nilsson \email{cecilia.nilsson@biol.lu.se} (\href{https://orcid.org/0000-0001-8957-4411}{ORCID}) (Lund University) [contributor] - \item Alexander Tedeschi \email{at744@cornell.edu} (\href{https://orcid.org/0000-0003-0772-6931}{ORCID}) (Cornell Lab of Ornithology) [contributor] - \item Hidde Leijnse (\href{https://orcid.org/0000-0001-7835-4480}{ORCID}) (Royal Netherlands Meteorological Institute) [contributor] - \item Bart Hoekstra (\href{https://orcid.org/0000-0002-7085-3805}{ORCID}) (University of Amsterdam) [contributor] + \item Cecilia Nilsson \email{cecilia.nilsson@biol.lu.se} (\href{https://orcid.org/0000-0001-8957-4411}{ORCID}) (affiliation: Lund University) [contributor] + \item Alexander Tedeschi \email{at744@cornell.edu} (\href{https://orcid.org/0000-0003-0772-6931}{ORCID}) (affiliation: Cornell Lab of Ornithology) [contributor] + \item Hidde Leijnse (\href{https://orcid.org/0000-0001-7835-4480}{ORCID}) (affiliation: Royal Netherlands Meteorological Institute) [contributor] + \item Bart Hoekstra (\href{https://orcid.org/0000-0002-7085-3805}{ORCID}) (affiliation: University of Amsterdam) [contributor] \item University of Amsterdam (\href{https://ror.org/04dkp9463}{ROR}) [copyright holder] \item Biodiversa+ (https://hirad.science/) [funder] } diff --git a/man/get_vpts.Rd b/man/get_vpts.Rd index fdad21f..23b74da 100644 --- a/man/get_vpts.Rd +++ b/man/get_vpts.Rd @@ -7,7 +7,7 @@ get_vpts( radar, datetime, - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "birdcast"), return_type = c("vpts", "tibble") ) } @@ -27,14 +27,14 @@ downloaded. }} \item{source}{Source of the data. One of \code{"baltrad"}, \code{"uva"}, \code{"ecog-04003"}, -\code{"rmi"}, or \code{"nexrad"}. Only one source can be queried at a time. If not provided, +\code{"rmi"}, or \code{"birdcast"}. Only one source can be queried at a time. If not provided, \code{"baltrad"} is used. Alternatively a local directory can be specified, see details for an explanation of the file format.} \item{return_type}{Type of object that should be returned. Either: \itemize{ \item \code{"vpts"}: vpts object(s) (default). -\item \code{"tibble"}: a \code{\link[dplyr:reexports]{dplyr::tibble()}}. +\item \code{"tibble"}: a \code{\link[dplyr:tibble]{dplyr::tibble()}}. }} } \value{ @@ -44,7 +44,7 @@ Either a vpts object, a list of vpts objects or a tibble. See \description{ Gets vertical profile time series data from supported sources and returns it as a (list of) of \link[bioRad:summary.vpts]{vpts objects} or a -\code{\link[dplyr:reexports]{dplyr::tibble()}}. +\code{\link[dplyr:tibble]{dplyr::tibble()}}. } \details{ For more details on supported sources, see \code{vignette("supported_sources")}. @@ -102,6 +102,6 @@ get_vpts( return_type = "tibble" ) #' Get VPTS data from the public BirdCast NEXRAD archive -get_vpts(radar = "KABR", datetime = "2023-01-01", source = "nexrad") +get_vpts(radar = "KABR", datetime = "2023-01-01", source = "birdcast") \dontshow{\}) # examplesIf} } diff --git a/man/get_vpts_coverage.Rd b/man/get_vpts_coverage.Rd index d7d789d..ac0d003 100644 --- a/man/get_vpts_coverage.Rd +++ b/man/get_vpts_coverage.Rd @@ -5,13 +5,13 @@ \title{Get VPTS file coverage from supported sources} \usage{ get_vpts_coverage( - source = c("baltrad", "uva", "ecog-04003", "rmi", "nexrad"), + source = c("baltrad", "uva", "ecog-04003", "rmi", "birdcast"), ... ) } \arguments{ \item{source}{Source of the data. One or more of \code{"baltrad"}, \code{"uva"}, -\code{"ecog-04003"} or \code{"rmi"} or \code{"nexrad"}. If not provided, \code{"baltrad"} is used. +\code{"ecog-04003"} or \code{"rmi"} or \code{"birdcast"}. If not provided, \code{"baltrad"} is used. Alternatively \code{"all"} can be used if data from all sources should be returned.} diff --git a/tests/testthat/test-get_vpts_nexrad.R b/tests/testthat/test-get_vpts_birdcast.R similarity index 51% rename from tests/testthat/test-get_vpts_nexrad.R rename to tests/testthat/test-get_vpts_birdcast.R index be4cb94..d65fc44 100644 --- a/tests/testthat/test-get_vpts_nexrad.R +++ b/tests/testthat/test-get_vpts_birdcast.R @@ -1,87 +1,87 @@ -nexrad_coverage <- tibble::tibble( +birdcast_coverage <- tibble::tibble( radar = "KABR", date = as.Date(c("2013-09-01", "2013-09-02")) ) -test_that("get_vpts_nexrad() returns error on invalid radar code", { +test_that("get_vpts_birdcast() returns error on invalid radar code", { expect_error( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = "KAB", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) expect_error( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = 12345, rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) }) -test_that("get_vpts_nexrad() returns error when multiple radars are queried", { +test_that("get_vpts_birdcast() returns error when multiple radars are queried", { expect_error( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = c("KABR", "KABX"), rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), class = "getRad_error_radar_not_single_odim_nexrad" ) }) -test_that("get_vpts_nexrad() returns error when radar is not found in coverage", { +test_that("get_vpts_birdcast() returns error when radar is not found in coverage", { expect_error( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = "ZZZZ", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), - class = "getRad_error_nexrad_radar_not_found" + class = "getRad_error_birdcast_radar_not_found" ) expect_identical( rlang::catch_cnd( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = "ZZZZ", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), - classes = "getRad_error_nexrad_radar_not_found" + classes = "getRad_error_birdcast_radar_not_found" )$missing_radar, "ZZZZ" ) }) -test_that("get_vpts_nexrad() returns error when date is requested not in coverage", { +test_that("get_vpts_birdcast() returns error when date is requested not in coverage", { expect_error( - getRad:::get_vpts_nexrad( + getRad:::get_vpts_birdcast( radar = "KABR", rounded_interval = lubridate::interval("1900-01-01", "1900-01-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ), class = "getRad_error_date_not_found" ) }) -test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { +test_that("get_vpts_birdcast() can fetch daily VPTS data from BirdCast archive", { skip_if_offline() - nexrad_vpts_tbl <- getRad:::get_vpts_nexrad( + birdcast_vpts_tbl <- getRad:::get_vpts_birdcast( radar = "KABR", rounded_interval = lubridate::interval("2013-09-01", "2013-09-02"), - coverage = nexrad_coverage + coverage = birdcast_coverage ) - expect_type(nexrad_vpts_tbl, "list") - expect_s3_class(nexrad_vpts_tbl, "tbl_df") + expect_type(birdcast_vpts_tbl, "list") + expect_s3_class(birdcast_vpts_tbl, "tbl_df") expect_named( - nexrad_vpts_tbl, + birdcast_vpts_tbl, c( "radar", "datetime", @@ -114,7 +114,19 @@ test_that("get_vpts_nexrad() can fetch daily VPTS data from BirdCast archive", { ) ) - expect_true(nrow(nexrad_vpts_tbl) > 0) - expect_true(all(nexrad_vpts_tbl$radar == "kabr")) - expect_true(all(nexrad_vpts_tbl$source == "nexrad")) + expect_true(nrow(birdcast_vpts_tbl) > 0) + expect_true(all(birdcast_vpts_tbl$radar == "kabr")) + expect_true(all(birdcast_vpts_tbl$source == "birdcast")) +}) +test_that("get_vpts() can fetch daily VPTS data from BirdCast archive", { + skip_if_offline() + date <- as.Date("2026-4-1") + vpts <- getRad:::get_vpts( + radar = "KABX", + date, + source = "birdcast" + ) + expect_s3_class(vpts, "vpts") + expect_all_true(as.Date(vpts$datetime) == date) + expect_false(vpts$regular) }) diff --git a/tests/testthat/test-get_vpts_coverage_nexrad.R b/tests/testthat/test-get_vpts_coverage_birdcast.R similarity index 58% rename from tests/testthat/test-get_vpts_coverage_nexrad.R rename to tests/testthat/test-get_vpts_coverage_birdcast.R index 93e1615..e4e10b8 100644 --- a/tests/testthat/test-get_vpts_coverage_nexrad.R +++ b/tests/testthat/test-get_vpts_coverage_birdcast.R @@ -1,25 +1,25 @@ -test_that("get_vpts_coverage_nexrad() returns a tibble", { +test_that("get_vpts_coverage_birdcast() returns a tibble", { skip_if_offline() expect_s3_class( - get_vpts_coverage_nexrad(), + get_vpts_coverage_birdcast(), "tbl_df" ) }) -test_that("get_vpts_coverage_nexrad() returns the expected columns", { +test_that("get_vpts_coverage_birdcast() returns the expected columns", { skip_if_offline() expect_named( - get_vpts_coverage_nexrad(), + get_vpts_coverage_birdcast(), c("directory", "file_count", "source", "radar", "date") ) }) -test_that("get_vpts_coverage_nexrad() returns expected NEXRAD values", { +test_that("get_vpts_coverage_birdcast() returns expected NEXRAD values", { skip_if_offline() - coverage <- get_vpts_coverage_nexrad() + coverage <- get_vpts_coverage_birdcast() expect_true(all(coverage$source == "nexrad")) expect_s3_class(coverage$date, "Date") From 34b7e917efb449d5a16a4d7d9642bab0b66d67fb Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 2 Jun 2026 23:24:02 +0200 Subject: [PATCH 30/34] fix coverage test --- tests/testthat/test-get_vpts_coverage.R | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-get_vpts_coverage.R b/tests/testthat/test-get_vpts_coverage.R index 50d1173..6e93262 100644 --- a/tests/testthat/test-get_vpts_coverage.R +++ b/tests/testthat/test-get_vpts_coverage.R @@ -28,14 +28,14 @@ test_that("format as expected for rmi", { expect_true(all(is_odim(data$radar))) }) -test_that("format as expected for nexrad", { +test_that("format as expected for birdcast", { skip_if_offline() - data <- get_vpts_coverage("nexrad") + data <- get_vpts_coverage("birdcast") expect_true(all(c("source", "radar", "date") %in% names(data))) expect_s3_class(data$date, "Date") expect_true(all(grepl("^[A-Z0-9]{4}$", data$radar))) - expect_true(all(data$source == "nexrad")) + expect_true(all(data$source == "birdcast")) }) @@ -58,8 +58,9 @@ test_that("get_vpts_coverage() returns 'baltrad' as a default source", { test_that("The argument source='all' returns all data", { + all_coverage <- get_vpts_coverage(source = "all") expect_equal( - get_vpts_coverage(source = "all") |> + all_coverage |> dplyr::pull(source) |> table(), get_vpts_coverage( @@ -68,4 +69,9 @@ test_that("The argument source='all' returns all data", { dplyr::pull(source) |> table() ) + + expect_identical( + sort(unique(all_coverage$source)), + sort(eval(rlang::fn_fmls(get_vpts_coverage)$source)) + ) }) From 3f3b2be74b070959da7b18c9b6cfef54b7272a6b Mon Sep 17 00:00:00 2001 From: Bart Date: Wed, 3 Jun 2026 08:49:27 +0200 Subject: [PATCH 31/34] fix test --- tests/testthat/test-get_vpts_coverage_birdcast.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-get_vpts_coverage_birdcast.R b/tests/testthat/test-get_vpts_coverage_birdcast.R index e4e10b8..ff92e8d 100644 --- a/tests/testthat/test-get_vpts_coverage_birdcast.R +++ b/tests/testthat/test-get_vpts_coverage_birdcast.R @@ -21,7 +21,7 @@ test_that("get_vpts_coverage_birdcast() returns expected NEXRAD values", { coverage <- get_vpts_coverage_birdcast() - expect_true(all(coverage$source == "nexrad")) + expect_all_true(coverage$source == "birdcast") expect_s3_class(coverage$date, "Date") expect_true(all(grepl("^[A-Z0-9]{4}$", coverage$radar))) expect_true(all(grepl( From c8c3afaaba57f2179d942ac00d9438542df68d66 Mon Sep 17 00:00:00 2001 From: Bart Date: Wed, 3 Jun 2026 10:47:16 +0200 Subject: [PATCH 32/34] Avoid progress bars that cannot be silenced --- R/get_vpts_coverage_aloft.R | 1 - R/get_vpts_coverage_birdcast.R | 1 - tests/testthat/test-get_vpts_coverage_birdcast.R | 1 - 3 files changed, 3 deletions(-) diff --git a/R/get_vpts_coverage_aloft.R b/R/get_vpts_coverage_aloft.R index 1ad43f8..6c29b96 100644 --- a/R/get_vpts_coverage_aloft.R +++ b/R/get_vpts_coverage_aloft.R @@ -25,7 +25,6 @@ get_vpts_coverage_aloft <- function( req_user_agent_getrad() |> req_retry_getrad() |> req_cache_getrad(use_cache = use_cache) |> - httr2::req_progress(type = "down") |> httr2::req_perform(error_call = call) |> httr2::resp_body_raw() diff --git a/R/get_vpts_coverage_birdcast.R b/R/get_vpts_coverage_birdcast.R index 231a2bd..43e8a79 100644 --- a/R/get_vpts_coverage_birdcast.R +++ b/R/get_vpts_coverage_birdcast.R @@ -24,7 +24,6 @@ get_vpts_coverage_birdcast <- function( req_user_agent_getrad() |> req_retry_getrad() |> req_cache_getrad(use_cache = use_cache) |> - httr2::req_progress(type = "down") |> httr2::req_perform(error_call = call) |> httr2::resp_body_raw() diff --git a/tests/testthat/test-get_vpts_coverage_birdcast.R b/tests/testthat/test-get_vpts_coverage_birdcast.R index ff92e8d..cba1559 100644 --- a/tests/testthat/test-get_vpts_coverage_birdcast.R +++ b/tests/testthat/test-get_vpts_coverage_birdcast.R @@ -1,6 +1,5 @@ test_that("get_vpts_coverage_birdcast() returns a tibble", { skip_if_offline() - expect_s3_class( get_vpts_coverage_birdcast(), "tbl_df" From 77c614e548874e0d14aa18aaa4a73e7daad5a74f Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 4 Jun 2026 12:08:15 +0200 Subject: [PATCH 33/34] failures would be good to show to keep an eye on trends --- tests/testthat/test-get_pvol_ee.R | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-get_pvol_ee.R b/tests/testthat/test-get_pvol_ee.R index e87aedb..a8722f7 100644 --- a/tests/testthat/test-get_pvol_ee.R +++ b/tests/testthat/test-get_pvol_ee.R @@ -6,10 +6,13 @@ test_that("Pvol for estonia can be downloaded", { # The API frequently sends 429/500 responses, therefore this test is allowed # to skip when the download is unsuccessful. - pvol <- tryCatch( - get_pvol("eesur", time, param = "all"), - error = function(e) NULL - ) + show_failure(expect_no_error( + pvol <- get_pvol( + "eesur", + time, + param = "all" + ) + )) skip_if_not( inherits(pvol, "pvol"), From 73f8bf18a956cbf43a75204a8b859f670eea89a6 Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 4 Jun 2026 12:20:13 +0200 Subject: [PATCH 34/34] updated documentation --- R/get_vpts_birdcast.R | 2 ++ R/get_vpts_coverage_birdcast.R | 1 + 2 files changed, 3 insertions(+) diff --git a/R/get_vpts_birdcast.R b/R/get_vpts_birdcast.R index b7d14fe..4cf428d 100644 --- a/R/get_vpts_birdcast.R +++ b/R/get_vpts_birdcast.R @@ -22,6 +22,8 @@ #' @param rounded_interval Interval to fetch data for, rounded to nearest day. #' @param coverage A data frame containing the coverage of the BirdCast NEXRAD #' archive. If not provided, it will be fetched via the internet. +#' @param ... Used to prevent accidentally using the `call` argument +#' @param call A call used for error messaging. #' @return A tibble with VPTS data. #' @noRd get_vpts_birdcast <- function( diff --git a/R/get_vpts_coverage_birdcast.R b/R/get_vpts_coverage_birdcast.R index 43e8a79..208cd47 100644 --- a/R/get_vpts_coverage_birdcast.R +++ b/R/get_vpts_coverage_birdcast.R @@ -5,6 +5,7 @@ #' <`r file.path(getOption("getRad.birdcast_vpts_data_url"), "coverage.csv")`>. By #' default this file is cached for 6 hours. #' +#' @param ... Used to prevent accidentally using the `call` argument #' @param call A call used for error messaging. #' @inheritParams req_cache_getrad #' @return A data frame of the coverage file in the birdcast VPTS archive.