Package 'StormR'

Title: Analyzing the Behaviour of Wind Generated by Tropical Storms and Cyclones
Description: Set of functions to quantify and map the behaviour of winds generated by tropical storms and cyclones in space and time. It includes functions to compute and analyze fields such as the maximum sustained wind field, power dissipation index and duration of exposure to winds above a given threshold. It also includes functions to map the trajectories as well as characteristics of the storms.
Authors: Baptiste Delaporte [aut], Thomas Ibanez [aut] , Gunnar Keppel [aut] , Swen Jullien [aut] , Christophe Menkes [aut] , Thomas Arsouze [aut, cre]
Maintainer: Thomas Arsouze <[email protected]>
License: GPL (>= 3)
Version: 0.2.1
Built: 2024-11-12 09:25:39 UTC
Source: https://github.com/umr-amap/stormr

Help Index


Creating a stormsDataset object

Description

The defStormsDataset() function creates a stormsDataset object from either a NetCDF or a CSV file. This is an essential first step before other stormR functions can be used.

Usage

defStormsDataset(
  filename = system.file("extdata", "test_dataset.nc", package = "StormR"),
  sep = NULL,
  fields = c(names = "name", seasons = "season", isoTime = "iso_time", lon = "usa_lon",
    lat = "usa_lat", msw = "usa_wind", basin = "basin", rmw = "usa_rmw", pressure =
    "usa_pres", poci = "usa_poci"),
  basin = NULL,
  seasons = c(1980, as.numeric(format(Sys.time(), "%Y"))),
  unitConversion = c(msw = "knt2ms", rmw = "nm2km", pressure = "mb2pa", poci = "mb2pa"),
  notNamed = "NOT_NAMED",
  verbose = 1
)

Arguments

filename

character. Name of the NetCDF (.nc)/CSV (.csv) file. Default is the test_dataset.nc file located in the inst/extdata repository of the directory (accessible by system.file("extdata", "test_dataset.nc", package = "StormR")). This test dataset is extracted from the IBTrACS.SP.v04r00.nc file and provides all the tropical cyclones that occurred around Vanuatu from 2015 to 2016 and around New Caledonia from 2020 to 2021.

sep

character. The field separator character if filename is a CSV file. Default value is set to NULL which will set the separator to ",".

fields

named character vector. This argument allows to specify the corresponding variable names (NetCDF) or headers (CSV) in the input file for each field in the output stormsDataset. By default, the corresponding variable names are set up to import data from a NetCDF file from the IBTrACS database (Knapp et al., 2010). Corresponding variable names for following fields have to (mandatory fields) or can be (recommended or optional fields) provided:

  • "names", names of the storms (mandatory),

  • "seasons", years of observations (mandatory),

  • "isoTime", date and time of observations (mandatory),

  • "lon", longitude of the observations (mandatory),

  • "lat", latitude of the observations (mandatory),

  • "msw", maximum sustained wind speed (mandatory),

  • "basin", name of the area where the storm originated (recommended),

  • "rmw", radius of maximum winds: distance between the centre of the storm and its band of strongest winds (recommended),

  • "pressure", central pressure (recommended),

  • "poci", pressure of the last closed isobar (recommended)

basin

character. If the basin field is provided, then storm track data will only be extracted for the named basin. By default basin=NULL, meaning that all storms irrespective of the basin they originated in are extracted. Seven basins can be used to filter the data set:

  • "NA", for North Atlantic basin,

  • "SA", for South Atlantic basin,

  • "EP", for Eastern North Pacific basin,

  • "WP", for Western North Pacific basin,

  • "SP", for South Pacific basin,

  • "SI", for South India basin, or

  • "NI", for North India basin.

seasons

numeric vector. Seasons of occurrence of the storms (e.g., c(2020,2022)). In the Southern Hemisphere, the cyclone season extends across two consecutive years. Therefore, to capture the 2021 to 2022 cyclone season both years should be specified, with cyclones assigned for the year that originated in. By default all storms occurring since 1980 are extracted.

unitConversion

named character vector. StormR functions use the metric system (international system of units), therefore msw has to be provided in m.s1m.s^{-1}, rmw in kmkm, pressure and poci in PaPa. By default unitConversion=c(msw = "knt2ms", rmw = "nm2km", pressure = "mb2pa", poci = "mb2pa") to meet the requirements when importing a NetCDF file from the IBTrACS database. This argument is mandatory even if no conversion is needed. If no conversion is needed then use "None" in the corresponding fields. The following unit conversions are implemented:

For msw,

  • "knt2ms", to convert knot to meter per second (default setting),

  • "kmh2ms", to convert kilometre per hour to meter per second,

  • "⁠mph2ms"⁠, to convert miles per hour to meter per second, or

  • "None", if no conversion is needed.

For rmw,

  • "nm_to_ms"to convert nautical miles to kilometre (default setting), or

  • "None"if no conversion is needed.

For pressure and poci,

  • "⁠mb2pa"⁠, to convert millibar to Pascal (default setting),

  • "b2pa", to convert bar to Pascal,

  • "atm2pa", to convert atmosphere to Pascal,

  • "psi2pa", to convert psi to Pascal, or

  • "None", if no conversion is needed.

notNamed

character. Constant name for not named storms to remove in the database. Default value is "NOT_NAMED" (IBTrACS database)

verbose

numeric. Whether the function should display (⁠= 1⁠) or not (⁠= 0⁠) information about the processes.

Value

The defStormsDataset() function returns a stormsDataset object.

References

Knapp, K. R., Kruk, M. C., Levinson, D. H., Diamond, H. J., & Neumann, C. J. (2010). The International Best Track Archive for Climate Stewardship (IBTrACS). Bulletin of the American Meteorological Society, 91(3), Article 3. https://doi.org/10.1175/2009bams2755.1

Examples

# Creating a `stormsDataset` object with storms between 2010 and 2015
# in the South Pacific using the NetCDF provided with the package
SP_2015_2020_nc <- defStormsDataset(seasons = c(2010, 2015))
str(SP_2015_2020_nc)

# Creating a `stormsDataset` object with storms between 2010 and 2015
# in the South Pacific using the CSV provided with the package
fileName <- system.file("extdata", "test_dataset.csv", package = "StormR")
SP_2015_2020_csv <- defStormsDataset(seasons = c(2010, 2021))
str(SP_2015_2020_csv)

