Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read additional variables #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions R/get_pvol_de.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ get_pvol_de <- function(radar, time, ...) {
"to import data from German weather radars"
)
urls <- c(
glue::glue("https://opendata.dwd.de/weather/radar/sites/sweep_vol_z/{substr(radar,3,5)}/hdf5/filter_simple/"),
glue::glue("https://opendata.dwd.de/weather/radar/sites/sweep_vol_v/{substr(radar,3,5)}/hdf5/filter_simple/")
glue::glue("https://opendata.dwd.de/weather/radar/sites/sweep_vol_{c('z','v')}/{substr(radar,3,5)}/hdf5/filter_simple/"),
glue::glue("https://opendata.dwd.de/weather/radar/sites/sweep_vol_{c('rhohv','phidp','zdr')}/{substr(radar,3,5)}/unfiltered/")
)

res <- lapply(urls, function(x) {
Expand All @@ -25,9 +25,10 @@ get_pvol_de <- function(radar, time, ...) {
dplyr::mutate(file = res) |>
tidyr::unnest(file) |>
dplyr::filter(file != "../") |>
tidyr::separate_wider_delim(file,
dplyr::mutate(filestd=sub('stqual-','',file))|>
tidyr::separate_wider_delim(filestd,
delim = "-", cols_remove = FALSE,
names = c("ras", "qual", "sweep", "time_chr", "radar", "odim", "h5")
names = c("ras", "sweep", "time_chr", "radar", "odim", "h5")
) |>
dplyr::mutate(
time_pos = strptime(time_chr, "%Y%m%d%H%M%S", tz = "UTC")
Expand All @@ -39,7 +40,7 @@ get_pvol_de <- function(radar, time, ...) {
time + lubridate::minutes(5)
)
))
if (nrow(files_to_get) != 20) {
if (nrow(files_to_get) != 50) {
cli::cli_abort("The server returned an unexpected number of files",
class = "getRad_error_germany_unexpected_number_of_files"
)
Expand Down
Loading