Skip to main content

強震動データの解析・処理用ライブラリ

Project description

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

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

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

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


Hiroyuki Goto (Kyoto University)

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.9.0.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.9.0-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysgm_jp-0.1.9.0.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.9.0.tar.gz
Algorithm Hash digest
SHA256 f42d2c4ddbc7c772b68423e94d33f040414663e741f5751cecd35daf39851460
MD5 d570e23ec85b91084882a27f1a3d4558
BLAKE2b-256 6da07fd2b0ab940af34b4dfb0ade48b1aff22827ef8a4d6e36e1d08d3fa4fe0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysgm_jp-0.1.9.0-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.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2de739bb75af5606cd9bb84631bf4b0580c1b29c075a3d72547266630a6b358c
MD5 352c804584373f1a033789f96f37022b
BLAKE2b-256 4308b024b097849e7bae93bd446812a0214dafcc8221313afac3c04f9f37a1e4

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