2

我正在尝试对 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)

4

1 回答 1

0

原始 MiniSEED 数据可能存储为整数并使用仅整数压缩 (STEIM) 进行压缩。此元信息在读取数据后与 Trace 对象一起保留。在抽取期间,应用过滤器,导致数据被转换为浮点数。当您最后将数据写入 MiniSEED 时,ObsPy 会查看仍然具有仅整数压缩方案的元信息,并识别出它无法使用该压缩方案写入浮点数据。然后它回退到编写未压缩的浮点 MiniSEED,所以这里真的没有什么可担心的。毕竟这只是一个警告,没有错误。

于 2019-03-21T10:43:50.660 回答