Creating a stormsList object

Description

The defStormsList() function extracts storm track data from a stormsDataset and creates a stormsList object based on specified arguments relating to location of interest, seasons, and names of the storms.

Usage

defStormsList(
  sds,
  loi,
  seasons = c(sds@seasons["min"], sds@seasons["max"]),
  names = NULL,
  maxDist = 300,
  scale = sshs,
  scalePalette = NULL,
  removeUnder = NULL,
  verbose = 2
)

Arguments

sds

stormsDataset object.

loi

Location of interest. Can be defined using,

  • character, a country name (e.g., "Vanuatu")

  • character, a basin name among "NA", "SA", "EP", "WP", "SP", "SI" and "NI"

  • numeric vector, a point coordinate (lon, lat in decimal degrees, e.g., c(169.5, -19.2))

  • sp (SpatialPolygon) or a sf (simple features) object (e.g., created from a shapefile)

seasons

numeric vector. Seasons of occurrence of the storms (e.g., c(2020,2022)). In the Southern Hemisphere, the cyclone season extends across two consecutive years. Therefore, to capture the 2021 to 2022 cyclone season both years should be specified, with cyclones assigned for the year that originated in. By default all storms from sds are extracted.

names

character vector. Names of specific storms (in capital letters).

maxDist

numeric. Maximum distance between the location of interest and the storm for which track data are extracted. Default maxDist is set to 300 km.

scale

numeric. List of storm scale thresholds used for the database. Default value is set to the Saffir Simpson Hurricane Scale

scalePalette

character. Named vector containing the color hex code corresponding to each category interval of scale input

removeUnder

numeric. Storms reaching this maximum level or less in the scale are removed. Default value is set to NULL.

verbose

numeric. Type of information the function displays. Can be:

  • 2, information about both the processes and the outputs are displayed (default value),

  • 1, only information about the processes are displayed, or

  • 0, nothing is displayed.

Details

The available countries for the loi are those provided in the rwolrdxtra package. This package provide high resolution vector country boundaries derived from Natural Earth data. More informations on the Natural Earth data here: http://www.naturalearthdata.com/downloads/10m-cultural-vectors/.

Value

The defStormsList() function returns a stormsList object containing track data for all storms meeting the specified criteria (e.g., name, season, location).

References

Knapp, K. R., Kruk, M. C., Levinson, D. H., Diamond, H. J., & Neumann, C. J. (2010). The International Best Track Archive for Climate Stewardship (IBTrACS). Bulletin of the American Meteorological Society, 91(3), Article 3. doi:10.1175/2009bams2755.1

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting data using country names
vanuatu.st <- defStormsList(sds = sds, loi = "Vanuatu")

#Getting data using a specific point location
pt <- c(169, -19)
pam.pt <- defStormsList(sds = sds, loi = pt, names = "PAM")

#Getting data using country and storm names
niran.nc <- defStormsList(sds = sds, loi = "New Caledonia", names = c("NIRAN"))

#Getting data using a user defined spatial polygon
poly <- cbind(c(135, 290, 290, 135, 135),c(-60, -60, 0, 0, -60))
sp <- sf::st_polygon(list(poly))
sp <- sf::st_sfc(sp, crs = 4326)
sp <- sf::st_as_sf(sp)
sts_sp <- defStormsList(sds = sds, loi = sp)

EEZ of New Caledonia

Description

Provide the geographic limits of the eez of New Caledonia

Usage

eezNC

Format

eezNC

a sf object


Getting the buffered location of interest

Description

The getBuffer() function returns the buffered location of interest from a stormsList object.

Usage

getBuffer(sts)

## S4 method for signature 'stormsList'
getBuffer(sts)

Arguments

sts

stormsList

Value

A sf object.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the buffered location of interest from the sts object
buff <- getBuffer(sts)

Getting the buffer size

Description

The getBufferSize() returns the buffer size used to generate the buffered location of interest for a stormsList object.

Usage

getBufferSize(sts)

## S4 method for signature 'stormsList'
getBufferSize(sts)

Arguments

sts

stormsList

Value

numeric.

Examples

#Creating a stormsDataset

sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the buffer size from the sts object
buffsize <- getBufferSize(sts)

Getting the number of the observations

Description

The getInObs() function returns the number of the observations in a given storm or stormsList object.

Usage

getInObs(s, ...)

## S4 method for signature 'stormsList'
getInObs(s, name, season = NULL)

## S4 method for signature 'storm'
getInObs(s)

Arguments

s

storm or stormsList object.

...

extra argument for stormsList

name

character. Name of the storm in capital letters.

season

numeric. Cyclonic season of the storm. Required only if several storm in s object have the same name. Default value is set to NULL

Value

Numeric vector.

Examples

#Creating a stormsDataset

sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the number of the observation for the tropical cyclone Niran in the sts object
getInObs(getStorm(sts, name = "NIRAN"))
getInObs(sts, name = "NIRAN")

Getting the location of interest

Description

The getLOI() functions returns the location of interest for the given stormsList.

Usage

getLOI(sts)

## S4 method for signature 'stormsList'
getLOI(sts)

Arguments

sts

stormsList object

Value

sf object.

Examples

#Creating a stormsDataset

sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the location of interest for the sts object
loi <- getLOI(sts)

Getting the names of the storms

Description

The getNames() function returns the names of the storms in a storm or a stormsList object.

Usage

getNames(s)

## S4 method for signature 'storm'
getNames(s)

## S4 method for signature 'stormsList'
getNames(s)

Arguments

s

storm or stormsList object.

Value

character vector.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the names of the storms from the sts object
getNames(sts)

Getting the number of observations

Description

The getNbObs() function returns the number of observations for a storm in a storm or stormsList object.

Usage

getNbObs(s, ...)

## S4 method for signature 'storm'
getNbObs(s)

## S4 method for signature 'stormsList'
getNbObs(s, name, season = NULL)

Arguments

s

storm or stormsList object.

...

extra arguments for stormsList

name

character. Name of the storm in capital letters.

season

numeric. Cyclonic season of the storm. Required only if several storm in the s have the same name. Default value is set to NULL.

Value

numeric.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

##Getting the number of observations for the tropical cyclone Niran in the sts object
getNbObs(getStorm(sts, name = "NIRAN"))
getNbObs(sts, name = "NIRAN")

Getting the number of storm

Description

