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