Usage

pyStrata provides classes to programmatically perform site response analysis. It does not provide a default workflow – instead it is meant to be used to define custom workflows. However, regardless of the process the follows parts need to be used:

  1. Define the input motion

  2. Construct the site profile

  3. Define the site response calculator

  4. Select what output should be computed

Once these components are assembled the calculations can be performed and the outputs plotted and saved.

Input motion

pyStrata permits use of both time series and random vibration theory site response. Time series motions are created using a TimeSeriesMotion and one of three methods. Whereas, Random vibration theory motions are created through three classes: RvtMotion for directly specifiying Fourier amplitudes and durations, CompatibleRvtMotion for specifying the motion by the acceleration-response, and SourceTheoryRvtMotion for computing the motion by point-source parameters.

class pystrata.motion.TimeSeriesMotion(filename: str, description: str, time_step: float, accels, fa_length=None)[source]

Time-series motion for time series based site response analysis.

__init__(filename: str, description: str, time_step: float, accels, fa_length=None)[source]

Initialize the class from specified acceleration values.

The filename and description parameters are only used to help track the motion.

Parameters:
  • filename (str) – Source of data

  • description (str) – Description to store helpful information

  • time_step (float) – Time step of the accleration values

  • accels (array_like) – Accelerations in units of g

  • fa_length (optional int) – Length to use for the Fourier amplitude spectrum. If not provided, will be automatically computed to the next power of 2.

classmethod load_at2_file(filename, scale=1.0)[source]

Read an AT2 formatted time series.

Parameters:
  • filename (str) – Filename to open.

  • scale (float, default: 1.) – Scale factor to apply to the motion.

classmethod load_smc_file(filename, scale=1.0)[source]

Read an SMC formatted time series.

Format of the time series is provided by:

https://escweb.wr.usgs.gov/nsmp-data/smcfmt.html

Parameters:
  • filename (str) – Filename to open.

  • scale (float, default: 1.) – Scale factor to apply to the motion.

class pystrata.motion.RvtMotion(freqs, fourier_amps, duration=None, peak_calculator=None, calc_kwds=None)[source]

RVT motion based on user specified Fourier amplitude spectrum and duration.

__init__(freqs, fourier_amps, duration=None, peak_calculator=None, calc_kwds=None)[source]

Initialize the class.

class pystrata.motion.CompatibleRvtMotion(osc_freqs, osc_accels_target, duration=None, osc_damping=0.05, event_kwds=None, window_len=None, peak_calculator=None, calc_kwds=None)[source]

RVT motion based on user specified acceleration response spectrum and duration.

__init__(osc_freqs, osc_accels_target, duration=None, osc_damping=0.05, event_kwds=None, window_len=None, peak_calculator=None, calc_kwds=None)[source]

Initialize the motion.

Parameters:
  • osc_freqs (array_like) – Frequencies of the oscillator response (Hz).

  • osc_accels_target (array_like) – Spectral acceleration of the oscillator at the specified frequencies (g).

  • duration (float, optional) – Duration of the ground motion (sec). If None, then the duration is computed using the event_kwds.

  • osc_damping (float, optional) – Fractional damping of the oscillator (dec). Default value is 0.05 for a damping ratio of 5%.

  • event_kwds (Dict, optional) – Keywords passed to SourceTheoryMotion and used to compute the duration of the motion. Either duration or event_kwds should be specified.

  • window_len (int, optional) – Window length used for smoothing the computed Fourier amplitude spectrum. If None, then no smoothing is applied. The smoothing is applied as a moving average with a width of window_len.

  • peak_calculator (Calculator, optional) – Peak calculator to use. If None, then the default peak calculator is used. The peak calculator may either be specified by a [pyrvt.peak_calculators.Calculator][] object, or by the initials of the calculator using [pyrvt.peak_calculators.get_peak_calculator][].

  • calc_kwds (dict, optional) – Keywords to be passed during the creation the peak calculator. These keywords are only required for some peak calculators.

class pystrata.motion.SourceTheoryRvtMotion(magnitude: float, distance: float, region: str | None = None, depth: float | None = 8, peak_calculator: str | Calculator | None = None, calc_kwds: dict | None = None, freqs: ndarray | None = None, disable_site_amp: bool = False, **kwargs)[source]

RVT motion based on seismological point source model and earthquake scenario parameters.

__init__(magnitude: float, distance: float, region: str | None = None, depth: float | None = 8, peak_calculator: str | Calculator | None = None, calc_kwds: dict | None = None, freqs: ndarray | None = None, disable_site_amp: bool = False, **kwargs)[source]

Initialize the motion.

Parameters:
  • magnitude (float) – Moment magnitude of the event.

  • distance (float) – Epicentral distance (km).

  • region (str) – Region for the parameters. Either ‘cena’ for Central and Eastern North America, or ‘wna’ for Western North America.

  • stress_drop (float, optional) – Stress drop of the event (bars). If None, then the default value is used. For region is ‘cena’, the default value is computed by the model, while for region is ‘wna’ the default value is 100 bars.

  • depth (float, optional) – Hypocenter depth (km). The depth is combined with the distance to compute the hypocentral distance.

  • peak_calculator (Calculator, optional) – Peak calculator to use. If None, then the default peak calculator is used. The peak calculator may either be specified by a [pyrvt.peak_calculators.Calculator][] object, or by the initials of the calculator using [pyrvt.peak_calculators.get_peak_calculator][].

  • calc_kwds (dict, optional) – Keywords to be passed during the creation the peak calculator. These keywords are only required for some peak calculators.

  • freqs (array_like) – frequencies for which the Fourier amplitude spectrum should be computed. Defaults to np.geomspace(0.05, 200, 512)

  • disable_site_amp (bool, optional) – if the crustal site amplification should be disable. Defaults to False.

Construct the site profile

Site response calcuator

Outputs