The getNbStorms() returns the number of storm objects in the given stormsList object.

Usage

getNbStorms(sts)

## S4 method for signature 'stormsList'
getNbStorms(sts)

Arguments

sts

stormsList

Value

numeric, the number of storm objects.

Examples

#Creating a stormsDataset

sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the number of storms in the sts object
getNbStorms(sts)

Getting observations

Description

The getObs() function returns observed track data for a storm in a storm or stormsList object.

Usage

getObs(s, ...)

## S4 method for signature 'stormsList'
getObs(s, name, season = NULL)

## S4 method for signature 'storm'
getObs(s)

Arguments

s

storm or stormsList object

...

extra argument for stormsList

name

character. Name of the storm in capital letters.

season

numeric. Cyclonic season of the storm. Required only if several storm in the s object have the same name. Default value is set to NULL.

Value

A data.frame.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the observed track data for the tropical
#cyclone Niran in the sts object
getObs(getStorm(sts, name = "NIRAN"))
getObs(sts, name = "NIRAN")

Getting maximum level in the wind scale

Description

The getScale() function return the maximum wind scale category reached by each storm in the storm or stormsList object.

Usage

getScale(s)

## S4 method for signature 'storm'
getScale(s)

## S4 method for signature 'stormsList'
getScale(s)

Arguments

s

storm or stormsList object.

Value

numeric vector.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting maximum level in the wind scale
#reached by each storm in the sts object
getScale(sts)

Getting cyclonic seasons of the storms

Description

The getSeasons() function returns the cyclonic season of each storm in a storm or stormsList object.

Usage

getSeasons(s)

## S4 method for signature 'storm'
getSeasons(s)

## S4 method for signature 'stormsList'
getSeasons(s)

Arguments

s

storm or stormsList object.

Value

numeric vector.

Examples

#Creating a stormsDataset
sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting the cyclonic seasons of the storms from the sts object
getSeasons(sts)

Extracting a storm

Description

The getStorm() function extracts a specific storm object from a stormsList object.

Usage

getStorm(sts, name, season = NULL)

## S4 method for signature 'stormsList'
getStorm(sts, name, season = NULL)

Arguments

sts

stormsList

name

character. Name of the storm to extract.

season

numeric vector. Seasons of occurrence of the storms (e.g., c(2020,2022)). In the Southern Hemisphere, the cyclone season extends across two consecutive years. Therefore, to capture the 2021 to 2022 cyclone season both years should be specified, with cyclones assigned for the year #' that originated in. By default all storms occurring since 1980 are extracted.

Value

A storm object.

Examples

#Creating a stormsDataset

sds <- defStormsDataset()

#Getting storm track data for all storms near New Caledonia
sts <- defStormsList(sds=sds, loi = "New Caledonia")

#Getting `storm` for the tropical cyclone Niran
st <- getStorm(sts, name = "NIRAN")

Plotting spatial wind behaviour

Description

The plotBehaviour() function allows plotting spatial statistics generated using the spatialBehaviour() function and stored in SpatRaster objects.

Usage

plotBehaviour(
  sts,
  rasterProduct,
  colorPalette = NULL,
  main = NULL,
  xlim = NULL,
  ylim = NULL,
  labels = FALSE,
  by = 8,
  pos = 3,
  legends = "topright",
  dynamicPlot = FALSE
)

Arguments

sts

StormsList object.

rasterProduct

layer name in a SpatRaster object. The names of the layers follow the following terminology:

  • for "MSW" or "PDI", the name of the storm in capital letters and the name of the statistic separated by underscores (e.g., "PAM_MSW", "PAM_PDI"),

  • for duration of exposure, the name of the storm in capital letters, "Exposure", and the threshold value separated by underscores (e.g., "PAM_Exposure_18", "PAM_Exposure_33", ...).

  • for wind profiles, the name of the storm in capital letters, "Speed" or "Direction", and the indices of the observation separated by underscores (e.g., "PAM_Speed_41", "PAM_Direction_41",...).

colorPalette

character vector. The color palette used to plot the raster layer. If colorPalette=NULL (default setting), the default color palette is used.

main

character. Title of the plot. If main=NULL (default setting), a default title is generated based on the name of the layer.

xlim

numeric vector. The x limits of the plot.

ylim

numeric vector. The y limits of the plot.

labels

logical. Whether (TRUE) or not (FALSE, default setting) to add labels with the name of the storm and the indices and ISO times of the observation.

by

numeric. If labels=TRUE, defines the frequency at which labels are plotted. Default value is set to 8 which corresponds to a 24h (or 48h) time interval between the labelled observations when observations are made every 3 (or 6) hours.

pos

numeric. If labels=TRUE, defines the position of the labels, 1 (above the observation), 2 (on the left), 3 (below, default setting), and 4 (on the right).

legends

character. Indicates where to plot the legend, "topright"(default setting), "topleft", "bottomleft", "bottomright", or "none" (legend not plotted).

dynamicPlot

logical. Whether (FALSE, default setting) or (TRUE) to plot the data dynamicaly using leaflet library

Value

A plot of the storm track data with the raster layer.

Examples

# Creating a stormsDataset
sds <- defStormsDataset()

# Getting storm track data for tropical cyclone Pam (2015)
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")

# Plotting maximum sustained wind speed for Pam (2015) near Vanuatu
pam.msw <- spatialBehaviour(pam, verbose = 0)
plotBehaviour(pam, pam.msw)

# dynamicPlot mode
plotBehaviour(pam, pam.msw, dynamicPlot = TRUE)

# Plotting 2D wind speed profile for Pam (2015) near Vanuatu
pam.prof <- spatialBehaviour(pam, product = "Profiles", verbose = 0)
plotBehaviour(pam, pam.prof$PAM_Speed_37, labels = TRUE, pos = 4)

Plotting storm track data

Description

This plotStorms() function allows plotting storm track data stored in a StormsList object.

Usage

plotStorms(
  sts,
  names = NULL,
  category = NULL,
  xlim = NULL,
  ylim = NULL,
  labels = FALSE,
  by = 8,
  pos = 3,
  legends = "topright",
  loi = TRUE,
  dynamicPlot = FALSE
)

Arguments

sts

StormsList object

names

character vector. Name(s) of the storm(s) in capital letters. If names = NULL (default setting), all storms are plotted.

category

