# Introductory exercises with bioRad

These course materials were developed for the 3d Radar Aeroecology Training School, Jul 30 - Aug 2 2019, University of Oklahoma, Norman, OK, USA.

## 1 Basic visualisation of radar scans in R

### 1.1 Preparation

Radar data needed for this practical can be downloaded here.

Follow bioRad’s install instructions, and install the latest development version to be fully up-to-date.

Execute each of the code examples provided below in RStudio, and try to complete the exercises.

Make sure you have the latest version (0.4.0.9243). If you have an older version, download and reinstall as follows:

All bioRad’s functions are documented in an extensive function refererence online, as well as in manual pages within R:

Start by making a new directory on your local machine that you will use for this practical:

Your R session is now properly set up.

To work with US NEXRAD data, bioRad currently requires a working installation of Docker (Linux/Mac) or Docker for Windows (not Docker Toolbox, this is an older implementation of Docker for Windows operating systems that is not supported). If you managed to successfully install Docker, test whether it works:

The message “running docker image with vol2bird version 0.4.0” indicates everything is working.

If you did not manage to install Docker, you will be able to continue with all of below exercises, but not be able to load NEXRAD data into R at this time.

### 1.2 The structure of polar volumes

Exercise 1: Load the polar volume file, example_pvol.h5 from the files downloaded in section 1.1. Put it in your working directory and load it into R. What is the minimum and maximum scan elevation contained in the volume? And which scan parameters are available? (See manual page of the read_pvolfile() function for the nomenclature of various available quantities).

### 1.3 Plotting radar scans

Usually it is more intuitive to explore radar scans as a PPI (plan position indicator), which is a projection of the scan on a Cartesian (X,Y) or (lat,lon) grid:

Exercise 2: This case contains convective precipitation, characterized by localized but intense thunderstorms, as well as biological scattering. Make also a ppi plot of the correlation coefficient (RHOHV) and radial velocity (VRADH). Verify how the texture of the radial velocity, and the values of correlation coefficient of the precipitative areas differs from the areas with biological scattering.

Exercise 3: Based on the radial velocity image, are the biological scatterers birds or insects? Why?

### 1.4 Overlaying radar scans on maps

bioRad provides several functions to convert radar scans to other common spatial formats in R (cf. package raster and package sp), see scan_to_raster() and scan_to_spatial(), allowing you to process and overlay the radar data further with these spatial analysis toolkits.

## 2 Analysis and visualisation of vertical bird profiles

In this section you will learn to compute, interpret and analyze vertical profiles (vp). A vp consists of the (bird) density, speed and directions at different altitudes at the location of a single radar. It is typically calculated for all data within a cylinder of 35 km radius around the radar, i.e. only containing data at relatively short distances, where the radar beam is still sufficiently narrow to resolve altitude information.

Section 3 has examples that show how to process polar volume data into vertical profiles. To save time, we will start below with a list of pre-processed vertical profiles for the Brownsville radar in Texas (KBRO).

### 2.2 Inspecting single vertical profiles

Now that you have loaded a list of vertical profiles, we can start exploring them. We will start with plotting and inspecting single vertical profiles, i.e. a single profile from the list of vp objects you have just loaded.

eta and dbz are closely related, the main difference is that reflectivity factors are logarithmic, and reflectivities linear. You can convert one into the other using eta_to_dbz() and dbz_to_eta() functions, which follow this simple formula:

eta = (radar-wavelength dependent constant) * 10^(dbz/10)

The reflectivity factor dBZ is the quantity used by most meteorologist. It has the useful property that at different radar wavelengths (e.g. S-band versus C-band) the same amount of precipitation shows up at similar reflectivity factors. The same holds for insects, as well as any other target that is much smaller than the radar wavelength (S-band = 10 cm, C-band = 5 cm), the so-called Rayleigh-scattering limit.

In the case of birds we are outside the Rayleigh limit, because birds are of similar size as the radar wavelength. In this limit reflectivity eta is more similar between S-band and C-band. eta is also more directly related to the density of birds, since eta can be expressed as (bird density) x (radar cross section per bird). For these two reasons, for weather radar ornithologists not reflectivity factor dBZ but reflectivity eta is the more conventional unit.

Exercise 4: If you change your assumption on the bird’s radar cross section in the previous example, and assume it is 10 times as large, what will be the effect on the bird density profile?

The radar cross section you assume can be changed as follows:

Exercise 5: Verify your answers on the previous two questions, by re-plotting the vertical profiles for the bird density quantity.

### 2.3 Plotting vertical profile time series

We will now examine multiple vertical profiles at once that are ordered into a time series, e.g. the vertical profiles obtained from a single radar over a full day.

Let’s make a plot for a subselection of the time series:

Exercise 6: Interpret the wind barbs in the profile time series figure: what is the approximate speed and direction at 1500 meter at 6 UTC? In the speed barbs, each half flag represents 2.5 m/s, each full flag 5 m/s, [each pennant (triangle) 25 m/s, not occurring in this case].

