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.1.tar.gz (35.1 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.1-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pysgm_jp-0.1.9.1.tar.gz
Algorithm Hash digest
SHA256 a739286f7f62b0ed5cbcec4780e5fceb21aa297dc35d632811179312904fbae8
MD5 dcdc5a17c9d757bd00d80c4be930bda5
BLAKE2b-256 8fb9d4b65e9d59d6a297f7c2b0cef79933ab1cda9ffab18b82c8235edb7e2819

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pysgm_jp-0.1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ead41ea3ecc12e189db099b8578dc7b976c23d1dd9c77cff70ce806e2a7c436
MD5 bea3d56a4f2dd81c5f0ff0c4e7d14f5a
BLAKE2b-256 c37245fc33f8e6889e7722e5ed95bd5bb179785de74c6b4703b487afe64f2c5f

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