Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
==========================================
- Coverage 92.55% 92.25% -0.31%
==========================================
Files 32 32
Lines 2647 2568 -79
==========================================
- Hits 2450 2369 -81
- Misses 197 199 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Here is a quick example of a max composite ppi of the lowest scan, using local data if available and opera ord data when there is no national data. devtools::load_all("~/getRad")
require(dplyr)
require(sf)
require(raster)
require(bioRad)
get_weather_radars() |> filter(status == 1) -> radars
time <- Sys.Date() |> as.POSIXct()
base_raster <- radars |>
st_buffer(units::set_units(100, 'km')) |>
raster(resolution = .025)
require(purrr)
require(mirai)
mirai::daemons(6)
grds <- purrr::map(
radars$radar,
in_parallel(
\(radar) {
pvol <- try(getRad::get_pvol(radar, time))
if (!inherits(pvol, "try-error")) {
pvol <- pvol |>
dplyr::select(any_of(c("DBZH", "dbzh", "dbz")))
pvol$scans <- pvol$scans[purrr::map_lgl(
pvol$scans,
~ length(.x$params)
)]
scn <- bioRad::get_scan(pvol, 0)
base_raster_cropped <- raster::crop(
base_raster,
raster::extent(sf::st_bbox(sf::st_buffer(
radars$geometry[radars$radar == radar],
units::set_units(300, 'km')
)))
)
raster::raster(
bioRad::project_as_ppi(scn, raster = base_raster_cropped)$data
)
} else {
NULL
}
},
time = time,
radars = radars,
base_raster = base_raster
)
)
dbz_map <- calc(
stack(purrr::map(grds[!purrr::map_lgl(grds, is.null)], extend, base_raster)),
max,
na.rm = T
)
#> Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
#> Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
#> Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
#> Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
#> Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
plot(dbz_map)
plot(
rnaturalearth::ne_countries(scale = 50) |>
st_cast("MULTILINESTRING") |>
st_geometry(),
add = T
)Created on 2026-06-30 with reprex v2.1.1 Standard output and standard error-- nothing to show -- |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Removed unused code related to the 'opera' data source and cleaned up the included countries data.
|
It seems the Essen radar is down causing the tests to fail (unrelated to pull request). The coverage is not complete as some tests might not be hit but are there so some sanity checking in the merging process. Data from the ORD is far from perfect, for Spain the range start is for example strange and conflicting in the meta data. |
|
@YohanSassi , @barthoekstra or @CeciliaNilsson709 would one of you mind to have a look at this pull request as I think you work more with pvols . |
|
Note the lines of code that are note tested are mainly there to confirm validity at they end. I think they should not be hit in normal use cases |
|
Thanks @bart1 ! I played around a bit with get_pvol() with use_opera_ord=TRUE, and it seems to work quite well for most of the combinations I tried. For example for Sweden and Norway it doesn't work to make VP's, I guess because not all the required information is there? Could maybe be good to add in the documentation that the opera ord data is only available for the last 24h (I think?). Do you want me to test/review something else? Haven't dugg through all the code, just played around with the function a bit, so let me know if you want a deeper dive! |
|
Thanks @CeciliaNilsson709, I think I can fix Sweden, Norway only has vrad values every other pvol and then not even for each scan. So every 10 minutes you can calculate a vp |


Uh oh!
There was an error while loading. Please reload this page.