pyrvt.peak_calculators¶
Peak factor models.
Published peak factor models, which compute the expected peak ground motion. A specific model may include non-stationarity adjustments such as a oscillator duration correction.
- pyrvt.peak_calculators.calc_moments(freqs, fourier_amps, orders)[source]
Compute the moments of a Fourier amplitude spectrumself.
- class pyrvt.peak_calculators.SquaredSpectrum(freqs, fourier_amps)[source]
Bases:
objectSquared Fourier amplitude spectrum.
Used to store calculated spectral moments during calculations.
- Parameters:
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz)
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum.
- __init__(freqs, fourier_amps)[source]
Initialize SquaredSpectrum.
- Parameters:
freqs (ArrayLike)
fourier_amps (ArrayLike)
- moment(num)[source]
Compute the spectral moments.
The spectral moment is computed using the squared Fourier amplitude spectrum.
- moments(*nums)[source]
Return the computed moments.
- property freqs: ndarray
- property squared_fa: ndarray
- class pyrvt.peak_calculators.Calculator(**kwds)[source]
Bases:
ABCBase class used for all peak calculator classes.
Provides the interface that is used by all the other classes. Specific peak calculators modify the _calc_peak_factor method and potentially _calc_duration_rms method. Using any calculator is done through calling of __call__.
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the object.
- classmethod limited_num_zero_crossings(num_zero_crossings)[source]
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- __call__(duration, freqs, fourier_amps, **kwds)[source]
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- class pyrvt.peak_calculators.Vanmarcke1975(**kwds)[source]
Bases:
CalculatorVanmarcke (1975) peak factor.
The Vanmarcke (1975, Vanmarcke (1975)) peak factor, which includes the effects of clumping. The peak factor equation is from Equation (2) in Der Kiureghian (1980), which is based on Equation (29) in Vanmarcke (1975).
The cumulative density function (CDF) of the peak is defined as:
\[F_x(x) = \left[1 - \exp\left(-x^2/2\right)\right] \exp\left[-N_z \frac{1 - \exp\left(-\sqrt{\pi/2} \delta_e x\right)}{\exp(x^2 / 2) - 1 }\right]\]where $N_z$ is the number of zero crossings, $delta_e$ is the effective bandwidth ($delta^{1.2}$).
Typically, the expected value of the peak factor is calculated by integrating over the probability density function (i.e., $f_x(x) = frac{d}{dx} F_x( x)$):
\[E[x] = \int_0^\infty x f_x(x) dx\]However, because of the properties of $F_x(x)$, specifically that it has non-zero probabilities for only positive values, $E[x]$ can be computed directly from $F_x(x)$.
\[E[x] = \int_0^\infty 1 - F_x(x) dx.\]This is based on the following sources [1] and [2].
[1]: http://en.wikipedia.org/wiki/Expected_value#Formulas_for_special_cases [2]: http://stats.stackexchange.com/a/13377/48461
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.Davenport1964(**kwds)[source]
Bases:
CalculatorDavenport (1964) peak factor.
RVT calculation using the asymptotic solution proposed by Davenport (1964).
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the class.
- classmethod asymtotic_approx(zero_crossings)[source]
Compute the peak factor from the asymptotic approximation.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.DerKiureghian1985(**kwds)[source]
Bases:
Davenport1964Der Kiureghian (1985) peak factor.
RVT calculation using peak factor derived by Davenport (1964) with limits suggested by Igusa and Der Kiureghian [1985].
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod asymtotic_approx(zero_crossings)
Compute the peak factor from the asymptotic approximation.
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.ToroMcGuire1987(use_nonstationarity_factor=True, **kwds)[source]
Bases:
Davenport1964Toro and McGuire (1987) peak factor.
Peak factor equation using asymptotic solution proposed by Davenport (1964) with modifications proposed by Toro & McGuire (1987).
- Parameters:
use_nonstationarity_factor (bool) – If the non-stationarity factor should be applied.
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(use_nonstationarity_factor=True, **kwds)[source]
Initialize the class.
- Parameters:
use_nonstationarity_factor (bool)
- classmethod nonstationarity_factor(osc_damping, osc_freq, duration)[source]
Compute nonstationarity factor to the peak response.
Vanmarcke (1975) provides a recommendation for scaling the damping of the SDOF oscillator to account for nonstationarity in Equation 8.30: $$ xi_t = frac{xi}{1 - expleft(-4 pi xi f_n tright)} $$ Toro and McGuire (1987) simplified this to scale the $X_{rms}$ by: $$ n_f = sqrt{1 - expleft(-4 pi xi f_n Tright)} $$
The simplified model from Toro and McGuire (1987) is used here.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod asymtotic_approx(zero_crossings)
Compute the peak factor from the asymptotic approximation.
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.CartwrightLonguetHiggins1956(**kwds)[source]
Bases:
CalculatorCartwight and Longuet-Higgins (1956) peak factor.
RVT calculation based on the peak factor definition by Cartwright and Longuet-Higgins [1956] using the integral provided by Boore [2003].
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.BooreJoyner1984(**kwds)[source]
Bases:
CartwrightLonguetHiggins1956Boore and Joyner (1984) peak factor.
RVT calculation based on the peak factor definition by Cartwright and Longuet-Higgins [1956] and along with the root-mean-squared duration correction proposed by Boore and Joyner [1984].
This RVT calculation is used by SMSIM and is described in Boore [2003].
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(**kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.LiuPezeshk1999(**kwds)[source]
Bases:
BooreJoyner1984Liu and Pezeshk (1999) peak factor.
RVT calculation based on the peak factor definition by Cartwright and Longuet-Higgins [1956] along with the root-mean-squared duration correction proposed by Liu and Pezeshk [1999].
- __init__(**kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.BooreThompson(region, mag, dist, ref, **kwds)[source]
Bases:
CalculatorAbstract class for the Boore & Thompson duration correction.
The duration ratio is defined by Equation (10) in Boore and Thompson [2012]. Magnitude and distance is interpolated using scipy.interpolate.LinearNDInterpolator on the natural log of the distance.
- Parameters:
region (str) – Region for which the parameters were developed. Valid options are: ‘wna’ for Western North America (active tectonic), and ‘cena’ for Central and Eastern North America ( stable tectonic).
mag (float) – Magnitude of the event.
dist (float) – Distance of the event in (km).
ref (str) – Reference for coefficients, either: ‘bt12’ or ‘bt15’
- __init__(region, mag, dist, ref, **kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.BooreThompson2012(region, mag, dist, **kwds)[source]
Bases:
BooreThompson,BooreJoyner1984Boore and Thompson (2012) peak factor.
Peak calculation based on the peak factor definition by Cartwright and Longuet-Higgins [1956] along with the root-mean-squared duration correction proposed by Boore and Thompson [2012].
- Parameters:
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(region, mag, dist, **kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.BooreThompson2015(region, mag, dist, **kwds)[source]
Bases:
BooreThompson,Vanmarcke1975Boore and Thompson (2015) peak factor.
Peak calculation based on the peak factor definition by Vanmarcke (1975) along with the root-mean-squared duration correction proposed by Boore & Thompson (2015).
- Parameters:
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- __init__(region, mag, dist, **kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.WangRathje2018(region, mag, dist, **kwds)[source]
Bases:
BooreThompson2015Wang & Rathje (2018) peak factor.
Peak calculation based on the peak factor definition by Vanmarcke (1975) along with correction for oscillator duration by Boore & Thompson (2015) and site amplification as described in Wang & Rathje (2018).
- Parameters:
- NAME
Complete reference of the peak calculator
- Type:
- ABBREV
Abbreviation of the reference
- Type:
- _MIN_ZERO_CROSSINGS
Minimum number of zero crossings.
- Type:
- COEFS = rec.array([(1, 0.2688, 0.003 , 1.838 , -0.0198, 0.091), (2, 0.2555, -0.0002, 1.2154, -0.0183, 0.081), (3, 0.2287, -0.0014, 0.9404, -0.013 , 0.056)], dtype=[('mode', '<i8'), ('a', '<f8'), ('b', '<f8'), ('d', '<f8'), ('e', '<f8'), ('sd', '<f8')])
- __init__(region, mag, dist, **kwds)[source]
Initialize the class.
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- class pyrvt.peak_calculators.SeifriedEtAl2025(use_nonstationarity_factor=True, mean_calc='arithmetic', **kwds)[source]
Bases:
CalculatorSeifried et al. (2025) peak factor calculator.
- __init__(use_nonstationarity_factor=True, mean_calc='arithmetic', **kwds)[source]
Initialize SeifriedEtAl2025.
- Parameters:
use_nonstationarity_factor (bool, optional) – If True, the nonstationarity adjustment is applied, by default True.
**kwds (Any) – Additional keyword arguments.
- Return type:
None
- __call__(duration, freqs, fourier_amps, **kwds)
Compute the peak response.
- Parameters:
duration (float) – Duration of the stationary portion of the ground motion. Typically defined as the duration between the 5% and 75% normalized Arias intensity [sec].
freqs (array_like) – Frequency of the Fourier amplitude spectrum (Hz).
fourier_amps (array_like) – Amplitude of the Fourier amplitude spectrum with a single degree of freedom oscillator already applied if being used. Units are not important.
- Returns:
max_resp (float) – expected maximum response.
peak_factor (float) – associated peak factor.
- Return type:
- classmethod limited_num_zero_crossings(num_zero_crossings)
Limit the number of zero crossings to a static limit.
The minimum is configured through adjusting cls._MIN_ZERO_CROSSINGS.
- pyrvt.peak_calculators.get_peak_calculator(method, calc_kwds)[source]
Select a peak calculator based on a XXDD string.
The format of the string is XX for author initials, and then DD for the last two years of the date published (e.g., ‘BJ84’ for Boore & Joyner 1984).
- Parameters:
- Returns:
A matching peak calculator instance.
- Return type:
Calculator
- Raises:
NotImplementedError – If no matching calculator is found.
- pyrvt.peak_calculators.get_region(region)[source]
Return the internal region naming used in this package.
- Parameters:
region (str) – Regional synonym.
- Returns:
Region either ‘cena’ or ‘wna’.
- Return type:
- Raises:
NotImplementedError – If the region is unknown.