2016/03/03

gnuplotでDARTの観測記録をプロットしてみる

インドネシアのスマトラ島(Sumatra)沖で,M7.8の地震が2016-03-02 12:49:48 (UTC)に発生しました.幸い横ずれだったようで津波はほとんど発生していません.


No tsunami observed. Warnings issued by Indonesia and Marine Warnings by Australia (for Christmas and Cocos Islands)....
Posted by US NWS Pacific Tsunami Warning Center on 2016年3月2日


一方で,NDBC DART(Deep-ocean Assessment and Reporting of Tsunamis)では4点でトリガがかかっているのでその記録を gnuplot で波形を書いてみました.

DART観測点 23401 のデータを使ってみます.今回のイベントのデータはこのリンクから持って来ることが出来ます.データが記載されているtextboxから単にコピペして, DART23401.dat として保存しました.

フォーマットは,データの先頭に以下のように書いてあります.
#YY  MM DD hh mm ss T   HEIGHT
#yr  mo dy hr mn  s -      m
2016 03 02 16 59 00 2 3469.152
.....

========== DART23401.gp ===========
set size ratio 0.4    # 時刻(x軸)に長くする.

# データを読み込む時の時刻のフォーマット.timefmtに使える記号は help timefmt で
# 確認できます.
set xdata time
set timefmt "%Y %m %d %H %M %S"

# x軸の目盛の書き方も timefmt と同じやり方で指定します.\n で改行も出来ます.
set xlabel 'Time [UT]'
set format x "%m/%d\n%H:%M"

set ylabel 'meters'

set output "DART23401.png"
set term png enh size 1080,480    # size ratio 0.4にしたので横長の画像サイズ
plot "DART23401.dat" u 1:8 lt 0 w l notitle \
, "< ../DART/readData.pl DART23401.dat" in 0 u 1:8 lc 6 lt 5 t '15-min', \
"" in 1 u 1:8 lc 2 lt 4 t '1-min' \
, "" in 2 u 1:8 lc 7 lt 5 t '15-sec'
unset output
# readData.pl は,
# T = Measurement Type;
#     where 1 = 15-minute measurement;
#               2 = 1-minute measurement;
#               3 = 15-second measurement
# の3つに分割して(間に空行を2つ入れる)出力するためのスクリプトです.
# 色分けしないなら, plot "DART23401" u 1:8 lt 0 w l だけでプロット出来ます.


x軸(時刻)を指定してプロットしたい場合は, set xrange を使いますが,フォーマットは timefmt で設定した書式に従って,xrange を設定します.例えば,地震動等の影響で見えている最初の振動を拡大するには以下のようにします.この書式は,format x のものではなく,読み込むときに設定する timefmt です.
set xrange ["2016 03 02 13 04 00":"2016 03 02 13 08 00"]


他の3点のデータも下記からダウンロード出来ます.
DART 56003


DART 23227


DART 56001

全データを一定のxrangeにして縦軸のスケールも合わせて,長周期成分を取り除いたデータを axis x1y2 で追加して作成したpng を montage で合成しました.
montage DART?????.png -geometry 540x240 DART.png


<< help timefmt より抜粋>>
       Format       Explanation
       %d           day of the month, 1--31
       %m           month of the year, 1--12
       %y           year, 0--99
       %Y           year, 4-digit
       %j           day of the year, 1--365
       %H           hour, 0--24
       %M           minute, 0--60
       %s           seconds since the Unix epoch (1970-01-01, 00:00 UTC)
       %S           second, integer 0--60 on output, (double) on input
       %b           three-character abbreviation of the name of the month
       %B           name of the month