python处理地震sac数据_自己开发的一个SEED格式地震数据转换为SAC格式数据,并完成世界时整天波形合并的Python脚本...

本文介绍了一种使用Python的obspy模块编写的脚本,该脚本能处理国产SEED格式地震数据,将其转换为SAC格式并合并全天波形。脚本解决了数据重叠或断记导致的问题,简化了格式转换和合并过程,适用于Windows系统。
摘要由CSDN通过智能技术生成

国产的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

% Known encoding formats are the following FDSN codes: % 0: ASCII % 1: 16-bit integer % 2: 24-bit integer (untested) % 3: 32-bit integer % 4: IEEE float32 % 5: IEEE float64 % 10: Steim-1 % 11: Steim-2 % 12: GEOSCOPE 24-bit (untested) % 13: GEOSCOPE 16/3-bit gain ranged % 14: GEOSCOPE 16/4-bit gain ranged (untested) % 19: Steim-3 (alpha and untested) % % See also MKMSEED to export data in miniSEED format. % % % Author: Franois Beauducel % Institut de Physique du Globe de Paris % Created: 2010-09-17 % Updated: 2012-04-21 % % Acknowledgments: % Ljupco Jordanovski, Jean-Marie Saurel, Mohamed Boubacar, Jonathan Berger, % Shahid Ullah. % % References: % IRIS (2010), SEED Reference Manual: SEED Format Version 2.4, May 2010, % IFDSN/IRIS/USGS, http://www.iris.edu % Trabant C. (2010), libmseed: the Mini-SEED library, IRIS DMC. % Steim J.M. (1994), 'Steim' Compression, Quanterra Inc. % History: % [2012-04-21] % - Correct bug with Steim + little-endian coding % (thanks to Shahid Ullah) % [2012-03-21] % - Adds IDs for warning messages % [2011-11-10] % - Correct bug with multiple channel name length (thanks to % Jonathan Berger) % [2011-10-27] % - Add LocationIdentifier to X.ChannelFullName % [2011-10-24] % - Validation of IEEE double encoding (with PQL) % - Import/plot data even with file integrity problem (like PQL) % [2011-07-21] % - Validation of ASCII encoding format (logs) % - Blockettes are now stored in substructures below a single % field X.BLOCKETTES % - Add import of blockettes 500 and 2000 % - Accept multi-channel files with various data coding % [2010-10-16] % - Alpha-version of Steim-3 decoding... % - Extend output parameters with channel detection % - Add gaps and overlaps on plots % - Add possibility to force the plot % [2010-10-02] % - Add the input formats for GEOSCOPE multiplexed old data files % - Additional output argument with gap and overlap analysis % - Create a plot when no output argument are specified % - Optimize script coding (30 times faster STEIM decoding!) % % [2010-09-28] % - Correction of a problem with STEIM-1 nibble 3 decoding (one % 32-bit difference) % - Add reading of files without blockette 1000 with additional % input arguments (like Seismic Handler output files). % - Uses warning() function instead of fprintf().
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值