HinetPy——基于Python的Hi-net数据申请客户端

https://img.shields.io/travis/seisman/HinetPy/master.svg https://codecov.io/gh/seisman/HinetPy/branch/master/graph/badge.svg https://img.shields.io/github/release/seisman/HinetPy.svg https://img.shields.io/pypi/v/HinetPy.svg https://img.shields.io/pypi/pyversions/HinetPy.svg https://img.shields.io/github/license/seisman/HinetPy.svg

HinetPy 是一个Python模块,致力于自动化和简化与 NIED Hi-net 相关的繁琐的数据申请、下载和格式转换工作。

NIED Hi-net | Source Code | Documentation | 中文文档

功能

  • 从Hi-net申请连续波形数据
  • 将波形数据从win32格式转换为SAC格式
  • 提取仪器响应信息并保存为SAC零极点文件
  • 多线程并行下载和转换以加快速度

一个简单的示例

HinetPy 功能强大,使得从Hi-net申请连续数据、将数据转换为SAC格式、提取仪器响应文件并保存为SAC零极点文件变得很简单。

>>> from HinetPy import Client, win32
>>>
>>> # You need a Hi-net account to access their data
>>> client = Client("username", "password")
>>>
>>> # Let's try to request 20 minutes data since 2010-01-01T00:00(GMT+0900) from Hi-net
>>> # '0101' is the code of Hi-net network
>>> data, ctable = client.get_waveform('0101', '201001010000', 20)
>>> # The request and downloading process will take several minutes
>>> # waiting data request ...
>>> # waiting data downloading ...
>>> ls  # the downloaded data and corresponding channel table
0101_201001010000_20.cnt 0101_20100101.ch
>>>
>>> # Let's convert data from win32 format to SAC format
>>> win32.extract_sac(data, ctable)
>>> ls *.SAC
N.NGUH.E.SAC  N.NGUH.U.SAC  N.NNMH.N.SAC
N.NGUH.N.SAC  N.NNMH.E.SAC  N.NNMH.U.SAC
...
>>> # Let's extract instrument response as PZ file from channel table
>>> win32.extract_pz(ctable)
>>> ls *.SAC_PZ
N.NGUH.E.SAC_PZ  N.NGUH.U.SAC_PZ  N.NNMH.N.SAC_PZ
N.NGUH.N.SAC_PZ  N.NNMH.E.SAC_PZ  N.NNMH.U.SAC_PZ
...

许可协议

本项目使用 MIT license 许可协议。