numeric vector. Category of storms to be plotted among the level in the windscale provided in sts input. If category=NULL (default setting), all storms are plotted.

xlim

numeric vector. The x limits of the plot.

ylim

numeric vector. The y limits of the plot.

labels

logical. Whether (TRUE) or not (FALSE, default setting) to add labels with the name of the storm and the indices and ISO times of the observation.

by

numeric. If labels=TRUE, defines the frequency at which labels are plotted. Default value is set to 8 which corresponds to a 24h (or 48h) time interval between the labelled observations when observations are made every 3 (or 6) hours.

pos

numeric. If labels=TRUE, defines the position of the labels, 1 (above the observation), 2 (on the left), 3 (below, default setting), and 4 (on the right).

legends

character. Indicates where to plot the legend, "topright"(default setting), "topleft", "bottomleft", "bottomright", or "none" (legend not plotted).

loi

logical. Whether (TRUE, default setting) or not (FALSE) to plot the extent of the buffered location of interest on the map.

dynamicPlot

logical. Whether (FALSE, default setting) or (TRUE) to plot the data dynamicaly using leaflet library

Value

A plot of the storm track data.

Examples

#' #Creating a stormsDataset

dev.off()
sds <- defStormsDataset()

# Getting storm track data for tropical cyclone Pam (2015)
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")

# Plotting Pam over Vanuatu with labels every 24h
plotStorms(sts =pam, labels = TRUE)

# Plotting Pam over Vanuatu with labels every 6h on the right side of the observations
plotStorms(pam, labels = TRUE, by = 2, pos = 4)

# dynamicPlot mode

Plotting wind behaviour time series and summary statistics at given point locations

Description

Plotting wind behaviour time series and summary statistics at given point locations

Usage

plotTemporal(data, storm, var = "speed")

Arguments

data

time series generated with temporalBehaviour with product=TS input

storm

list of characters. Storm names. The storm must be available in data input. It can also be a vector of integer corresponding to the indices of storms stored in datainput.

var

character. Represent the type of variable to plot. Must be either speed or direction. Default value is set to speed.

Value

null

Examples

sds <- defStormsDataset()
st <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM", verbose = 0)

df <- data.frame(x = c(168.33, 167.17), y = c(-17.73, -15.53))
rownames(df) <- c("Port_Vila", "Luganville")

# Generate temporal series of wind on the points
TS <- temporalBehaviour(st, points = df, product = "TS", tempRes = 30, verbose = 0)

# Plot temporal series of wind speed
plotTemporal(data=TS, storm="PAM")

# Plot temporal series of wind direction
plotTemporal(data=TS, storm="PAM", var='direction')

Computing wind behaviour and summary statistics over given areas

Description

The spatialBehaviour() function allows computing wind speed and direction for each cell of a regular grid (i.e., a raster) for a given tropical cyclone or set of tropical cyclones. It also allows to compute three associated summary statistics.

Usage

spatialBehaviour(
  sts,
  product = "MSW",
  windThreshold = NULL,
  method = "Willoughby",
  asymmetry = "Chen",
  empiricalRMW = FALSE,
  spaceRes = "2.5min",
  tempRes = 60,
  verbose = 2
)

Arguments

sts

StormsList object

product

character vector. Desired output statistics:

  • "Profiles", for 2D wind speed and direction fields,

  • "MSW", for maximum sustained wind speed (default setting),

  • "PDI", for power dissipation index, or

  • "Exposure", for duration of exposure.

windThreshold

numeric vector. Minimal wind threshold(s) (in m.s1m.s^{-1}) used to compute the duration of exposure when product="Exposure". Default value is to set NULL, in this case, the windthresholds are the one used in the scale defined in the stromsList.

method

character. Model used to compute wind speed and direction. Three different models are implemented:

  • "Willoughby", for the symmetrical model developed by Willoughby et al. (2006) (default setting),

  • "Holland", for the symmetrical model developed by Holland (1980), or

  • "Boose", for the asymmetrical model developed by Boose et al. (2004).

asymmetry

character. If method="Holland" or method="Willoughby", this argument specifies the method used to add asymmetry. Can be:

  • "Chen", for the model developed by Chen (1994) (default setting),

  • "Miyazaki", for the model developed by Miyazaki et al. (1962), or

  • "None", for no asymmetry.

empiricalRMW

logical. Whether (TRUE) or not (FALSE) to compute the radius of maximum wind (rmw) empirically using the model developed by Willoughby et al. (2006). If empiricalRMW==FALSE (default setting) then the rmw provided in the StormsList is used.

spaceRes

character. Spatial resolution. Can be "30 sec" (~1 km at the equator), "2.5 min" (~4.5 km at the equator), "5 min" (~9 km at the equator) or "10 min" (~18.6 km at the equator). Default setting is "2.5 min".

tempRes

numeric. Temporal resolution (min). Can be 60 ( default setting), 30 or 15.

verbose

numeric. Whether or not the function should display informations about the process and/or outputs. Can be:

  • 2, information about the processes and outputs are displayed (default setting),

  • 1, information about the processes are displayed, pr

  • 0, no information displayed.

Details

Storm track data sets, such as those extracted from IBRTrACKS (Knapp et al., 2010), usually provide observation at a 3- or 6-hours temporal resolution. In the spatialBehaviour() function, linear interpolations are used to reach the temporal resolution specified in the tempRes argument (default value = 60 min). When product = "MSW", product = "PDI", or product = "Exposure" the focal() function from the terra R package is used to smooth the results using moving windows.

The Holland (1980) model, widely used in the literature, is based on the 'gradient wind balance in mature tropical cyclones. The wind speed distribution is computed from the circular air pressure field, which can be derived from the central and environmental pressure and the radius of maximum winds.

vr=bρ×(Rmr)b×(pocipc)×e(Rmr)b+(r×f2)2(r×f2)v_r = \sqrt{\frac{b}{\rho} \times \left(\frac{R_m}{r}\right)^b \times (p_{oci} - p_c) \times e^{-\left(\frac{R_m}{r}\right)^b} + \left(\frac{r \times f}{2}\right)^2} - \left(\frac{r \times f}{2}\right)

with,

b=ρ×e×vm2pocipcb = \frac{\rho \times e \times v_m^2}{p_{oci} - p_c}

