Skip to content

Commit

Permalink
Merge pull request #334 from adokter/develop
Browse files Browse the repository at this point in the history
bioRad 0.5.1
  • Loading branch information
adokter authored Apr 1, 2020
2 parents 08fa1f0 + b7e6195 commit 78b1506
Show file tree
Hide file tree
Showing 219 changed files with 5,615 additions and 5,097 deletions.
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This package was submitted to CRAN on 2020-02-18.
Once it is accepted, delete this file and tag the release (commit 513108933d).
This package was submitted to CRAN on 2020-03-31.
Once it is accepted, delete this file and tag the release (commit ea28c310b7).
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: bioRad
Title: Biological Analysis and Visualization of Weather Radar Data
Version: 0.5.0.9325
Version: 0.5.1
Description: Extract, visualize and summarize aerial movements of birds and
insects from weather radar data. See <doi:10.1111/ecog.04028>
for a software paper describing package and methodologies.
Expand Down Expand Up @@ -44,4 +44,4 @@ Suggests:
LazyData: true
Encoding: UTF-8
VignetteBuilder: knitr
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
19 changes: 19 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# bioRad 0.5.1

Minor bugfixes. All issues included in this release can be found [here](https://github.com/adokter/bioRad/pull/334). This release primarily fixes a bug that will become effective once R version 4.0 is released.

* fixes a conflict due to new raw data format introduced in R version 4.0 (#331)

* corrects incorrect values in reading of correlation coefficient values RHOHV (#328)

* bugfix in `read_cajun()` which introduced incorrect height column during refactoring in bioRad 0.5.0 release ([93ad0a4](https://github.com/adokter/bioRad/commit/93ad0a4))

* bugfix that fixes the mapping by `map()` of composites of composites (ppi's produced after repeated application of `composite_ppi()`) ([a5c9048](https://github.com/adokter/bioRad/commit/a5c9048), [043aa73](https://github.com/adokter/bioRad/commit/043aa73))
* minor bug fixes, and addressing conflicts with CRAN depencies

* extend the functionality of `composite_ppi()` and improve its documentation (partial fix of #59)

* fix a bug in the color legend of `map()` when providing a custom color scale with palette argument (#324)

* minor documentation improvements

# bioRad 0.5.0

New CRAN release. All issues included in this release can be found [here](https://github.com/adokter/bioRad/milestone/6?closed=1).
Expand Down
3 changes: 2 additions & 1 deletion R/composite_ppi.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ composite_ppi <- function(x, param = "DBZH", nx = 100, ny = 100, xlim, ylim, res
#weights<-raster::pointDistance(as.matrix(data.frame(x=lons.radar,y=lats.radar)), coordinates(raster(spGrid)),lonlat=T)
for(i in 1:length(projs)){
brick_data <- raster::setValues(brick_data, projs[[i]], layer=i)
weights<-raster::pointDistance(as.matrix(data.frame(x=lons.radar,y=lats.radar))[i,], coordinates(raster(spGrid)),lonlat=T)
latlon.radar <- unique(data.frame(lat=c(lats.radar), lon=c(lons.radar)))
weights<-raster::pointDistance(as.matrix(data.frame(x=latlon.radar$lon,y=latlon.radar$lat))[i,], coordinates(raster(spGrid)),lonlat=T)
if(!is.na(idw_max_distance)) weights[weights>idw_max_distance]=NA
weights = 1/(weights^idp)

Expand Down
4 changes: 2 additions & 2 deletions R/filter.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Time selection in a time series of vertical profiles ('vpts')
#'
#' @param x A \code{vpts} object.
#' @param min Minimum datetime to be included. POSIXct value or charater string convertable to POSIXct.
#' @param max Maximum datetime to be included. POSIXct value or charater string convertable to POSIXct.
#' @param min Minimum datetime to be included. POSIXct value or character string convertable to POSIXct.
#' @param max Maximum datetime to be included. POSIXct value or character string convertable to POSIXct.
#' @param nearest If specified, \code{min} and \code{max} are ignored and the profile nearest to the
#' specified datetime is returned. POSIXct value or charater string convertable to POSIXct.
#' @return An object of class '\link[=summary.vpts]{vpts}', or an object of class '\link[=summary.vp]{vp}'
Expand Down
9 changes: 6 additions & 3 deletions R/map.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,23 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
# these declarations prevent generation of NOTE "no visible binding for
# global variable" during package Check
lon <- lat <- y <- z <- NA
# extract unique radar locations
latlon_radar <- unique(data.frame(lat=c(x$geo$lat), lon=c(x$geo$lon)))
# symbols for the radar position
# dummy is a hack to be able to include the ggplot2 color scale,
# radarpoint is the actual plotting of radar positions.
dummy <- geom_point(aes(x = lon, y = lat, colour = z),
size = 0,
data = data.frame(
lon = x$geo$lon,
lat = x$geo$lat,
lon = latlon_radar$lon,
lat = latlon_radar$lat,
z = 0
)
)
radarpoint <- geom_point(aes(x = lon, y = lat),
colour = radar_color,
size = radar_size,
data = data.frame(lon = x$geo$lon, lat = x$geo$lat)
data = data.frame(lon = latlon_radar$lon, lat = latlon_radar$lat)
)
# bounding box
bboxlatlon <- attributes(map)$geo$bbox
Expand All @@ -248,4 +250,5 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
scale_y_continuous(limits = ylim, expand = c(0, 0))
)
suppressWarnings(mymap)

}
2 changes: 1 addition & 1 deletion R/read_cajun.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ read_cajun <- function(file, rcs = 11, wavelength = "S") {
data$n_all <- NA

# remove redundant quantities
data$height <- NULL
data$height_mean <- NULL

# sort into bioRad order
data <- data[, header.names.sorted]
Expand Down
5 changes: 5 additions & 0 deletions R/read_pvolfile.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,15 @@ read_pvolfile_scan <- function(file, scan, param, radar, datetime, geo) {

read_pvolfile_quantity <- function(file, quantity, radar, datetime, geo) {
data <- h5read(file, quantity)$data
# convert storage mode from raw to numeric:
storage.mode(data) <- "numeric"
attr <- h5readAttributes(file, paste(quantity, "/what", sep = ""))
data <- replace(data, data == as.numeric(attr$nodata), NA)
data <- replace(data, data == as.numeric(attr$undetect), NaN)
data <- as.numeric(attr$offset) + as.numeric(attr$gain) * data
if(attr$quantity == "RHOHV"){
data <- replace(data, data > 10, NaN)
}
class(data) <- c("param", class(data))
attributes(data)$radar <- radar
attributes(data)$datetime <- datetime
Expand Down
15 changes: 13 additions & 2 deletions R/regularize_vpts.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ regularize_vpts <- function(ts, interval = "auto", date_min = ts$daterange[1],
stopifnot(inherits(date_min, "POSIXct"))
stopifnot(inherits(date_max, "POSIXct"))

# @param keep_datetime Logical, when \code{TRUE} keep original radar acquisition timestamps,
# and do not update to values of the regularized time grid.
keep_datetime <- FALSE # option under development

if (!(units %in% c("secs", "mins", "hours", "days", "weeks"))) {
stop(
"Invalid 'units' argument. Should be one of",
Expand Down Expand Up @@ -85,6 +89,7 @@ regularize_vpts <- function(ts, interval = "auto", date_min = ts$daterange[1],
ts$data[[x]][, index]
}
)
index2 <- integer(0)
if (!fill) {
index2 <- which(abs(ts$datetime[index] - grid) > as.double(dt, units = "secs"))
if (length(index2) > 0) {
Expand All @@ -99,8 +104,14 @@ regularize_vpts <- function(ts, interval = "auto", date_min = ts$daterange[1],
}
}
names(ts$data) <- quantity.names
ts$datetime <- grid
ts$timesteps <- rep(as.double(dt, units = "secs"), length(grid) - 1)
if(!keep_datetime){
ts$datetime <- grid
ts$timesteps <- rep(as.double(dt, units = "secs"), length(grid) - 1)
} else{
ts$datetime <- ts$datetime[index]
ts$timesteps <- difftime(ts$datetime[-1], ts$datetime[-length(ts$datetime)], units = "secs")
ts$timesteps[index2] <- dt
}
ts$regular <- TRUE
return(ts)
}
2 changes: 1 addition & 1 deletion R/vpts.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ print.vpts <- function(x, digits = max(3L, getOption("digits") - 3L), ...) {
} else {
stepMin <- stepMax <- NA
}
if (x$regular) {
if (x$regular & stepMin == stepMax) {
cat(" time step (s): ", stepMin, "\n")
} else {
cat(" time step (s): ", "min:", stepMin, " max: ", stepMax, "\n")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Then load the package with:

``` r
library(bioRad)
#> Welcome to bioRad version 0.5.0
#> Docker daemon running, Docker functionality enabled (vol2bird version 0.5.0, MistNet available)
#> Welcome to bioRad version 0.5.1
#> Docker daemon running, Docker functionality enabled (vol2bird version 0.5.1, MistNet available)
```

#### Required system libraries on Linux (Ubuntu)
Expand Down
22 changes: 17 additions & 5 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"@type": "SoftwareSourceCode",
"identifier": "bioRad",
"description": "Extract, visualize and summarize aerial movements of birds and\n insects from weather radar data. See <https://doi.org/10.1111/ecog.04028>\n for a software paper describing package and methodologies.",
"description": "Extract, visualize and summarize aerial movements of birds and\n insects from weather radar data. See <doi:10.1111/ecog.04028>\n for a software paper describing package and methodologies.",
"name": "bioRad: Biological Analysis and Visualization of Weather Radar Data",
"codeRepository": "https://github.com/adokter/bioRad",
"relatedLink": [
Expand All @@ -15,14 +15,14 @@
],
"issueTracker": "https://github.com/adokter/bioRad/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.5.0",
"version": "0.5.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"version": "3.6.2",
"version": "3.6.3",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 3.6.2 (2019-12-12)",
"runtimePlatform": "R version 3.6.3 (2020-02-29)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -271,6 +271,18 @@
"identifier": "utils",
"name": "utils"
},
{
"@type": "SoftwareApplication",
"identifier": "viridisLite",
"name": "viridisLite",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=viridisLite"
},
{
"@type": "SoftwareApplication",
"identifier": "viridis",
Expand Down Expand Up @@ -394,5 +406,5 @@
],
"releaseNotes": "https://github.com/adokter/bioRad/blob/master/NEWS.md",
"readme": "https://github.com/adokter/bioRad/blob/master/README.md",
"fileSize": "5887.639KB"
"fileSize": "4947.408KB"
}
31 changes: 14 additions & 17 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
## bioRad 0.5.1
This version includes a minor bugfix associated with the
upcoming R 0.4.0 release. I only found out today that our
package had been removed from CRAN because of this, without
any notice, is there a way for me to subscribe to a notification
when my package is pending to be removed?

## Test environments
* local OS X install, R 3.6.2
* local Ubuntu 18.04 LTS, R 3.6.2
* local Windows 10 Enterprise, R 3.6.2
* local OS X install, R 3.6.3
* local Ubuntu 18.04 LTS, R 3.6.3
* local Windows 10 Enterprise, R 3.6.3

## R CMD check results
There were no ERRORs or WARNINGs.
Expand All @@ -18,20 +25,10 @@ There was 1 NOTE:
The tarball is however below the required 5 Mb

## r-hub builder
Building bioRad with r-hub (using `check_rhub()` fails because gdal is
not available on the r-hub build system. The rgdal package is a
dependency of bioRad. rgdal documentations explains in detail
how to install gdal on all platforms, so this seems more an
rgdal issue than a bioRad issue.

Resulting PREPERROR:
```
#> configure: GDAL: 1.11.3
#> checking GDAL version >= 1.11.4... no
#> configure: error: upgrade GDAL to 1.11.4 or later
#> ERROR: configuration failed for package ‘rgdal’
#> * removing ‘/home/docker/R/rgdal’
```
There was one warning:

* checking package dependencies ... WARNING
Requires orphaned package: 'ggmap'

## Downstream dependencies
There are currently no downstream dependencies for this package
37 changes: 23 additions & 14 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78b1506

Please sign in to comment.