Skip to contents

Evaluates every hazard curve of a table at the requested return periods, which gives the ordinates of the uniform-hazard spectra of those curves.

Usage

evaluateUniformHazard(curves, TR, by)

Arguments

curves

A table with columns TR (years), Sa (g) and the columns named in by.

TR

Finite positive return periods in years.

by

Names of the columns of curves that identify one curve.

Value

A data.table with the by columns, TR and Sa (g), one row per curve and requested period, curves in order of first appearance and periods in the order given. A curve with fewer than two usable points stops the call.

Mathematics

For one curve with points \((TR_i, S_{a,i})\), only points with finite positive \(TR\) and \(S_a\) are used, and points sharing a \(TR\) keep the largest \(S_a\) (a message reports it when their ordinates differ beyond 12 significant digits). The ordinate at each requested \(TR_o\) is the log-log linear interpolation $$S_a(TR_o) = \exp L\left(\ln TR_o;\ \ln TR_i, \ln S_{a,i}\right),$$ with \(L\) piecewise linear. A requested period may lie outside the curve's range by at most \(\max(0.5, 10^{-4}\max(TR_i, TR_o))\) years, where the end ordinate is taken; beyond that margin the call stops rather than extrapolate. The result evaluates the given curve (for OpenQuake, a statistic curve of the logic tree) at the return period; the ordinate of a mean curve is not, in general, the mean of the ordinates.

Examples

# The rows of one period Tn form one hazard curve.
evaluateUniformHazard(VancouverSpectra, TR = c(100, 2475), by = "Tn")
#>        Tn    TR          Sa
#>     <num> <num>       <num>
#>  1:  0.00   100 0.074559729
#>  2:  0.00  2475 0.366986097
#>  3:  0.05   100 0.109462461
#>  4:  0.05  2475 0.577977255
#>  5:  0.10   100 0.162190758
#>  6:  0.10  2475 0.855966591
#>  7:  0.20   100 0.164106241
#>  8:  0.20  2475 0.826967509
#>  9:  0.30   100 0.139810458
#> 10:  0.30  2475 0.702973594
#> 11:  0.50   100 0.095076458
#> 12:  0.50  2475 0.503980034
#> 13:  1.00   100 0.047080528
#> 14:  1.00  2475 0.286988381
#> 15:  2.00   100 0.021442672
#> 16:  2.00  2475 0.180991578
#> 17:  5.00   100 0.005154408
#> 18:  5.00  2475 0.049797210
#> 19: 10.00   100 0.001945032
#> 20: 10.00  2475 0.023598265
#>        Tn    TR          Sa
#>     <num> <num>       <num>