HinetPy
NIED Hi-net | Source Code | Documentation | 中文文档
HinetPy 是一个可用于申请和处理 NIED Hi-net 地震数据的 Python 包。
功能与特性
从 NIED Hi-net 申请连续/事件波形数据和地震目录
Support networks like Hi-net, F-net, V-net, S-net and more
基于不同的准则筛选 Hi-net/F-net 台站
将波形数据从 win32 格式转换为 SAC 格式
提取仪器响应信息并保存为 SAC 零极点文件
多线程并行下载和转换以加快速度
一个简单的示例
下面的示例展示了如何使用 HinetPy 从 Hi-net 申请连续波形数据,将数据转换为 SAC 格式,并提取 SAC 零极点格式的仪器响应文件。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from HinetPy import Client, win32
# You need a Hi-net account to access the data
client = Client("username", "password")
# Let's try to request 20-minute data of the Hi-net network (with an internal
# network code of '0101') starting at 2010-01-01T00:00 (JST, GMT+0900)
data, ctable = client.get_continuous_waveform("0101", "201001010000", 20)
# The request and download process usually takes a few minutes
# waiting for data request ...
# waiting for data download ...
# Now you can see the data and corresponding channel table in your working directory
# waveform data (in win32 format) : 0101_201001010000_20.cnt
# channel table (plaintext file) : 0101_20100101.ch
# Let's convert data from win32 format to SAC format
win32.extract_sac(data, ctable)
# Let's extract instrument response as PZ files from the channel table file
win32.extract_sacpz(ctable)
# Now you can see several SAC and SAC_PZ files in your working directory
# N.NGUH.E.SAC N.NGUH.U.SAC N.NNMH.N.SAC
# N.NGUH.N.SAC N.NNMH.E.SAC N.NNMH.U.SAC
# ...
# 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 许可协议。