Package 'HurreconR'

Title: Models Hurricane Wind Speed, Wind Direction, and Wind Damage
Description: The HURRECON model estimates wind speed, wind direction, enhanced Fujita scale wind damage, and duration of EF0 to EF5 winds as a function of hurricane location and maximum sustained wind speed. Results may be generated for a single site or an entire region. Hurricane track and intensity data may be imported directly from the US National Hurricane Center's HURDAT2 database. For details on the original version of the model written in Borland Pascal, see: Boose, Chamberlin, and Foster (2001) <doi:10.1890/0012-9615(2001)071[0027:LARIOH]2.0.CO;2> and Boose, Serrano, and Foster (2004) <doi:10.1890/02-4057>.
Authors: Emery Boose [aut, cre], President and Fellows of Harvard College [cph]
Maintainer: Emery Boose <[email protected]>
License: GPL-3
Version: 1.1
Built: 2024-11-12 05:26:52 UTC
Source: https://github.com/hurrecon-model/hurreconr

Help Index


Modeling Functions

Description

hurrecon_model_site calculates wind speed (meters/second), gust speed (meters/second), wind direction (degrees), and enhanced Fujita scale wind damage for a given hurricane and site. If width is TRUE, the radius of maximum wind (rmw) and scaling parameter (s_par) for this hurricane are used; otherwise values for ALL are used. If save is TRUE, results are saved to a CSV file on the site subdirectory.

hurrecon_model_site_all creates a table of peak values for all hurricanes for a given site. If width is TRUE, the radius of maximum wind (rmw) and scaling parameter (s_par) specified for each hurricane is used; otherwise values for ALL are used. If save is TRUE, results are saved to a CSV file on the site-all subdirectory.

hurrecon_model_region calculates peak wind speed (meters/second), peak enhanced Fujita scale, peak wind direction (degrees), peak cardinal wind direction, and duration of EF0, EF1, EF2, EF3, EF4, and EF5 winds (minutes) for a given hurricane over a region. If width is TRUE, the radius of maximum wind (rmw) and scaling parameter (s_par) specified for each hurricane is used; otherwise values for ALL are used. If time_step is NULL, the time step is calculated. If water is FALSE, results are calculated for land areas only. If save is TRUE, results are saved as a GeoTiff file on the region subdirectory.

hurrecon_model_region_dt calculates wind speed (meters/second), enhanced Fujita scale, wind direction (degrees), and cardinal wind direction for a given hurricane over a region at a specified datetime. If width is TRUE, the radius of maximum wind (rmw) and scaling parameter (s_par) specified for the hurricane are used; otherwise values for ALL are used. If water is FALSE, results are calculated for land areas only. If save is TRUE, results are saved as a GeoTiff file on the region-dt subdirectory.

hurrecon_model_region_all runs hurrecon_model_region for each hurricane and calculates the maximum Fujita value and the number of hurricanes for each Fujita value (EF0-EF5) across a region. If width is TRUE, the radius of maximum wind (rmw) and scaling parameter (s_par) specified for each hurricane is used; otherwise values for ALL are used. If time_step is NULL, the time step is calculated. If water is FALSE, results are calculated for land areas only. If save is TRUE, intermediate results for each hurricane are saved as GeoTiff files on the region-all subdirectory, along with summary results for all hurricanes (summary.csv, summary.tif). If save is FALSE, intermediate results are saved to the R session temporary directory.

Usage

hurrecon_model_site(
  hur_id,
  site_name,
  width = FALSE,
  time_step = 1,
  msg = TRUE,
  save = TRUE,
  hur_path = NULL
)

hurrecon_model_site_all(
  site_name,
  width = FALSE,
  time_step = 1,
  save = TRUE,
  hur_path = NULL
)

hurrecon_model_region(
  hur_id,
  width = FALSE,
  time_step = NULL,
  water = FALSE,
  msg = TRUE,
  save = TRUE,
  hur_path = NULL
)

hurrecon_model_region_dt(
  hur_id,
  dt,
  width = FALSE,
  water = FALSE,
  save = TRUE,
  hur_path = NULL
)

hurrecon_model_region_all(
  width = FALSE,
  time_step = NULL,
  water = FALSE,
  save = TRUE,
  hur_path = NULL
)

