WINフォーマットファイルをPythonで作る

WINシステムでWINのサンプルデータを表示した画面

Convert NumPy Data to WIN Format

numpyのデータをWINフォーマットに書き出すモジュールのベータ版をGitHubに公開しました.
https://github.com/is-enaga/winpy
こちらからダウンロード可能です. ご自身のプログラムにimportやコピーペーストしてご利用ください. mkwin関数の引き数にnumpy.arrayとそのサンプリング周波数,データの開始日時を指定すると,numpy.arrayをWINに変換して出力します. ご意見・ご感想等ございましたらTwitterまでご連絡ください.


A beta version of Python module for converting np.array data into WIN format is now uploaded on Github!
https://github.com/is-enaga/winpy
Download from here Please use the “mkwin” function by providing its arguments: an np.array containing data, the sampling frequency, and the start time of the data. If you have any comments, please contact me through X (Twitter).

Example

正弦波をWINフォーマットに変換した例を以下に示します.
WINフォーマットは1秒区切りであるため,半端な秒数で開始・終了する場合に欠損部をなんらかの値で埋める必要があります. 現在はこの欠損部を端のデータ値で埋めるようにしています. (描画時のミスでPythonの波形の正負が逆になっていました.すみません.)

Input (numpy)
Input (numpy)
Output (WIN)
Output (WIN)

補足

WIN System by The University of Tokyo

WINシステムは日本で用いられている地震波形の検測用ソフトおよびその周辺ツール. ダウンロードは以下から可能.
https://wwweic.eri.u-tokyo.ac.jp/WIN/pub/win/

WINフォーマットのデータはwintosacやwin2sacでSAC形式に変換可能. 一方で,他のフォーマットからWINフォーマットに変換するツールはほぼ公開されていないようだ.


WIN system consists of a GUI picking tool and other surrounding commands. You can download WIN from:
https://wwweic.eri.u-tokyo.ac.jp/WIN/pub/win/

WIN format data can be converted to SAC with wintosac command or win2sac command. On the other hand, tools to obtain WIN data from other formats are not exist.

Read WIN Format Data with Python

WINデータの読み込みはobspyで可能. ただしそのときは,中川茂樹先生のモジュールを合わせて使うことを推奨する.


WIN data can be read with obspy (https://docs.obspy.org/). Then you are recommended to use modifying patch by Nakagawa because original obspy code has some bugs on reading WIN data.
https://www.eri.u-tokyo.ac.jp/people/nakagawa/win/