calc_grid_winds: Calculate hurricane winds at locations

View source: R/my_wind_code.R

calc_grid_windsR Documentation

Calculate hurricane winds at locations

Description

This function inputs a storm track and a dataset of locations and calculates the full time series of windspeeds over the course of the storm at each location. It also returns the distance of the storm from the location at each time point, as well as the surface wind direction at each time point that the storm is within the distance specified by max_dist. It is assumed that the track data entered has been measured in knots, at 10 m above surface level, and with 1-minute averaging period. The dataset of locations can either be a regularly-spaced grid or can be the central points of locations, like counties or cities. For counties in the eastern half of the United States, the county_points dataset that comes with the package can be used as the grid_point input.

Usage

calc_grid_winds(
  hurr_track = stormwindmodel::floyd_tracks,
  grid_df = stormwindmodel::county_points,
  tint = 0.25,
  max_dist = 2222.4
)

Arguments

hurr_track

Dataframe with hurricane track data for a single storm. The dataframe must include columns for date-time (year, month, day, hour, minute; e.g., "198808051800" for August 5, 1988, 18:00 UTC), latitude, longitude (in degrees East), and wind speed (in knots). The column names for each of these must be date, latitude, longitude, and wind. See the example floyd_tracks dataset for an example of the required format.

grid_df

A dataframe of locations at which to calculate wind characteristics. This dataframe must include columns for latitude and longitude for each point, and these columns must be named glat and glon. The latitudes and longitudes should be in decimal degrees, with longitudes being entered in degrees East. Therefore Western hemisphere (so, almost all those for Atlantic basin storms) should be expressed as negative values.

tint

Interval (in hours) to which to interpolate the tracks. The default is 0.25 (i.e., 15 minutes).

max_dist

A numeric value giving (in kilometers) the maximum distance from the storm's center to model storm-associated winds. Any value beyond this distance will be automatically set to 0 m / s for storm-associated winds. The default value is 2222.4 km (1200 nautical miles).

Value

An array with three elements, the first with modeled wind speeds, the second with distance of the storm from the location, at the third with the angle of surface winds. Each of the elements is a matrix, where the rows give time points over the course of the storm and the columns give each of the locations. By extracting a column from one of the matrices, you can get the time series at that location over the course of the storm (for example, by extracting a column from the first element, you can get a time series of windspeed at that location over the course of the storm).

Note

This function can take a few minutes to run, depending on the number of locations that are being modeled.

library(tibble) library(ggplot2) library(lubridate) data("floyd_tracks") data("county_points")

floyd_winds <- calc_grid_winds(hurr_track = floyd_tracks, grid_df = county_points)

dare_county_fips <- "37055" dare_floyd_winds <- floyd_winds[["vmax_sust"]][ , dare_county_fips] enframe(name = "timepoint", value = "sustained_wind") ggplot(dare_floyd_winds, aes(x = ymd_hms(timepoint), y = sustained_wind)) + geom_line()


geanders/stormwindmodel documentation built on Sept. 27, 2022, 6:47 a.m.