国产的SEED格式数据存在一些问题,主要是由于记录中因数据重叠或断记等原因处理不当,在使用一些专业软件进行格式转化时,往往会出现一些小问题。
以往我进行这类工作时,主要使用广东省地震局提供的Event2SAC.sh脚本完成数据转换,再自己编写一些基于SAC代码或matlab代码的脚本完成数据合并工作。
这样做可以完成格式转换和合并,但操作比较复杂,需要安装的软件较多,要转到linux操作下工作,时间消耗也比较长。
近期,为了完成某个研究任务,需要在windows系统下,快速实现上述功能,就自己利用python下的obspy模块,编写了一个脚本,经测试,这个脚本完全可以在python下,
独立完成格式转化和数据合并任务,应用简单,效率也不错。下面把这个脚本分享给大家:
import obspy
import warnings
import os
warnings.filterwarnings("ignore")
delta = 100 # 仪器采样率
# 国产SEED格式文件为BJT,文件开始时间为文件名前一天的16时,因此合并后的第1个完整的世界时以天为单位的数据是目录中第2个
# 文件名中日期,要注意要想转换合并一年的完整数据,要在目录中加入上一年最后一个BJT的SEED文件,和下一年中第1个BJT文件。
data_path = r'F:\JL\CBS\2020' # 需要转换格式,合并数据的文件目录,此目录中存放的是SEED格式原始数据文件
ou