f=2×7.29×105sin(ϕ)f = 2 \times 7.29 \times 10^{-5} \sin(\phi)

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), bb is the shape parameter, ρ\rho is the air density set to 1.15kg.m31.15 kg.m^{-3}, ee being the base of natural logarithms (~2.718282), vmv_m the maximum sustained wind speed (in m.s1m.s^{-1}), pocip_{oci} is the pressure at outermost closed isobar of the storm (in PaPa), pcp_c is the pressure at the centre of the storm (in PaPa), rr is the distance to the eye of the storm (in kmkm), RmR_m is the radius of maximum sustained wind speed (in kmkm), ff is the Coriolis force (in N.kg1N.kg^{-1}, and ϕ\phi being the latitude).

The Willoughby et al. (2006) model is an empirical model fitted to aircraft observations. The model considers two regions: inside the eye and at external radii, for which the wind formulations use different exponents to better match observations. In this model, the wind speed increases as a power function of the radius inside the eye and decays exponentially outside the eye after a smooth polynomial transition across the eyewall.

{vr=vm×(rRm)nifr<Rmvr=vm×((1A)×erRmX1+A×erRmX2)ifrRm\left\{\begin{aligned} v_r &= v_m \times \left(\frac{r}{R_m}\right)^{n} \quad if \quad r < R_m \\ v_r &= v_m \times \left((1-A) \times e^{-\frac{|r-R_m|}{X1}} + A \times e^{-\frac{|r-R_m|}{X2}}\right) \quad if \quad r \geq R_m \\ \end{aligned} \right.

with,

n=2.1340+0.0077×vm0.4522×ln(Rm)0.0038×ϕn = 2.1340 + 0.0077 \times v_m - 0.4522 \times \ln(R_m) - 0.0038 \times |\phi|

X1=287.61.942×vm+7.799×ln(Rm)+1.819×ϕX1 = 287.6 - 1.942 \times v_m + 7.799 \times \ln(R_m) + 1.819 \times |\phi|

A=0.5913+0.0029×vm0.1361×ln(Rm)0.0042×ϕA = 0.5913 + 0.0029 \times v_m - 0.1361 \times \ln(R_m) - 0.0042 \times |\phi| and A0A\ge0

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), vmv_m is the maximum sustained wind speed (in m.s1m.s^{-1}), rr is the distance to the eye of the storm (in kmkm), RmR_m is the radius of maximum sustained wind speed (in kmkm), ϕ\phi is the latitude of the centre of the storm, X2=25X2 = 25.

Asymmetry can be added to Holland (1980) and Willoughby et al. (2006) wind fields as follows,

V=Vc+C×Vt\vec{V} = \vec{V_c} + C \times \vec{V_t}

where, V\vec{V} is the combined asymmetric wind field, Vc\vec{V_c} is symmetric wind field, Vt\vec{V_t} is the translation speed of the storm, and CC is function of rr, the distance to the eye of the storm (in kmkm).

Two formulations of C proposed by Miyazaki et al. (1962) and Chen (1994) are implemented.

Miyazaki et al. (1962) C=e(r500×π)C = e^{(-\frac{r}{500} \times \pi)}

Chen (1994) C=3×Rm32×r32Rm3+r3+Rm32×r32C = \frac{3 \times R_m^{\frac{3}{2}} \times r^{\frac{3}{2}}}{R_m^3 + r^3 +R_m^{\frac{3}{2}} \times r^{\frac{3}{2}}}

where, RmR_m is the radius of maximum sustained wind speed (in kmkm)

The Boose et al. (2004) model, or “HURRECON” model, is a modification of the Holland (1980) model. In addition to adding asymmetry, this model treats of water and land differently, using different surface friction coefficient for each.

vr=F(vmS×(1sin(T))×vh2)×(Rmr)b×e1(Rmr)bv_r = F\left(v_m - S \times (1 - \sin(T)) \times \frac{v_h}{2} \right) \times \sqrt{\left(\frac{R_m}{r}\right)^b \times e^{1 - \left(\frac{R_m}{r}\right)^b}}

with,

b=ρ×e×vm2pocipcb = \frac{\rho \times e \times v_m^2}{p_{oci} - p_c}

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), FF is a scaling parameter for friction (1.01.0 in water, 0.80.8 in land), vmv_m is the maximum sustained wind speed (in m.s1m.s^{-1}), SS is a scaling parameter for asymmetry (usually set to 11), TT is the oriented angle (clockwise/counter clockwise in Northern/Southern Hemisphere) between the forward trajectory of the storm and a radial line from the eye of the storm to point $r$ vhv_h is the storm velocity (in m.s1m.s^{-1}), RmR_m is the radius of maximum sustained wind speed (in kmkm), rr is the distance to the eye of the storm (in kmkm), bb is the shape parameter, ρ=1.15\rho = 1.15 is the air density (in kg.m3kg.m^{-3}), pocip_{oci} is the pressure at outermost closed isobar of the storm (in PaPa), and pcp_c is the pressure at the centre of the storm (pressurepressure in PaPa).

Value

The spatialBehaviour() function returns SpatRaster objects (in WGS84). The number of layers in the output depends on the number of storms in the inputs, on the desired product, as well as the tempRes argument:

  • if product = "MSW", the function returns one layer for each Storm. The names of the layer follow the following terminology, the name of the storm in capital letters and “MSW” separated by underscores (e.g., "PAM_MSW"),

  • if product = "PDI", the function returns one layer for each Storm. The names of the layer follow the following terminology, the name of the storm in capital letters and “PDI” separated by underscores (e.g., "PAM_PDI"),

  • if product ="Exposure", the function returns one layer for each wind speed values in the windThreshold argument and for each Storm. The names of the layer follow the following terminology, the name of the storm in capital letters, "Exposure", and the threshold value separated by underscores (e.g., "PAM_Exposure_18", "PAM_Exposure_33", ...),

  • if product = "Profiles" the function returns one layer for wind speed and one layer for wind direction for each observation or interpolated observation and each Storm. The names of the layer follow the following terminology, the name of the storm in capital letters, "Speed" or "Direction", and the indices of the observation separated by underscores (e.g., "PAM_Speed_41", "PAM_Direction_41",...).

References

Boose, E. R., Serrano, M. I., & Foster, D. R. (2004). Landscape and regional impacts of hurricanes in Puerto Rico. Ecological Monographs, 74(2), Article 2. https://doi.org/10.1890/02-4057

