我正在尝试对mseed格式的文件进行抽取。现在我使用的是这段代码。
import numpy as np
import matplotlib.pyplot as plt
import obspy
import sys
with open(sys.argv[1],"rb") as fh:
fh.seek(512)
st = obspy.read(fh)
tr = st[0]
tr_new = tr.copy()
tr_new.decimate(factor=5, strict_length=False)
tr_new.write(sys.argv[1] + ".20sps",format="mseed")
tr_filt = tr.copy()
tr_filt.filter('lowpass', freq=0.4 * tr.stats.sampling_rate / 4.0)
t = np.arange(0, tr.stats.npts / tr.stats.sampling_rate, tr.stats.delta)
t_new = np.arange(0, tr_new.stats.npts / tr_new.stats.sampling_rate,
tr_new.stats.delta)
但是当我运行它时,我得到了以下错误。
Analizando: /home/miguel/Documentos/mseed_decimacion/HHZ.D/caig.ig.hhz.d.2018.107.0000
/usr/lib/python2.7/dist-packages/obspy/io/mseed/core.py:772: UserWarning: The encoding specified in trace.stats.mseed.encoding does not match the dtype of the data.
A suitable encoding will be chosen.
warnings.warn(msg, UserWarning)
发布于 2019-03-21 18:43:51
原始MiniSEED数据可能存储为整数,并使用仅整数压缩(STEIM)进行压缩。读取数据后,此元信息与Trace对象一起保留。在抽取过程中,会应用滤波器,从而将数据转换为浮点数。然后,当您在最后将数据写入MiniSEED时,ObsPy会查看仍然具有仅整数压缩方案的元信息,并识别出它不能使用该压缩方案写入浮点数据。然后,它又回到了编写未压缩的浮点MiniSEED,所以这里真的没什么好担心的。毕竟这只是一个警告,没有错误。
https://stackoverflow.com/questions/50418351
复制相似问题