Exercise 7: Extract the vertical profile at 6 UTC from the time series and plot the vertical profile of ground speed (quantity ff). Hint: use function filter_vpts() to extract the 6 UTC profile. Check whether your answer to the previous question was approximately correct.

### 2.4 Vertical and time integration of profiles

Often you will want to sum together all the migrants in the vertical dimension, for example if you want a single index of how many birds are migrating at a certain instant. There are at least two ways in which you can do that:

• by calculating the vertically integrated bird density (VID), which is surface density as opposed to a volume densities you have been plotting in the previous exercises: this number gives you how many migrants are aloft per square kilometer earth’s surface (unit individuals/km$$^{2}$$), and is a vertical integration of the volume densities(unit individuals/km$$^{3}$$).
• Note that the VID quantity doesn’t depend on the speed of the migrants. A common measure that reflects both the density and speed of the migration is migration traffic rate (MTR). This is flux measure that gives you how many migrants are passing the radar station per unit of time and per unit of distance perpendicular to the migratory direction (unit individuals/km/hour).

We will be using bioRad’s integrate_profile() function to calculate these quantities:

The following questions only require pen and paper. Assume a night migration event in which the volume density of birds from 0-1 km above ground is 200 birds per cubic kilometer, and from 1-1.5 km 100 birds per cubic kilometer. In the lower layer birds fly at 50 km/hour, and in the upper layer at 100 km/hour. Above 1500 meter there are no birds. Migration continues for exactly three hours after sunset, and then halts abruptly.

Exercise 8: What is in this case the bird’s vertically integrated density (VID)? Give your answer in units birds/km$$^2$$.

Exercise 9: What is in this case the migration traffic rate across a transect perpendicular to the direction of movement? Give your answer in units birds/km/hour.

Exercise 10: How many birds have passed a 1km transect perpendicular to the direction of movement in this night? Give your answer in terms of migration traffic (mt) in units birds/km.

Both MTR, VID and MT depend on the assumed radar cross section (RCS) per bird. If you are unwilling/unable to specify RCS, you can alternatively use two closely related quantities that make no assumptions RCS:

VIR gives you the total cross-sectional area of air-borne targets per square kilometer of ground surface, whereas RTR gives you the total cross-sectional area of targets flying across a one kilometer line perpendicular to the migratory flow per hour.

### 2.5 Inspecting precipitation signals in profiles

Precipitation is known to have a major influence on the timing and intensity of migration, therefore it is a useful skill to be able to inspect profiles for presence of precipitation.

Also, although automated bird quantification algorithms become more and more reliable, distinguishing precipitation from birds remains challenging for algorithms in specific cases. It is therefore important to have the skills to inspect suspicious profiles. That may help you to identify potential errors of the automated methods, and prevent your from overinterpreting the data.

An easy way of doing that is plotting the vertical profile of total reflectivity (quantity DBZH), which includes everything: birds, insects and precipitation. Precipitation often has higher reflectivities than birds, and also extends to much higher altitudes.

Exercise 11: Compare the above plot for bird density (quantity dens) with a profile plot for total reflectivity (quantity DBZH, showing birds and precipitation combined). Compare the two plots to visually identify periods and altitude layers with precipitation.

## 3 Processing polar volume data into profiles

### 3.1 Obtaining radar data

• US NEXRAD polar volume data can be accessed in the Amazon cloud.
• European radar data can be accessed at http://enram.github.io/data-repository/. These are processed vertical profiles, the full polar volume data are not openly available for most countries.

The names of the radars in the networks can be found here:

Useful sites for inspecting pre-made movies of the US composite are http://birdcast.info/live-migration-maps/ and http://www.pauljhurtado.com/US_Composite_Radar/.

### 3.2 Processing a single polar volume with the vol2bird algorithm

The following steps take you through the process applying the vol2bird algorithm yourself. You need a working installation of Docker (Linux/Mac) or Docker for Windows (not Docker Toolbox, this is an older implementation of Docker for Windows operating systems that is not supported).

We will generate vertical profiles with the automated algorithm vol2bird (https://github.com/adokter/vol2bird), which is included in the bioRad package.

If you get a “Hello from Docker!” welcome message, everything is working and you can start processing.

### 3.3 Processing multiple polar volumes

This section contains an example for processing a directory of polar volumes into profiles:

Having generated the profiles, we can read them into R:

You can now continue with visualizing and post-processing as we did earlier:

### 4. Further analysis

In many cases you will want to convert bioRad’s objects into a convenient form for your own further analyses. To convert bioRad objects to a simple data.frame:

• vertical profile (vp): as.data.frame(your_vp_object)
• vertical profile time series (vpts): as.data.frame(your_vpts_object)
• integrated vertical profile time series (vpi): is already a data.frame

Converting polar scans (scan objects) to common spatial formats:

• use scan_to_raster() to convert to a RasterBrick object (package raster)
• use scan_to_spatial() to convert to a SpatialPointsDataFrame object (package sp)