Chen, K.-M. (1994). A computation method for typhoon wind field. Tropic Oceanology, 13(2), 41–48.

Holland, G. J. (1980). An Analytic Model of the Wind and Pressure Profiles in Hurricanes. Monthly Weather Review, 108(8), 1212–1218. https://doi.org/10.1175/1520-0493(1980)108<1212:AAMOTW>2.0.CO;2

Knapp, K. R., Kruk, M. C., Levinson, D. H., Diamond, H. J., & Neumann, C. J. (2010). The International Best Track Archive for Climate Stewardship (IBTrACS). Bulletin of the American Meteorological Society, 91(3), Article 3. https://doi.org/10.1175/2009bams2755.1

Miyazaki, M., Ueno, T., & Unoki, S. (1962). The theoretical investigations of typhoon surges along the Japanese coast (II). Oceanographical Magazine, 13(2), 103–117.

Willoughby, H. E., Darling, R. W. R., & Rahn, M. E. (2006). Parametric Representation of the Primary Hurricane Vortex. Part II: A New Family of Sectionally Continuous Profiles. Monthly Weather Review, 134(4), 1102–1120. https://doi.org/10.1175/MWR3106.1

Examples

# Creating a stormsDataset
sds <- defStormsDataset()

# Geting storm track data for tropical cyclone Pam (2015) near Vanuatu
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")

# Computing maximum sustained wind speed generated by Pam (2015) near Vanuatu
# using default settings
msw.pam <- spatialBehaviour(pam)

# Computing PDI generated by Pam (2015) near Vanuatu using the Holland model without asymmetry
pdi.pam <- spatialBehaviour(pam, method = "Holland", product = "PDI", asymmetry = "None")

# Computing duration of exposure to Saffir-Simpson hurricane wind scale threshold values
# during Pam (2015) near Vanuatu using default settings
exp.pam <- spatialBehaviour(pam, product = "Exposure")

# Computing wind speed and direction profiles  generated by Pam (2015) near Vanuatu
# using Boose model
prof.pam <- spatialBehaviour(pam, product = "Profiles", method = "Boose")

storm object

Description

Gather all the needed informations to model a single storm

Value

A storm object.

  • name, character.

  • season, numeric.

  • scale, numeric.

  • obs, numeric.

  • obs.all, data.frame.

Slots

name

character. Name of the storm

season

numeric. Cyclonic season in which the storm has occured

scale

numeric. Maximum scale category reached

obs

numeric vector. Indices of observations within the location of interest extented with its corresponding buffer (See stormsList class)

obs.all

data.frame. Contains all of the observations available. An observation is made up of several fields which are:

  • iso.time, Date and hours of observations (UTC)

  • lon, Longitude coordinate (Eastern degree)

  • lat, Latitude coordinate (Northern degree)

  • msw, Maximum Sustained Wind (m/s)

  • scale, Level in the chosen scale

The following field is not mandatory but highly recommended

  • rmw, Radius of Maximum Wind (km)

Also, the following fields are only mandatory to perform Holland and Boose models (See Details)

  • pres, Pressure at the center (pa)

  • poci, Pressure of the Outermost Closed Isobar (pa)


stormsDataset

Description

Choose the database to use within the package's functions

Details

The fields input must provide at least 6 mandatory fields (and at most 10) in order to benefit from all the functionalities of this package:

  • A field names: which dimension contains the names of storms in the netcdf database

  • A field seasons: which dimension contains the cyclonic seasons of storms in the netcdf database

  • A field isoTime: which dimension contains the ISO times of each (3 or 6 hourly) observations for all storms in the database

  • A field lon: which dimension contains the longitude coordinates of each observations for all storms in the netcdf database

  • A field lat: which dimension contains the latitude coordinates of each observations for all storms in the netcdf database

  • A field msw: which dimension contains the maximum sustained wind speed of each observations for all storms in the netcdf database

The following fields are optional but highly recommended:

  • A field basin: which dimension contains the basin location of storms in the netcdf database. Used to filter the storms in the netcdf database

  • A field rmw: which dimension contains the radius of maximum wind speed of each observations for all storms in the netcdf database (See spatialBehaviour, temporalBehaviour)

Finally these following fields are optional but mandatory to perform Holland model (See spatialBehaviour, temporalBehaviour)

  • A field pressure: which dimension contains the pressure in the eye for of each observations for all storms in the netcdf database

  • A field poci: which dimension contains the Pressure at the Outermost Closed Isobar for of each observations for all storms in the nectdf database

Default value is set according to the most relevant dimensions of IBTrACS databases: fields = c(basin = "basin", names = "name", seasons = "season", isoTime = "iso_time", lon = "usa_lon", lat = "usa_lat", msw = "usa_wind", rmw = "usa_rmw", pressure = "usa_pres", poci = "usa_poci")

Slots

filename

character. Name of the database to load. Must be either a netcdf or a csv file

fields

named character vector. Dictionary that provides all the name of dimensions to extract from the netcdf database (See Details)

basin

character. Basin name to filter the database within its boundaries. It must be either

  • "NA": North Atlantic

  • "SA": South Atlantic

  • "EP": Eastern North Pacific

  • "WP": Western North Pacific

  • "SP": South Pacific

  • "SI": South India

  • "NI": North India

  • "None": No particular basin

seasons

numeric vector. Range of calendar years to filter storms. For cyclones that formed in one year and dissipated in the following year, the latter should be used

database

list of 6 to 9 slots depending on the fields input. Each slot is either a 1D array of dimension (number of storms) for names and seasons fields, or a 2D array of dimension (Maximum number of observations:number of storms), for the remaining fields which are isoTime, lon, lat, msw, rmw, pressure, poci


stormsList object

Description

Gather all the needed informations to model a set of storms

Value

A stormsList object.

  • data, list.

  • buffer, numeric.

  • spatialLoi, sf.

  • spatialLoiBuffer, sf.

Slots

data

A list of storm (See storm class)

buffer

numeric. Buffer used to extent spatialLoi (km)

spatialLoi

sf object. Represents the location of interest. Projection is EPSG:4326

spatialLoiBuffer

sf object. Buffer extension of spatialLoi

scale

numeric. List of storm scale thresholds to use in all functions of the package. Default value is set to the Saffir Simpson Hurricane Scale

scalePalette

character. Named vector containing the color hex code corresponding to each category in scale slot. Default value is the palette associated with the Saffir Simpson Hurricane Scale


