Learn R Programming

resourcecode (version 0.5.3)

compute_sea_state_2d_spectrum: Compute sea_state parameter from wave directional spectrum

Description

Compute sea_state parameter from wave directional spectrum

Usage

compute_sea_state_2d_spectrum(spec, ...)

Value

a tibble with the sea-state parameters computed from the time series of 2D spectrum

Arguments

spec

2D spectrum data, e.g. from get_2Dspectrum

...

currently unused

Examples

Run this code
if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
rscd_params <- get_parameters(
  node = "134865",
  start = "1994-01-01",
  end = "1994-01-31 23:00:00",
  parameters = c("hs", "tp")
)
spec <- resourcecodedata::rscd_2d_spectra
param_calc <- compute_sea_state_2d_spectrum(spec)
oldpar <- par(mfcol = c(2, 1))
plot(param_calc$time, param_calc$hs, type = "l", xlab = "Time", ylab = "Hs (m)")
lines(rscd_params$time, rscd_params$hs, col = "red")
plot(param_calc$time, param_calc$tp, type = "l", xlab = "Time", ylab = "Tp (s)")
lines(rscd_params$time, rscd_params$tp, col = "red")
par(oldpar)
}

Run the code above in your browser using DataLab