PySGM-jp
Python code to parse and analyze Strong Ground Motion records
強震動データを読み込んで解析・処理するPythonツール群
Requirements
- Python3
以下のパッケージが必要です
- NumPy
- SciPy
- Matplotlib
Install
以下のように,pipでインストールできます
$ pip install PySGM-jp
Usage
K-NET強震動データを読み込んで,最大加速度(PGA)を求めてみましょう
import PySGM
file_name = "~~~.EW" # .EWファイルのみ指定すれば良い
acc = PySGM.parse(file_name,fmt="nied") # 自動的に .NS .UD ファイルも読み込んで,3成分記録をvectorオブジェクト(独自)に変換
acc.trend_removal() # vectorオブジェクトでは様々な解析ができます.まずは基線補正.
acc.peak_ground_3d() # 3成分合成の最大加速度が出力されます
acc.output("~~~~~~~.acc") # ファイルに出力できます
基本的な使い方は,以下の手順です
- データ形式を指定して読み込む
- 解析する
Data Format
PySGM.parseで指定可能なformatです.増える可能性もあります.
- fmt="vector" (default)
PySGMで出力したテキストデータを再読み込みする
- fmt="nied"
防災科学技術研究所のK-NET, KiK-netデータ(ASCII形式)を読み込む.拡張子(.EW,.EW1,.EW2)で自動的に判断するので,K-NET,KiK-net地表/地中の区別は不要
- fmt="jma"
気象庁の強震記録を読み込む.拡張子が.csvであれば,気象庁HPで公開されているデータを読み込める.その他の拡張子であれば,DVD記録を読みこめる.
Wave Analysis
読み込み後に利用可能な解析ツール群.以下のようにvectorオブジェクトを生成したとする.
vector = PySGM.parse(file_name)
- 基線補正
vector.trend_removal()
- 最大値
vector.peak_ground_2d() # 水平2成分合成値
vector.peak_ground_3d() # 3成分合成値
PGA = vector.peak_ground_3d(print_result=False) # コンソールに結果を出力せずに,値を変数に代入することもできる
- 気象庁計測震度
vector.jma_seismic_intensity()
JSI = vector.jma_seismic_intensity(print_result=False) # コンソールに結果を出力せずに,値を変数に代入することもできる
- 積分(加速度->速度)
vel = vector.integration() # 数値積分された結果が得られる.
vel = vector.integration(low=0.2,high=10) # デフォルトは0.2-50Hzの帯域通過フィルタ済みだが,変更することもできる
PGV = vel.peak_ground_2d(print_result=False) # 組み合わせれば,PGVも求まります
- 波形の描画
velocity.plot_all() # 3成分の時刻歴波形が表示される
velocity.plot_all(to_end=True) # defaultでは0-60秒間のみの表示.記録全体を表示するにはto_end=Trueとする
- テキストファイルの出力
velocity.output(output_file_name) # 指定したファイルにテキスト形式で出力される,
- 応答スペクトルの計算
velocity.response_spectrum() # 成分毎に応答スペクトル(h=5%)が計算される
velocity.plot_rs_all() # 応答スペクトルが表示される
velocity.output_rs(output_rs_file_name) # 応答スペクトルが出力される
この他にも色々ありますが,省略します
Hiroyuki Goto (Kyoto University)
Metadata
Release files for PySGM-jp 0.1.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysgm_jp-0.1.9.1.tar.gz | 35.1 kB | Without provenance | Details for pysgm_jp-0.1.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysgm_jp-0.1.9.1-py3-none-any.whl | Python 3 | none | any | Details for pysgm_jp-0.1.9.1-py3-none-any.whl |
Total release size: 76.2 kB
Release files / pysgm_jp-0.1.9.1.tar.gz
| Download URL | pysgm_jp-0.1.9.1.tar.gz |
|---|---|
| Size | 35.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a739286f7f62b0ed5cbcec4780e5fceb21aa297dc35d632811179312904fbae8
|
|
BLAKE2b-256 checksum How to use checksums |
8fb9d4b65e9d59d6a297f7c2b0cef79933ab1cda9ffab18b82c8235edb7e2819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pysgm_jp-0.1.9.1-py3-none-any.whl
| Download URL | pysgm_jp-0.1.9.1-py3-none-any.whl |
|---|---|
| Size | 41.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ead41ea3ecc12e189db099b8578dc7b976c23d1dd9c77cff70ce806e2a7c436
|
|
BLAKE2b-256 checksum How to use checksums |
c37245fc33f8e6889e7722e5ed95bd5bb179785de74c6b4703b487afe64f2c5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for PySGM-jp 0.1.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.