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-10-23 06:49:33 UTC |
Source: | CRAN |
stormsDataset
objectThe 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.
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 )
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 )
filename |
character. Name of the NetCDF (.nc)/CSV (.csv) file. Default is the |
sep |
character. The field separator character if |
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
|
basin |
character. If the basin field is provided, then storm track data will
only be extracted for the named basin. By default
|
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. For
For
For
|
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 ( |
The defStormsDataset()
function returns a stormsDataset
object.
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
# 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 `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)
stormsList
objectThe 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.
defStormsList( sds, loi, seasons = c(sds@seasons["min"], sds@seasons["max"]), names = NULL, maxDist = 300, scale = sshs, scalePalette = NULL, removeUnder = NULL, verbose = 2 )
defStormsList( sds, loi, seasons = c(sds@seasons["min"], sds@seasons["max"]), names = NULL, maxDist = 300, scale = sshs, scalePalette = NULL, removeUnder = NULL, verbose = 2 )
sds |
|
loi |
Location of interest. Can be defined using,
|
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 |
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 |
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 |
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:
|
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/.
The defStormsList()
function returns a stormsList
object containing track data for all storms
meeting the specified criteria (e.g., name, season, location).
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
#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)
#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)
Provide the geographic limits of the eez of New Caledonia
eezNC
eezNC
eezNC
a sf object
The getBuffer()
function returns the buffered location
of interest from a stormsList
object.
getBuffer(sts) ## S4 method for signature 'stormsList' getBuffer(sts)
getBuffer(sts) ## S4 method for signature 'stormsList' getBuffer(sts)
sts |
|
A sf
object.
#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)
#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)
The getBufferSize()
returns the buffer size used to generate
the buffered location of interest for a stormsList
object.
getBufferSize(sts) ## S4 method for signature 'stormsList' getBufferSize(sts)
getBufferSize(sts) ## S4 method for signature 'stormsList' getBufferSize(sts)
sts |
|
numeric.
#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)
#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)
The getInObs()
function returns the number of the
observations in a given storm
or stormsList
object.
getInObs(s, ...) ## S4 method for signature 'stormsList' getInObs(s, name, season = NULL) ## S4 method for signature 'storm' getInObs(s)
getInObs(s, ...) ## S4 method for signature 'stormsList' getInObs(s, name, season = NULL) ## S4 method for signature 'storm' getInObs(s)
s |
|
... |
extra argument for |
name |
character. Name of the storm in capital letters. |
season |
numeric. Cyclonic season of the |
Numeric vector.
#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")
#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")
The getLOI()
functions returns the location of interest for the given stormsList
.
getLOI(sts) ## S4 method for signature 'stormsList' getLOI(sts)
getLOI(sts) ## S4 method for signature 'stormsList' getLOI(sts)
sts |
|
sf object.
#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)
#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)
The getNames()
function returns the names of the storms
in a storm
or a stormsList
object.
getNames(s) ## S4 method for signature 'storm' getNames(s) ## S4 method for signature 'stormsList' getNames(s)
getNames(s) ## S4 method for signature 'storm' getNames(s) ## S4 method for signature 'stormsList' getNames(s)
s |
|
character vector.
#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)
#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)
The getNbObs() function returns the number of observations
for a storm in a storm
or stormsList
object.
getNbObs(s, ...) ## S4 method for signature 'storm' getNbObs(s) ## S4 method for signature 'stormsList' getNbObs(s, name, season = NULL)
getNbObs(s, ...) ## S4 method for signature 'storm' getNbObs(s) ## S4 method for signature 'stormsList' getNbObs(s, name, season = NULL)
s |
|
... |
extra arguments for |
name |
character. Name of the storm in capital letters. |
season |
numeric. Cyclonic season of the |
numeric.
#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")
#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")
storm
The getNbStorms()
returns the number of storm
objects
in the given stormsList
object.
getNbStorms(sts) ## S4 method for signature 'stormsList' getNbStorms(sts)
getNbStorms(sts) ## S4 method for signature 'stormsList' getNbStorms(sts)
sts |
|
numeric, the number of storm
objects.
#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)
#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)
The getObs()
function returns observed track data for a storm
in a storm
or stormsList
object.
getObs(s, ...) ## S4 method for signature 'stormsList' getObs(s, name, season = NULL) ## S4 method for signature 'storm' getObs(s)
getObs(s, ...) ## S4 method for signature 'stormsList' getObs(s, name, season = NULL) ## S4 method for signature 'storm' getObs(s)
s |
|
... |
extra argument for |
name |
character. Name of the storm in capital letters. |
season |
numeric. Cyclonic season of the |
A data.frame.
#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")
#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")
The getScale()
function return the maximum wind scale category reached by
each storm in the storm
or stormsList
object.
getScale(s) ## S4 method for signature 'storm' getScale(s) ## S4 method for signature 'stormsList' getScale(s)
getScale(s) ## S4 method for signature 'storm' getScale(s) ## S4 method for signature 'stormsList' getScale(s)
s |
|
numeric vector.
#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)
#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)
The getSeasons()
function returns the cyclonic season
of each storm in a storm
or stormsList
object.
getSeasons(s) ## S4 method for signature 'storm' getSeasons(s) ## S4 method for signature 'stormsList' getSeasons(s)
getSeasons(s) ## S4 method for signature 'storm' getSeasons(s) ## S4 method for signature 'stormsList' getSeasons(s)
s |
|
numeric vector.
#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)
#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)
storm
The getStorm()
function extracts a specific storm
object
from a stormsList
object.
getStorm(sts, name, season = NULL) ## S4 method for signature 'stormsList' getStorm(sts, name, season = NULL)
getStorm(sts, name, season = NULL) ## S4 method for signature 'stormsList' getStorm(sts, name, season = NULL)
sts |
|
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. |
A storm
object.
#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")
#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")
The plotBehaviour()
function allows plotting spatial statistics generated using
the spatialBehaviour()
function and stored in SpatRaster
objects.
plotBehaviour( sts, rasterProduct, colorPalette = NULL, main = NULL, xlim = NULL, ylim = NULL, labels = FALSE, by = 8, pos = 3, legends = "topright", dynamicPlot = FALSE )
plotBehaviour( sts, rasterProduct, colorPalette = NULL, main = NULL, xlim = NULL, ylim = NULL, labels = FALSE, by = 8, pos = 3, legends = "topright", dynamicPlot = FALSE )
sts |
|
rasterProduct |
layer name in a
|
colorPalette |
character vector. The color palette used to plot the raster layer.
If |
main |
character. Title of the plot. If |
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 |
pos |
numeric. If |
legends |
character. Indicates where to plot the legend, |
dynamicPlot |
logical. Whether (FALSE, default setting) or (TRUE) to plot the data dynamicaly using leaflet library |
A plot of the storm track data with the raster layer.
# 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)
# 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)
This plotStorms()
function allows plotting storm track data stored in a StormsList
object.
plotStorms( sts, names = NULL, category = NULL, xlim = NULL, ylim = NULL, labels = FALSE, by = 8, pos = 3, legends = "topright", loi = TRUE, dynamicPlot = FALSE )
plotStorms( sts, names = NULL, category = NULL, xlim = NULL, ylim = NULL, labels = FALSE, by = 8, pos = 3, legends = "topright", loi = TRUE, dynamicPlot = FALSE )
sts |
|
names |
character vector. Name(s) of the storm(s) in capital letters.
If |
category |
numeric vector. Category of storms to be plotted among the level in
the windscale provided in |
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 |
pos |
numeric. If |
legends |
character. Indicates where to plot the legend, |
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 |
A plot of the storm track data.
#' #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
#' #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
plotTemporal(data, storm, var = "speed")
plotTemporal(data, storm, var = "speed")
data |
time series generated with |
storm |
list of characters. Storm names. The storm must be available in
|
var |
character. Represent the type of variable to plot. Must be either
|
null
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')
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')
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.
spatialBehaviour( sts, product = "MSW", windThreshold = NULL, method = "Willoughby", asymmetry = "Chen", empiricalRMW = FALSE, spaceRes = "2.5min", tempRes = 60, verbose = 2 )
spatialBehaviour( sts, product = "MSW", windThreshold = NULL, method = "Willoughby", asymmetry = "Chen", empiricalRMW = FALSE, spaceRes = "2.5min", tempRes = 60, verbose = 2 )
sts |
|
product |
character vector. Desired output statistics:
|
windThreshold |
numeric vector. Minimal wind threshold(s) (in |
method |
character. Model used to compute wind speed and direction. Three different models are implemented:
|
asymmetry |
character. If
|
empiricalRMW |
logical. Whether (TRUE) or not (FALSE) to compute
the radius of maximum wind ( |
spaceRes |
character. Spatial resolution. Can be |
tempRes |
numeric. Temporal resolution (min). Can be |
verbose |
numeric. Whether or not the function should display informations about the process and/or outputs. Can be:
|
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.
with,
where, is the tangential wind speed (in
),
is the shape parameter,
is the air density set to
,
being the base of natural logarithms (~2.718282),
the maximum sustained wind speed (in
),
is the pressure at outermost closed isobar of the storm (in
),
is the pressure at the centre of the storm (in
),
is the distance to the eye of the storm (in
),
is the radius of maximum sustained wind speed (in
),
is the Coriolis force (in
, and
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.
with,
and
where, is the tangential wind speed (in
),
is the maximum sustained wind speed (in
),
is the distance to the eye of the storm (in
),
is the radius of maximum sustained wind speed (in
),
is the latitude of the centre of the storm,
.
Asymmetry can be added to Holland (1980) and Willoughby et al. (2006) wind fields as follows,
where, is the combined asymmetric wind field,
is symmetric wind field,
is the translation speed of the storm, and
is function of
, the distance to the eye of the storm (in
).
Two formulations of C proposed by Miyazaki et al. (1962) and Chen (1994) are implemented.
Miyazaki et al. (1962)
Chen (1994)
where, is the radius of maximum sustained wind speed (in
)
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.
with,
where, is the tangential wind speed (in
),
is a scaling parameter for friction (
in water,
in land),
is the maximum sustained wind speed (in
),
is a scaling parameter for asymmetry (usually set to
),
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$
is the storm velocity (in
),
is the radius of maximum sustained wind speed (in
),
is the distance to the eye of the storm (in
),
is the shape parameter,
is the air density (in
),
is the pressure at outermost closed isobar of the storm (in
), and
is the pressure at the centre of the storm (
in
).
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",...).
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
# 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")
# 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
objectGather all the needed informations to model a single storm
A storm
object.
name
, character.
season
, numeric.
scale
, numeric.
obs
, numeric.
obs.all
, data.frame.
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)
Choose the database to use within the package's functions
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")
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
objectGather all the needed informations to model a set of storms
A stormsList
object.
data
, list.
buffer
, numeric.
spatialLoi
, sf.
spatialLoiBuffer
, sf.
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
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.
temporalBehaviour( sts, points, product = "TS", windThreshold = NULL, method = "Willoughby", asymmetry = "Chen", empiricalRMW = FALSE, tempRes = 60, verbose = 1 )
temporalBehaviour( sts, points, product = "TS", windThreshold = NULL, method = "Willoughby", asymmetry = "Chen", empiricalRMW = FALSE, tempRes = 60, verbose = 1 )
sts |
|
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:
|
windThreshold |
numeric vector. Minimal wind threshold(s) (in |
method |
character. Model used to compute wind speed and direction. Three different models are implemented:
|
asymmetry |
character. If
|
empiricalRMW |
logical. Whether (TRUE) or not (FALSE) to compute
the radius of maximum wind ( |
tempRes |
numeric. Temporal resolution (min). Can be |
verbose |
numeric. Information displayed. Can be:
|
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.
with,
where, is the tangential wind speed (in
),
is the shape parameter,
is the air density set to
,
being the base of natural logarithms (~2.718282),
the maximum sustained wind speed (in
),
is the pressure at outermost closed isobar of the storm (in
),
is the pressure at the centre of the storm (in
),
is the distance to the eye of the storm (in
),
is the radius of maximum sustained wind speed (in
),
is the Coriolis force (in
, and
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.
with,
and
where, is the tangential wind speed (in
),
is the maximum sustained wind speed (in
),
is the distance to the eye of the storm (in
),
is the radius of maximum sustained wind speed (in
),
is the latitude of the centre of the storm,
.
Asymmetry can be added to Holland (1980) and Willoughby et al. (2006) wind fields as follows,
where, is the combined asymmetric wind field,
is symmetric wind field,
is the translation speed of the storm, and
is function of
, the distance to the eye of the storm (in
).
Two formulations of C proposed by Miyazaki et al. (1962) and Chen (1994) are implemented.
Miyazaki et al. (1962)
Chen (1994)
where, is the radius of maximum sustained wind speed (in
)
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.
with,
where, is the tangential wind speed (in
),
is a scaling parameter for friction (
in water,
in land),
is the maximum sustained wind speed (in
),
is a scaling parameter for asymmetry (usually set to
),
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$
is the storm velocity (in
),
is the radius of maximum sustained wind speed (in
),
is the distance to the eye of the storm (in
),
is the shape parameter,
is the air density (in
),
is the pressure at outermost closed isobar of the storm (in
), and
is the pressure at the centre of the storm (
in
).
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 ), 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.
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
# 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")
# 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")
The writeRast()
function exports rasters stored in SpatRaster objects to
GeoTIFF or NetCDF files.
writeRast(rast, filename = NULL, path = "./", ...)
writeRast(rast, filename = NULL, path = "./", ...)
rast |
|
filename |
character. Output file name. Can be either a |
path |
character. Path to the directory where the file is exported to. By default |
... |
Additional arguments to be passed to
|
NULL
# 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(), "/"))
# 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(), "/"))