Learn R Programming

vol2birdR

vol2birdR’ is an ‘R’ package for the ‘vol2bird’ algorithm for calculating vertical profiles of birds and other biological scatterers from weather radar data.

It also provides an ‘R’ interface to the ‘MistNet’ convolutional neural network for precipitation segmentation, installing PyTorch libraries and model.

vol2birdR’ can be used as a stand-alone package, but we recommend bioRad as the primary user interface, with ‘vol2birdR’ acting as a dependency of bioRad.

Install

vol2birdR’ is available for all major platforms (Linux, OS X and Windows).

For OS X and Windows, you can install the released version of ‘vol2birdR’ from CRAN with:

install.packages("vol2birdR")

Alternatively, you can install the latest development version from GitHub with:

# install.packages("devtools")
devtools::install_github("adokter/vol2birdR")

For Linux and for installation of the development version the GNU Scientific Library (GSL), PROJ and HDF5 libraries need to be installed as system libraries prior to installation of ‘vol2birdR’:

Click here for additional information when installing the dependencies on macOS

Since the installation process requires the Homebrew package manager you will have to install it. Open a terminal and issue the following command:

  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

When the installation has completed it will print out some additional information that is essential to follow.

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    echo >> /Users/$USER/.zprofile
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

You need to ensure that you follow the above three commands. The first two will add the necessary environment variables to your zshell user profile.

    echo >> /Users/$USER/.zprofile
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile

The second command will ensure that you get the necessary environment variables into the terminal where you ran the installation process of Homebrew.

    eval "$(/opt/homebrew/bin/brew shellenv)"
SystemCommand
OS X (using Homebrew)brew install hdf5 proj gsl pkg-config
Debian-based systems (including Ubuntu)sudo apt-get install libhdf5-dev libproj-dev gsl-bin libgsl-dev pkg-config libbz2-dev
Systems supporting yum and RPMssudo yum install hdf5-devel proj-devel gsl gsl-devel pkgconfig

Then load the package with:

library(vol2birdR)

MistNet installation

MistNet is a deep convolution neural net for segmenting out precipitation from radar data, see Lin et al. 2019. To use MistNet, follow the following additional installation steps in R:

# STEP 1: install additional libraries for using MistNet:
library(vol2birdR)
install_mistnet()

After completing this step, the following command should evaluate to TRUE:

mistnet_exists()

Next, download the mistnet model. Note that the model file is large, over 500Mb.

# STEP 2: download mistnet model:
install_mistnet_model()

See vignette for additional installation information

References:

Citation for ‘vol2bird’ algorithm:

Paper describing recent algorithm extensions and the bioRad package:

‘vol2bird’ implements dealiasing using the torus mapping method by Haase and Landelius:

Use the following citation for the ‘MistNet’ rain segmentation model:

Copy Link

Version

Install

install.packages('vol2birdR')

Monthly Downloads

313

Version

1.0.9

License

LGPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Adriaan M. Dokter

Last Published

March 28th, 2025

Functions in vol2birdR (1.0.9)

install_mistnet

Install 'MistNet' libraries
mistnet_exists

Checks if the 'LibTorch' and 'MistNet' libraries have been installed or not.
mistnet_install_libs

Installs the 'MistNet' libraries
vol2bird

Calculate a vertical profile (vp) from a polar volume (pvol) file
mistnet_install_lib

Installs the library
cpp_vol2bird_set_wsr88d_site_location

Sets the wsr88d site location file
mistnet_default

The default 'MistNet' version
vol2bird_version

Return 'vol2bird' version
rsl2odim

Convert a NEXRAD polar volume file to an ODIM polar volume file
install_path

Returns the path of the 'MistNet' libraries for specified version
install_type

Returns the LibTorch install type
nexrad_station_file

Retrieve or set the nexrad location file
torch_install_path

Returns the 'LibTorch' installation path.
vol2bird_config

Create a 'vol2bird' configuration instance
vol2birdR-package

vol2birdR: Vertical Profiles of Biological Signals in Weather Radar Data
load_volume

Loads a volume vol2bird-style meaning that a number of different file formats are tried and eventually loaded.
skip_if_no_temp_access

Skip test if tempdir() not accessible
cpp_vol2bird_version

Initializes the mistnet shared library pointed to by the path
install_mistnet_model

Install 'MistNet' model file
mistnet_installed

Check if MistNet installation is complete
mistnet_start

Initialize the 'MistNet' system if enabled.
install_os

Returns the system name
PolarVolume-class

PolarVolume
branch

The default branch
get_install_urls

List of installation files to download
cpp_vol2bird_initialize

Initializes the vol2birdR library
cpp_vol2bird_namespace__store_main_thread_id

Sets the main thread id
cpp_mistnet_init

Initializes the mistnet shared library pointed to by the path
Vol2BirdConfig-class

Vol2Bird configuration
install_config

Contains a list of 'MistNet' libraries for the various OS's
cpp_vol2bird_get_wsr88d_site_location

Returns the wsr88d site location file
Vol2Bird-class

Vol2Bird processor class
RaveIO-class

RaveIO routines
cpp_printMemory

The software has to be compiled with -DRAVE_MEMORY_DEBUG and without -DNO_RAVE_PRINTF. Manual handling for now.
lib_installed

Returns the path of the 'MistNet' libraries for specified version
install_mistnet_from_file

Install 'MistNet' libraries from files