Arguments

hur_id

hurricane id

site_name

name of site

width

whether to use width parameters for the specified hurricane

time_step

time step (minutes)

msg

whether to use message to display progress

save

whether to save results to file

hur_path

path for current set of model runs

water

whether to calculate results over water

dt

datetime in the format YYYY-MM-DDThh:mm

Value

a data frame of results

a data frame of results

a raster with 10 layers

a raster of 4 layers

a list containing a data frame and a raster of summary values

Examples

hur_path <- system.file("", package="HurreconR", mustWork=TRUE)
hurrecon_model_site(hur_id="AL1935-03", site_name="Miami FL", time_step=60, 
msg=FALSE, save=FALSE, hur_path=hur_path)

Plotting Functions

Description

hurrecon_plot_site creates a time-series plot (wind speed, gust speed, or wind direction as a function of datetime) or a scatter plot (wind speed or gust speed as a function of wind direction) for a given hurricane and site. Optional start and end datetimes may be specified. X-variables: datetime or wind_direction. Y-variables: wind_speed, gust_speed, or wind_direction.

hurrecon_plot_site_all creates a time-series plot of peak values for all hurricanes for a given site. Optional start and end years may be specified. Variables to plot: wind_speed, gust_speed, or wind_direction.

hurrecon_plot_tracks creates a regional plot of the land-water file and selected hurricane tracks.

hurrecon_plot_region creates regional plots of peak wind speed, peak enhanced Fujita scale, peak wind direction, peak cardinal wind direction, and duration of EF0, EF1, EF2, EF3, EF4, and EF5 winds for a given hurricane. Variables to plot: wind_speed, fujita_scale, wind_direction, wind_compass, ef0, ef1, ef2, ef3, ef4, and ef5.

hurrecon_plot_region_dt creates regional plots of enhanced Fujita scale, wind speed, wind direction, and cardinal wind direction for a given hurricane at a specified datetime. Variables to plot: wind_speed, fujita_scale, wind_direction, or wind_compass.

hurrecon_plot_region_all creates regional plots of maximum enhanced Fujita value and number of storms for each enhanced Fujita value for all hurricanes. Variables to plot: efmax, ef0, ef1, ef2, ef3, ef4, or ef5.

Usage

hurrecon_plot_site(
  hur_id,
  site_name,
  start_datetime = "",
  end_datetime = "",
  xvar = "datetime",
  yvar = "wind_speed",
  adjust = FALSE,
  legend_loc = "topright",
  title = "",
  hur_path = NULL
)

hurrecon_plot_site_all(
  site_name,
  start_year = "",
  end_year = "",
  var = "wind_speed",
  legend_loc = "topright",
  title = "",
  hur_path = NULL
)

hurrecon_plot_tracks(
  select = "all",
  wind_min = 33,
  title = "",
  colormap = "default",
  hur_path = NULL
)

hurrecon_plot_region(
  hur_id,
  var = "fujita_scale",
  subdir = "region",
  positions = FALSE,
  title = "",
  colormap = "default",
  hur_path = NULL
)

hurrecon_plot_region_dt(
  hur_id,
  dt,
  var = "fujita_scale",
  positions = FALSE,
  title = "",
  colormap = "default",
  hur_path = NULL
)

hurrecon_plot_region_all(
  var = "efmax",
  tracks = FALSE,
  title = "",
  colormap = "default",
  hur_path = NULL
)

Arguments

hur_id

hurricane id

site_name

name of site

start_datetime

optional start datetime (YYYY-MM-DD hh:mm)

end_datetime

optional end datetime (YYYY-MM-DD hh:mm)

xvar

dependent variable

yvar

independent variable

adjust

whether to subtract 360 degrees from wind directions greater than 180 degrees in scatter plot

legend_loc

legend location

title

optional title

hur_path

path for current set of model runs

start_year

optional start year

end_year

optional end year

var

variable to plot

select

show all positions (all), only positions used as model input (model), or none (none)

wind_min

the minimum value of maximum sustained wind speed (meters/second)

colormap

color palette

subdir

whether to plot results from hurrecon_model_region (region) or hurrecon_model_region_all (region-all)