Computing wind behaviour time series and summary statistics at given point locations

Description

The temporalBehaviour() function allows computing wind speed and direction for a given location or set of locations along the lifespan of a tropical cyclone. It also allows to compute three associated summary statistics.

Usage

temporalBehaviour(
  sts,
  points,
  product = "TS",
  windThreshold = NULL,
  method = "Willoughby",
  asymmetry = "Chen",
  empiricalRMW = FALSE,
  tempRes = 60,
  verbose = 1
)

Arguments

sts

StormsList object.

points

data.frame. Consisting of two columns names as "x" (for the longitude) and "y" (for the latitude), providing the coordinates in decimal degrees of the point locations. Row names can also be provided to named the locations.

product

character. Desired output statistics:

  • "TS", for time series of wind speeds and directions (default setting),

  • "PDI", for power dissipation index, or

  • "Exposure", for the duration of exposure to defined wind thresholds.

windThreshold

numeric vector. Minimal wind threshold(s) (in m.s1m.s^{-1}) used to compute the duration of exposure when product="Exposure". Default value is to set NULL, in this case, the windthresholds are the one used in the scale defined in the stromsList.

method

character. Model used to compute wind speed and direction. Three different models are implemented:

  • "Willoughby", for the symmetrical model developed by Willoughby et al. (2006) (default setting),

  • "Holland", for the symmetrical model developed by Holland (1980), or

  • "Boose", for the asymmetrical model developed by Boose et al. (2004).

asymmetry

character. If method="Holland" or method="Willoughby", this argument specifies the method used to add asymmetry. Can be:

  • "Chen", for the model developed by Chen (1994) (default setting),

  • "Miyazaki", for the model developed by Miyazaki et al. (1962), or

  • "None", for no asymmetry.

empiricalRMW

logical. Whether (TRUE) or not (FALSE) to compute the radius of maximum wind (rmw) empirically using the model developed by Willoughby et al. (2006). If empiricalRMW==FALSE (default setting) then the rmw provided in the StormsList is used.

tempRes

numeric. Temporal resolution (min). Can be 60 (default setting), 30 or 15.

verbose

numeric. Information displayed. Can be:

  • 2, information about the processes and outputs are displayed (default setting),

  • 1, information about the processes are displayed, or

  • 0, no information displayed.

Details

Storm track data sets, such as those extracted from IBRTrACKS (Knapp et al., 2010), usually provide observation at a 3- or 6-hours temporal resolution. In the temporalBehaviour() function, linear interpolations are used to reach the temporal resolution specified in the tempRes argument (default value = 60 min).

The Holland (1980) model, widely used in the literature, is based on the 'gradient wind balance in mature tropical cyclones. The wind speed distribution is computed from the circular air pressure field, which can be derived from the central and environmental pressure and the radius of maximum winds.

vr=bρ×(Rmr)b×(pocipc)×e(Rmr)b+(r×f2)2(r×f2)v_r = \sqrt{\frac{b}{\rho} \times \left(\frac{R_m}{r}\right)^b \times (p_{oci} - p_c) \times e^{-\left(\frac{R_m}{r}\right)^b} + \left(\frac{r \times f}{2}\right)^2} - \left(\frac{r \times f}{2}\right)

with,

b=ρ×e×vm2pocipcb = \frac{\rho \times e \times v_m^2}{p_{oci} - p_c}

f=2×7.29×105sin(ϕ)f = 2 \times 7.29 \times 10^{-5} \sin(\phi)

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), bb is the shape parameter, ρ\rho is the air density set to 1.15kg.m31.15 kg.m^{-3}, ee being the base of natural logarithms (~2.718282), vmv_m the maximum sustained wind speed (in m.s1m.s^{-1}), pocip_{oci} is the pressure at outermost closed isobar of the storm (in PaPa), pcp_c is the pressure at the centre of the storm (in PaPa), rr is the distance to the eye of the storm (in kmkm), RmR_m is the radius of maximum sustained wind speed (in kmkm), ff is the Coriolis force (in N.kg1N.kg^{-1}, and ϕ\phi being the latitude).

The Willoughby et al. (2006) model is an empirical model fitted to aircraft observations. The model considers two regions: inside the eye and at external radii, for which the wind formulations use different exponents to better match observations. In this model, the wind speed increases as a power function of the radius inside the eye and decays exponentially outside the eye after a smooth polynomial transition across the eyewall.

