簡體   English   中英

使用 python 和 obspy 抽取文件

[英]Decimation of files with python and obspy

我正在嘗試對 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)

原始 MiniSEED 數據可能存儲為整數並使用僅整數壓縮 (STEIM) 進行壓縮。 讀取數據后,此元信息將與 Trace 對象一起保留。 在抽取過程中,應用過濾器將數據轉換為浮點數。 當您最后將數據寫入 MiniSEED 時,ObsPy 會查看仍然具有僅整數壓縮方案的元信息,並識別出它無法使用該壓縮方案寫入浮點數據。 然后它回退到編寫未壓縮的浮點 MiniSEED,所以這里真的沒有什么可擔心的。 畢竟只是一個警告,沒有錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM