Skip to main content

PySGM 強震動データの解析ライブラリ

Project description

PySGM

Python code to parse and analyze Strong Ground Motion records

強震動データを読み込んで解析するPythonツール群

Requirements

  • Python3

以下のパッケージが必要です

  • NumPy
  • SciPy
  • Matplotlib

Install

以下のように,pipでインストールできます(環境に応じて,pipコマンドやpip3コマンドを使ってください)

$ pip install git+https://github.com/HiroUgoto/PySGM
$ pip3 install git+https://github.com/HiroUgoto/PySGM

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")  # ファイルに出力できます

基本的な使い方は,以下の手順です

  1. データ形式を指定して読み込む
  2. 解析する

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) # 応答スペクトルが出力される

この他にも色々ありますが,省略します

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

pysgm_jp-0.1.8.8.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

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

pysgm_jp-0.1.8.8-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file pysgm_jp-0.1.8.8.tar.gz.

File metadata

  • Download URL: pysgm_jp-0.1.8.8.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pysgm_jp-0.1.8.8.tar.gz
Algorithm Hash digest
SHA256 ada3b674bac9a509dcc88b1c392446584709f5ce103f6c4c289cbbbdcb3cca7a
MD5 eb3546de91632db50d9389998df0f3d9
BLAKE2b-256 f0d2a3ea6aaccc7726dd38d40f14a02d04c04ae8970122817646d5a4c09e03ef

See more details on using hashes here.

File details

Details for the file pysgm_jp-0.1.8.8-py3-none-any.whl.

File metadata

  • Download URL: pysgm_jp-0.1.8.8-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pysgm_jp-0.1.8.8-py3-none-any.whl
Algorithm Hash digest
SHA256 dc621cc53c86123e19fd1da52a85f867126f1d14a115e8c97744ef9f1aacb184
MD5 aedab84d4bf16d2e63e6b5047326cffd
BLAKE2b-256 5b7e94706d48c9542b3797fa3a5df564adcb1d15a2b283fd2ee531de4de50660

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