{vr=vm×(rRm)nifr<Rmvr=vm×((1A)×erRmX1+A×erRmX2)ifrRm\left\{\begin{aligned} v_r &= v_m \times \left(\frac{r}{R_m}\right)^{n} \quad if \quad r < R_m \\ v_r &= v_m \times \left((1-A) \times e^{-\frac{|r-R_m|}{X1}} + A \times e^{-\frac{|r-R_m|}{X2}}\right) \quad if \quad r \geq R_m \\ \end{aligned} \right.

with,

n=2.1340+0.0077×vm0.4522×ln(Rm)0.0038×ϕn = 2.1340 + 0.0077 \times v_m - 0.4522 \times \ln(R_m) - 0.0038 \times |\phi|

X1=287.61.942×vm+7.799×ln(Rm)+1.819×ϕX1 = 287.6 - 1.942 \times v_m + 7.799 \times \ln(R_m) + 1.819 \times |\phi|

A=0.5913+0.0029×vm0.1361×ln(Rm)0.0042×ϕA = 0.5913 + 0.0029 \times v_m - 0.1361 \times \ln(R_m) - 0.0042 \times |\phi| and A0A\ge0

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), vmv_m is the maximum sustained wind speed (in m.s1m.s^{-1}), rr is the distance to the eye of the storm (in kmkm), RmR_m is the radius of maximum sustained wind speed (in kmkm), ϕ\phi is the latitude of the centre of the storm, X2=25X2 = 25.

Asymmetry can be added to Holland (1980) and Willoughby et al. (2006) wind fields as follows,

V=Vc+C×Vt\vec{V} = \vec{V_c} + C \times \vec{V_t}

where, V\vec{V} is the combined asymmetric wind field, Vc\vec{V_c} is symmetric wind field, Vt\vec{V_t} is the translation speed of the storm, and CC is function of rr, the distance to the eye of the storm (in kmkm).

Two formulations of C proposed by Miyazaki et al. (1962) and Chen (1994) are implemented.

Miyazaki et al. (1962) C=e(r500×π)C = e^{(-\frac{r}{500} \times \pi)}

Chen (1994) C=3×Rm32×r32Rm3+r3+Rm32×r32C = \frac{3 \times R_m^{\frac{3}{2}} \times r^{\frac{3}{2}}}{R_m^3 + r^3 +R_m^{\frac{3}{2}} \times r^{\frac{3}{2}}}

where, RmR_m is the radius of maximum sustained wind speed (in kmkm)

The Boose et al. (2004) model, or “HURRECON” model, is a modification of the Holland (1980) model. In addition to adding asymmetry, this model treats of water and land differently, using different surface friction coefficient for each.

vr=F(vmS×(1sin(T))×vh2)×(Rmr)b×e1(Rmr)bv_r = F\left(v_m - S \times (1 - \sin(T)) \times \frac{v_h}{2} \right) \times \sqrt{\left(\frac{R_m}{r}\right)^b \times e^{1 - \left(\frac{R_m}{r}\right)^b}}

with,

b=ρ×e×vm2pocipcb = \frac{\rho \times e \times v_m^2}{p_{oci} - p_c}

where, vrv_r is the tangential wind speed (in m.s1m.s^{-1}), FF is a scaling parameter for friction (1.01.0 in water, 0.80.8 in land), vmv_m is the maximum sustained wind speed (in m.s1m.s^{-1}), SS is a scaling parameter for asymmetry (usually set to 11), TT is the oriented angle (clockwise/counter clockwise in Northern/Southern Hemisphere) between the forward trajectory of the storm and a radial line from the eye of the storm to point $r$ vhv_h is the storm velocity (in m.s1m.s^{-1}), RmR_m is the radius of maximum sustained wind speed (in kmkm), rr is the distance to the eye of the storm (in kmkm), bb is the shape parameter, ρ=1.15\rho = 1.15 is the air density (in kg.m3kg.m^{-3}), pocip_{oci} is the pressure at outermost closed isobar of the storm (in PaPa), and pcp_c is the pressure at the centre of the storm (pressurepressure in PaPa).

Value

For each storm and each point location, the temporalBehaviour() function returns a data.frame. The data frames are organised into named lists. Depending on the product argument different data.frame are returned:

  • if product == "TS", the function returns a data.frame with one row for each observation (or interpolated observation) and four columns for wind speed (in m.s1m.s^{-1}), wind direction (in degree), the observation number, and the ISO time of observations,

  • if product == "PDI", the function returns a data.frame with one row for each point location and one column for the PDI,

  • if product == "Exposure", the function returns a data.frame with one row for the duration of exposure to winds above each wind speed threshold defined by the windThreshold argument and one column for each point location.

References

Boose, E. R., Serrano, M. I., & Foster, D. R. (2004). Landscape and regional impacts of hurricanes in Puerto Rico. Ecological Monographs, 74(2), Article 2. https://doi.org/10.1890/02-4057

Chen, K.-M. (1994). A computation method for typhoon wind field. Tropic Oceanology, 13(2), 41–48.

Holland, G. J. (1980). An Analytic Model of the Wind and Pressure Profiles in Hurricanes. Monthly Weather Review, 108(8), 1212–1218. https://doi.org/10.1175/1520-0493(1980)108<1212:AAMOTW>2.0.CO;2

Knapp, K. R., Kruk, M. C., Levinson, D. H., Diamond, H. J., & Neumann, C. J. (2010). The International Best Track Archive for Climate Stewardship (IBTrACS). Bulletin of the American Meteorological Society, 91(3), Article 3. https://doi.org/10.1175/2009bams2755.1

Miyazaki, M., Ueno, T., & Unoki, S. (1962). The theoretical investigations of typhoon surges along the Japanese coast (II). Oceanographical Magazine, 13(2), 103–117.

Willoughby, H. E., Darling, R. W. R., & Rahn, M. E. (2006). Parametric Representation of the Primary Hurricane Vortex. Part II: A New Family of Sectionally Continuous Profiles. Monthly Weather Review, 134(4), 1102–1120. https://doi.org/10.1175/MWR3106.1

Examples

# Creating a stormsDataset
sds <- defStormsDataset()

# Geting storm track data for tropical cyclone Pam (2015) near Vanuatu
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")

pts <- data.frame(x = c(168.5, 168), y = c(-17.9, -16.3))
row.names(pts) <- c("point_1", "point_2")

# Computing time series of wind speed and direction for Pam
# over points 1 and 2 defined above
ts.pam <- temporalBehaviour(pam, points = pts)

# Computing PDI for Pam over points 1 and 2 defined above
pdi.pam <- temporalBehaviour(pam, points = pts, product = "PDI")

# Computing the duration of exposure to wind speeds above the thresholds
# used by the Saffir-Simpson hurricane wind scale for Pam
# over points 1 and 2 defined above
exp.pam <- temporalBehaviour(pam, points = pts, product = "Exposure")

Exporting rasters to GeoTIFF or NetCDF files

Description

The writeRast() function exports rasters stored in SpatRaster objects to GeoTIFF or NetCDF files.

Usage

writeRast(rast, filename = NULL, path = "./", ...)

Arguments

rast

SpatRaster object.

filename

character. Output file name. Can be either a ".tiff" file (GeoTIFF) or ".nc" (NetCDF). By default filename=NULL and the name of the file is generated based on raster information (storms and products) with the '.tiff' extension.

path

character. Path to the directory where the file is exported to. By default ⁠path=./'⁠.

...

Additional arguments to be passed to terra::writeRaster function when saving to ".tiff" format.

Value

NULL

Examples

# Creating a stormsDataset

sds <- defStormsDataset()

# Getting storm track data for tropical cyclone Pam (2015) near Vanuatu
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")

# Computing maximum sustained wind speed
pam.msw <- spatialBehaviour(pam)

# Exporting maximum sustained wind speed raster layer to a GeoTIFF file
writeRast(pam.msw, path = paste0(tempdir(), "/"))

# Computing power dissipation index for several storms near New Caledonia
sts.nc <- defStormsList(sds = sds, loi = "New Caledonia")
pdi.nc <- spatialBehaviour(sts.nc, product = "PDI")

# Exporting the power dissipation index raster layers to a NetCDF file
writeRast(pdi.nc, path = paste0(tempdir(), "/"))