Skip to main content

空间相关的地震动强度分布模拟库

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.1.tar.gz (181.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spatialim-1.1.1-py3-none-any.whl (179.9 kB view details)

Uploaded Python 3

File details

Details for the file spatialim-1.1.1.tar.gz.

File metadata

  • Download URL: spatialim-1.1.1.tar.gz
  • Upload date:
  • Size: 181.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spatialim-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0e6cab50461c569f000bdbccda515216b5b37c972f3434cb50a7a5812b26d374
MD5 6e09e21c40e4fac77c1894cbcb842f10
BLAKE2b-256 6397b12326ec0c2cbecebe2a1fd197e04fcb550ac6f73a84d7ddf93496098e86

See more details on using hashes here.

File details

Details for the file spatialim-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: spatialim-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 179.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spatialim-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 169e7585615577a93b7cbaf42c5c4c65b86037dd6f5bcdd665a631fc774e9f05
MD5 1ea191075b8871f53298376d7a9bc6cb
BLAKE2b-256 a643453bbe5e12f981ecc18cf46f06246f70517aed6015e4d8c1ea35e389fa92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page