Skip to content

Commit 3cbe998

Browse files
committed
Updated documentation.
1 parent f43d125 commit 3cbe998

File tree

4 files changed

+100
-2
lines changed

4 files changed

+100
-2
lines changed

docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ $ pip install .
3434
The peak calculators and associated functions are contained within
3535
`pyrvt.peak_calculators`. The primary peak calculators are:
3636

37+
- [Seifried et al. (2025)][pyrvt.peak_calculators.SeifriedEtAl2025][@seifried25]
3738
- [Wang and Rathje (2018)][pyrvt.peak_calculators.WangRathje2018][@wang18]
3839
- [Boore and BooreThompson (2015)][pyrvt.peak_calculators.BooreThompson2015][@boore15]
3940
- [Vanmarcke (1975)][pyrvt.peak_calculators.Vanmarcke1975][@vanmarcke75]

docs/refs.bib

+7
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ @article{liu99
148148
publisher={Seismological Society of America}
149149
}
150150

151+
@article{seifried25,
152+
title={To be determined},
153+
author={Seifried, Andrew and Bahrampouri, Mahdi and Toro, Gabriel R and Kottke, Albert R},
154+
journal={Bulletin of the Seismological Society of America},
155+
year={2025}
156+
}
157+
151158
@article{stafford22,
152159
title={Host-region parameters for an adjustable model for crustal earthquakes to facilitate the implementation of the backbone approach to building ground-motion logic trees in probabilistic seismic hazard analysis},
153160
author={Stafford, Peter J and Boore, David M and Youngs, Robert R and Bommer, Julian J},

docs/usage/library.md

+91-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,98 @@ title: Use as a library
66

77
The intent in developing `pyRVT` the was for use in site response calculations
88
performed by [pyStrata](https://github.com/arkottke/pystrata). However, it can
9-
also be used for independent calculations through [peak calculation](#peak-calculators) or through [ground motion models](#ground-motion-models).
9+
also be used for independent calculations through [peak
10+
calculation](#peak-calculators) or through [ground motion
11+
models](#ground-motion-models).
1012

1113
## Peak calculators
1214

15+
The `Calculator` class in **pyRVT** is the base class for implementations of
16+
peak factor models. Each derived calculator implements methods to:
17+
18+
1. Compute peak factors for given duration and frequency content.
19+
2. Optionally handle hardware- or site-specific parameters.
20+
21+
Typically, you get an instance by calling:
22+
23+
```python
24+
from pyrvt.peak_calculators import get_peak_calculator
25+
26+
calc = get_peak_calculator("BJ84", {})
27+
peak_factor = calc.calc_peak(duration=30.0, sspectrum=my_spectrum)
28+
```
29+
30+
In this example, `"BJ84"` refers to a specific peak calculator (Boore and Joyner).
31+
You can choose other calculators, such as `"BT15"` or `"V75"`, as needed.
32+
1333
## Ground motion models
34+
35+
### Overview of Classes in motions.py
36+
37+
- **RvtMotion**
38+
The base class that stores frequency arrays, Fourier amplitudes, and durations. It also provides methods for calculating oscillator accelerations and peaks.
39+
40+
- **SourceTheoryMotion**
41+
Extends RvtMotion for source-theory-based ground motions. It handles magnitude, distance, and region-specific parameters.
42+
43+
- **StaffordEtAl22Motion**
44+
Another RvtMotion subclass modeling motions via Stafford et al. (2022) relationships. It computes site amplification, duration, and Fourier amplitudes based on magnitude, distance, and other inputs.
45+
46+
- **CompatibleRvtMotion**
47+
Creates an RVT-compatible target motion from a set of oscillator frequencies and corresponding spectral accelerations.
48+
49+
### Example Usage (RvtMotion)
50+
51+
```python
52+
from pyrvt.motions import RvtMotion
53+
import numpy as np
54+
55+
# Frequency array in Hz
56+
freqs = np.array([0.5, 1.0, 2.0])
57+
# Sample Fourier amplitudes
58+
fourier_amps = np.array([1e-3, 2e-3, 1.5e-3])
59+
60+
# Create an RVT motion instance
61+
motion = RvtMotion(
62+
freqs=freqs,
63+
fourier_amps=fourier_amps,
64+
duration=30.0,
65+
peak_calculator="BJ84"
66+
)
67+
68+
# Calculate peak amplitude
69+
peak_value = motion.calc_peak()
70+
print("Peak Value:", peak_value)
71+
```
72+
73+
## Example Usage (SourceTheoryMotion)
74+
75+
```python
76+
import numpy as np
77+
from pyrvt.motions import SourceTheoryMotion
78+
79+
# Magnitude and distance
80+
magnitude = 6.0
81+
distance = 10.0
82+
83+
# Frequency array in Hz
84+
freqs = np.logspace(-1, 2, 50) # 0.1 to 100 Hz
85+
# Create a SourceTheoryMotion instance
86+
source_motion = SourceTheoryMotion(
87+
magnitude=magnitude,
88+
distance=distance,
89+
region="wna", # Western North America
90+
stress_drop=100.0, # Example stress drop
91+
freqs=freqs,
92+
duration=30.0,
93+
peak_calculator="BT15" # Boore & Thompson 2015
94+
)
95+
96+
# Calculate Fourier amplitudes
97+
fourier_amps = source_motion.calc_fourier_amps()
98+
print("Fourier Amplitudes:", fourier_amps)
99+
100+
# Calculate peak amplitude
101+
peak_value = source_motion.calc_peak()
102+
print("Peak Value:", peak_value)
103+
```

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ plugins:
5252
docstring_options:
5353
ignore_init_summary: true
5454
docstring_section_style: list
55-
filters: ["!^_"]
55+
filters: ["!^__"]
5656
heading_level: 1
5757
inherited_members: true
5858
merge_init_into_class: true

0 commit comments

Comments
 (0)