Storm tracking for Real Projections

An R package to analyse and plot storm tracks and storm track density from reanalyses and climate model data.

The package uses data.table and ggplot2 for fast computation and high quality graphics.

Installation

devtools::install_github('sieste/realstorms')
library(realstorms)
knitr::opts_chunk$set(fig.width=8, fig.height=4.5, fig.path='figure/readme/')
devtools::install()
library(realstorms)

Usage example

We are working with files of standard ascii output format produced by the TRACK storm tracking software. (Currently, no data is included with the package, but will soon be.)

stormsfile = 'storms.txt'
writeLines(readLines(stormsfile, n=8))

The function read_tracks parses TRACK output into a data.table. Variable names can be passed as a function argument:

trx = read_tracks(stormsfile, var=c('vor850', 'mslp', 'speed', 'precip', 'omega'))
head(trx)

The function track_density splits the world up into grid boxes of width and height bw (in degrees) and calculates track count, track density, feature count and feature density:

# calculate track density on a 5x5 degree grid
td = track_density(trx, bw=1)
head(td)

The object trx is of class stormtracks, and the object td is of class track_density. Both classes have S3 plotting methods:

plot(trx, var='vor850')
plot(td, what='track_density', contour_smooth=2) + 
coord_cartesian(xlim=c(-100,100), ylim=c(25,75))


sieste/real_storm_tracks documentation built on May 24, 2019, 7:19 a.m.