中的“文件%s的格式未知”Obspy.core公司阅读

2024-09-29 01:22:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用obspy.core公司但它似乎无法读取segy文件,如果文档中支持segy文件。在

我的代码:

from obspy.core import read
st = read(f1, unpack_trace_headers=True)

它会导致以下错误消息:

^{pr2}$

所以我试着指定格式:

st = read(f1, format='segy', unpack_trace_headers=True)

这是我得到的错误:

TypeError: Format "SEGY" is not supported. Supported types: 

在“支持的类型”之后:“没有…..没有!在

有什么想法吗?在


Tags: 文件代码文档coretrueread错误trace
2条回答

我用卸载obsby解决了我的问题

pip uninstall obspy

并按照以下链接中的说明进行安装: https://github.com/obspy/obspy/wiki/Installation-via-Anaconda

抱歉迟了回复:

Obspy可以读取segy文件

from obspy.io.segy.core import _read_segy

stream = _read_segy('segy_file', unpack_trace_headers = True)

#plot first trace
stream[0].plot()

# see all traces in the segy file
stream.traces

# find all trace headers
stream[0].stats.segy.trace_header

unpack用于从segy trace headers中解包所有跟踪头

Find here further details

相关问题 更多 >