positions

whether to plot original positions

dt

datetime in the format YYYY-MM-DDThh:mm

tracks

whether to also plot hurricane tracks

Value

no return value

no return value

no return value

no return value

no return value

no return value


Utility Functions

Description

hurrecon_set_path sets the path for the current set of model runs.

hurrecon_get_path returns the current path for a set of model runs.

hurrecon_create_land_water creates a land-water raster file in GeoTiff format from boundary files in shapefile format. The land-water file (land_water.tif) is assumed to be aligned with lines of latitude and longitude. Boundary files are assumed to be named boundary.* on the vector subdirectory. This function requires a reclasification file (reclassify.csv) on the vector subdirectory. For more details, see documentation for the terra::classify function. The land-water file is created on the input subdirectory with the following values: 1=water, 2=land.

hurrecon_reformat_hurdat2 reformats a HURDAT2 file from the National Hurricane Center for use with the HURRECON model. The input file is assumed to be in space-delimited text format. The output file (hurdat2_tracks.csv) contains full track information for each hurricane plus columns for standard datetime and Julian day with fraction. Hurricane IDs are reformatted to facilitate sorting by year. The user must specify the path and the name of the HURDAT2 file.

hurrecon_extract_tracks extracts track data from an input track file (input_tracks.csv) created from HURDAT2 using hurrecon_reformat_hurdat2 or created from other sources with the same file structure. The geographic window used to select hurricanes is set by the land-water file and is optionally extended by the margin parameter. Selection begins by identifying all positions in the window where winds reach or exceed hurricane speed (33 meters/second). If at least one such position exists, the track is extended to include one position before and one position after the first and last hurricane position in the window, if possible. If the resulting track contains at least two positions and the maximum sustained wind speed equals or exceeds wind_min, the track is included. For included storms, summary data are written to ids.csv, track data are written to tracks.csv, and track data for all positions are written to tracks_all.csv.

Usage

hurrecon_set_path(hur_path)

hurrecon_get_path()

hurrecon_create_land_water(
  nrows,
  ncols,
  xmin,
  xmax,
  ymin,
  ymax,
  save = TRUE,
  hur_path = NULL
)

hurrecon_reformat_hurdat2(path, hurdat2_file, save = TRUE)

hurrecon_extract_tracks(
  margin = 0,
  wind_min = 33,
  status = TRUE,
  save = TRUE,
  hur_path = NULL
)

Arguments

hur_path

path for current set of model runs

nrows

number of rows

ncols

number of columns

xmin

minimum longitude (degrees)

xmax

maximum longitude (degrees)

ymin

minimum latitude (degrees)

ymax

maximum latitude (degrees)

save

whether to save results to CSV files

path

path for input & output files

hurdat2_file

name of HURDAT2 file

margin

an optional extension of the geographic window set by the land-water file (degrees)

wind_min

the minimum value of maximum sustained wind speed (meters/second)

status

whether to limit search to storms with hurricane status

Value

no return value

current path

land-water raster

a data frame of track data

a list of three track-related data frames


Summarizing Functions

Description

hurrecon_summarize_land_water displays information about the current land-water file (land_water.tif).

hurrecon_summarize_tracks displays information about the hurricane tracks that are currently selected.

hurrecon_summarize_site displays peak values for a given hurricane and site.

hurrecon_summarize_region displays summary information for a specified raster file and layer, including number of layers, number of rows and columns, spatial extent, cell height and width, and minimum and maximum value.

Usage

hurrecon_summarize_land_water(console = TRUE, hur_path = NULL)

hurrecon_summarize_tracks(console = TRUE, hur_path = NULL)

hurrecon_summarize_site(hur_id, site_name, console = TRUE, hur_path = NULL)

hurrecon_summarize_region(
  filename,
  layer = 1,
  subdir = "region",
  console = TRUE,
  hur_path = NULL
)

Arguments

console

whether to display results in console

hur_path

path for current set of model runs

hur_id

hurricane id

site_name

name of site

filename

name of input raster file

layer

number of raster layer

subdir

subdirectory where raster file is located (region, region-dt, or region-all)

Value

a string containing summary information

a string containing summary information

a string containing summary information

a string containing summary information