Spatial seismic intensity simulation library
Project description
Spatially Correlated Ground-Motion Intensity Simulation
This package provides a fast tool to simulate spatially correlated ground-motion intensity measures based on established ground-motion prediction equations (GMPEs) and spatial correlation models.
Examples
The python/examples folder contains a magnitude-7 scenario. Below is one random simulation of Sa (T = 1 s); the rectangle shows the surface projection of the fault:
Median of 10 simulations for Sa (T = 1 s):
Python Usage
- Install the package:
pip install spatialim - The
python/examples/demo.pyscript demonstrates how to run the spatial ground-motion simulation end to end.
References
- K. W. Campbell, Y. Bozorgnia. NGA-West2 Ground Motion Model for the Average Horizontal Components of PGA, PGV, and 5% Damped Linear Acceleration Response Spectra. Earthquake Spectra, 2014, 30(3): 1087-1115.
- N. Jayaram, J. W. Baker. Correlation model for spatially distributed ground-motion intensities. Earthquake Engineering & Structural Dynamics, 2009, 38(15): 1687-1708.
- K. Goda. Interevent Variability of Spatial Correlation of Peak Ground Motions and Response Spectra. Bulletin of the Seismological Society of America, 2011, 101(5): 2522-2531.
- M. Markhvida, L. Ceferino, J. W. Baker. Modeling spatially correlated spectral accelerations at multiple periods using principal component analysis and geostatistics. Earthquake Engineering & Structural Dynamics, 2018, 47(5): 1107-1123.
Developer Notes
Code Structure
Core logic lives in src/core/:
simulator.rs: orchestrates GMPE evaluation and residual simulation- Feature modules
io.rs: input/output handlinggeo.rs: distance calculations and related helperssite.rs: site definitionseq_source.rs: earthquake source definitionsutilities.rs: common utility functions
- Core modules
gmpe: ground-motion prediction equations (currently CB14)b_res_sim.rs: between-event residual simulationw_res_sim.rs: within-event residual simulation
Packaging for Python
- Install
maturin:pip install maturin - Update
Cargo.tomlwith:[lib] name = "_spatialim" crate-type = ["cdylib", "rlib"] [dependencies] pyo3 = { version = "0.27.1", features = ["extension-module"] }
- Add
pyproject.toml:[build-system] requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" [tool.maturin] python-source = "python" module-name = "spatialim._spatialim" exclude = ["**/*.pyd", "**/*.so", "**/*.dylib"]
Other fields follow a standardpyproject.toml. - Create the
pythondirectory:python/ ├── spatialim/ │ ├── __init__.py │ ├── _spatialim.pyi # type hints │ └── other modules └── setup.py - For local development, install into your active Python environment:
maturin develop --release - Build distributable wheels:
maturin build --release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spatialim-2.0.0-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: spatialim-2.0.0-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 7.7 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8069ed63c094c14bc9bca416b89b821f1e1597c1eceb284f646cb4420d60e7a3
|
|
| MD5 |
7f3b00786a2cb326eefac22675dce760
|
|
| BLAKE2b-256 |
31cc3247540d129e6a4cfc0fb5a6475c081a97182c3f3a707b97163eaf1e4b6f
|