map: Map a plan position indicator ('ppi')

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/map.R

Description

Plot a ppi on a Stamen Maps, OpenStreetMap, Google Maps or Naver Map base layer map using ggmap.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
map(x, ...)

## S3 method for class 'ppi'
map(
  x,
  map,
  param,
  alpha = 0.7,
  xlim,
  ylim,
  zlim = c(-20, 20),
  ratio,
  radar_size = 3,
  radar_color = "red",
  n_color = 1000,
  radar.size = 3,
  radar.color = "red",
  n.color = 1000,
  palette = NA,
  ...
)

Arguments

x

An object of class ppi.

...

Arguments passed to low level ggmap function.

map

The basemap to use, result of a call to download_basemap.

param

The scan parameter to plot.

alpha

Transparency of the data, value between 0 and 1.

xlim

Range of x values to plot (degrees longitude), as atomic vector of length 2.

ylim

Range of y values to plot (degrees latitude), as an atomic vector of length 2.

zlim

The range of values to plot.

ratio

Aspect ratio between x and y scale, by default 1/cos(latitude radar * pi/180).

radar_size

Size of the symbol indicating the radar position.

radar_color

Color of the symbol indicating the radar position.

n_color

The number of colors (>=1) to be in the palette.

radar.size

Deprecated argument, use radar_size instead.

radar.color

Deprecated argument, use radar_color instead.

n.color

Deprecated argument, use n_color instead.

palette

(Optional) character vector of hexidecimal color values defining the plot color scale, e.g. output from viridis

Details

Available scan parameters for mapping can by printed to screen by summary(x). Commonly available parameters are:

"DBZH", "DBZ"

(Logged) reflectivity factor (dBZ)

"TH", "T"

(Logged) uncorrected reflectivity factor (dBZ)

"VRADH", "VRAD"

Radial velocity (m/s). Radial velocities towards the radar are negative, while radial velocities away from the radar are positive

"RHOHV"

Correlation coefficient (unitless) Correlation between vertically polarized and horizontally polarized reflectivity factor

"PHIDP"

Differential phase (degrees)

"ZDR"

(Logged) differential reflectivity (dB)

The scan parameters are named according to the OPERA data information model (ODIM), see Table 16 in the ODIM specification.

Value

A ggmap object (a classed raster object with a bounding box attribute).

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# load an example scan:
data(example_scan)
# make ppi's for all scan parameters in the scan
ppi <- project_as_ppi(example_scan)
## Not run: 
# grab a basemap that matches the extent of the ppi:
# using a gray-scale basemap:
basemap <- download_basemap(ppi, maptype = "toner-lite")

# map the radial velocity scan parameter onto the basemap:
map(ppi, map = basemap, param = "VRADH")

# extend the plotting range of velocities, from -50 to 50 m/s:
map(ppi, map = basemap, param = "VRADH", zlim = c(-50, 50))

# map the reflectivity on a terrain basemap:
basemap <- download_basemap(ppi, maptype = "terrain")
map(ppi, map = basemap, param = "DBZH")

# change the color palette, e.g. Viridis colors:
map(ppi, map = basemap, param = "DBZH", palette = viridis::viridis(100), zlim=c(-10,10))

# give the data more transparency:
map(ppi, map = basemap, param = "DBZH", alpha = 0.3)

# change the appearance of the symbol indicating the radar location:
map(ppi, map = basemap, radar_size = 5, radar_color = "blue")

# crop the map:
map(ppi, map = basemap, xlim = c(12.4, 13.2), ylim = c(56, 56.5))

## End(Not run)

bioRad documentation built on July 1, 2020, 10:18 p.m.