Spatial earthquake intensity distribution simulation library
Project description
SpatialIM
SpatialIM是一个用于空间相关的烈度分布模拟的Python库,基于C++实现,提供高效的地震烈度模拟计算。
系统要求
- Windows 64位操作系统
- Python 3.12
安装
pip install spatialim
使用示例
import spatialim
# 设置参数
lon_0, lat_0 = -122.320011, 37.963314 # 震中经纬度
M = 7.0 # 震级
N_sim = 100 # 模拟次数
seed = 42 # 随机数种子
W = 20.0 # 断裂面宽度(km)
length = 50.0 # 断裂面长度(km)
normal_x, normal_y, normal_z = 0.318, 0.214, 0.1395 # 法线方向
lambda_angle = 0 # rake角度(度)
Fhw = 1 # hanging wall效应
Zhyp = 15.0 # 震源深度(km)
region = 1 # 区域(1=加州)
nPCs = 10 # 主成分数
# 创建地震源对象
eqs = spatialim.EQSource_CB14PCA(lon_0, lat_0)
eqs.set_seed(seed)
eqs.set_W(W)
eqs.set_length(length)
eqs.set_RuptureNormal(normal_x, normal_y, normal_z)
eqs.set_lambda(lambda_angle)
eqs.set_Fhw(Fhw)
eqs.set_Zhyp(Zhyp)
eqs.set_region(region)
eqs.set_nPCs(nPCs)
# 注册场地
# eqs.register_site(ID, lon, lat, elevation_km, T0, Vs30, Z25)
eqs.register_site(1, -122.26, 37.87, 0.0, 0.2, 250.0, 0.51)
# 模拟烈度
magnitudes = [M] * N_sim
eqs.simulate_intensities(magnitudes)
# 保存结果
eqs.save_im("intensity_results.txt")
eqs.save_xy("site_coordinates.txt")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spatialim-1.1.2.tar.gz
(185.6 kB
view details)
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
spatialim-1.1.2-py3-none-any.whl
(184.1 kB
view details)
File details
Details for the file spatialim-1.1.2.tar.gz.
File metadata
- Download URL: spatialim-1.1.2.tar.gz
- Upload date:
- Size: 185.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
183d04c0801a2a08992b3960d6802e91370bee12fdba5f916aa3b4261f2d0f79
|
|
| MD5 |
ea2865b9a52482a413e3976e0208c4fd
|
|
| BLAKE2b-256 |
60fcb73e653a0e4c23ea3697b506692439bd5e29fd99143bd168be44e1a56f2c
|
File details
Details for the file spatialim-1.1.2-py3-none-any.whl.
File metadata
- Download URL: spatialim-1.1.2-py3-none-any.whl
- Upload date:
- Size: 184.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de62ef50d1cbdd36b34887e861748875fb73daa46e4855b83b6697511fdefd0f
|
|
| MD5 |
2714791ba48e66378021fe8f0d1183ab
|
|
| BLAKE2b-256 |
c3f7a362e5474aa6a6ab74274ff9edce3abfad1600e61857c2efdc5c99c9b316
|