Skip to content
/ jscale Public

Calculate the seismic intensity scale of the earthquake.

License

Notifications You must be signed in to change notification settings

takatoh/jscale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jscale

地震の加速度記録から計測震度と震度階を求めます。 また、長周期地震動階級を求めることもできます。

Install

> go install github.com/takatoh/jscale@latest

Usage

地震の加速度記録は CSV 形式で、3成分必要です。 たとえば次のように:

Time,NS,EW,UD
0.00,-0.03,0.01,-0.34
0.01,0.18,0.42,0.05
0.02,-0.17,-0.25,0.34
0.03,-0.55,0.41,0
0.04,0.31,0.76,0.62
0.05,-0.72,0.1,0.37
0.06,-0.04,0,-0.3
0.07,-0.13,0.46,-0.09
0.08,-0.69,-0.22,0.36
(後略)

加速度記録のファイルを example.csv とすると、計測震度と震度階を求めるには、次のように実行します。

> jscale example.csv

長周期地震動階級を求めるには、-long-period オプションを付加します。

> jscale -long-period example.csv

Input Formats

入力する加速度記録として、CSV 以外に気象庁や K-NET の強震記録を利用することもできます。 気象庁の強震記録を利用する場合は、-jma オプションを付けて実行します。

> jscale -jma example.txt

K-NET の強震記録は成分ごとにファイルが分かれていて、それぞれ example.NS, example.EW, example.UD とすると、拡張子を除いた部分を -knet オプションとともに指定します。

> jscale -knet example

固定長フォーマットの加速度記録にも対応しています。固定長フォーマットはパラメータが多いので、 TOML 形式の入力ファイルを作成します。たとえば次のように:

[[wave]]
name   = "NS"
file   = "exmaple.dat"
format = "10F8.2"
dt     = 0.01
ndata  = 12000
skip   = 2

[[wave]]
name   = "EW"
file   = "exmaple.dat"
format = "10F8.2"
dt     = 0.01
ndata  = 12000
skip   = 1204

[[wave]]
name   = "UD"
file   = "exmaple.dat"
format = "10F8.2"
dt     = 0.01
ndata  = 12000
skip   = 2406

この例では、example.dat が加速度記録のファイルです。dtndata はそれぞれ時刻刻みとデータ数です。 これらが同一の加速度記録が3成分必要です。

実行は次のように -fixed オプションに続けて入力ファイルを指定します。

> jscale -fixed input.toml

License

MIT License

About

Calculate the seismic intensity scale of the earthquake.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages