Learn R Programming

TCHazaRds (version 1.1.4)

TCHazaRdsWindFields: Compute the Wind and Pressure Spatial Hazards Field Associated with TC track.

Description

Compute the Wind and Pressure Spatial Hazards Field Associated with TC track.

Usage

TCHazaRdsWindFields(
  outdate = NULL,
  GEO_land,
  TC,
  paramsTable,
  outfile = NULL,
  overwrite = FALSE,
  returnWaves = NULL,
  return_vars = c("Pr", "Uw", "Vw", "Sw", "Dw")
)

Value

SpatRasterDataset with the following attributes.

abbreviated variabledescriptionunits
PAtmospheric pressurehPa
UwMeridional wind speedm/s
VwZonal wind speedm/s
WwVertical wind speedm/s
SwWind speedm/s
DwThe direction from which wind originatesdeg clockwise from true north
Hs0Deep water significant wave heightm
Tp0Deep water Peak wave periods
Dp0The peak direction in which wave are headingdeg clockwise from true north
RThe radial distance to the TC centrekm
lamThe radial direction to the TC centredeg

Arguments

outdate

array of POSITx date times to linearly interpolate TC track

GEO_land

SpatVector or dataframe hazard geometry generated with land_geometry

TC

SpatVector of Tropical cyclone track parameters for a single time step

paramsTable

Global parameters to compute TC Hazards

outfile

character. Output netcdf filename

overwrite

TRUE/FALSE, option to overwrite outfile

returnWaves

DEPRECATED. Use return_vars including 'Hs0','Tp0','Dp0' instead

return_vars

character(). Variables to return. Default: core winds/pressure. Options: c("Pr","Uw","Vw","Sw","Dw","R","lam","Ww","Hs0","Tp0","Dp0")

Examples

Run this code
require(terra)
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)

TCi = vect(cbind(c(154,154),c(-26.1,-26)),"lines",crs="epsg:4283") #track line segment
TCi$PRES = 950
TCi$RMAX = 40
TCi$VMAX = 60
TCi$B = 1.4
TCi$ISO_TIME = "2022-10-04 20:00:00"
TCi$LON = geom(TCi)[1,3]
TCi$LAT = geom(TCi)[1,4]
TCi$STORM_SPD = perim(TCi)/(3*3600) #m/s
TCi$thetaFm = 90-returnBearing(TCi)
#OR
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
plot(dem);lines(TC,lwd = 4,col=2)

paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
#calculate the wind hazard

outdate = seq(strptime(TC$ISO_TIME[44],"%Y-%m-%d %H:%M:%S",tz="UTC"),
              strptime(TC$ISO_TIME[46],"%Y-%m-%d %H:%M:%S",tz="UTC"),
              3600*3)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable)
plot(min(HAZi$Pr))

Run the code above in your browser using DataLab