2016-05-04 41 views
2

我試圖用obspy.core讀取segy文件,但它似乎無法讀取segy文件,並且如果在文檔segy文件中受支持。Obspy.core中「文件%s的未知格式」讀取

我的代碼:

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

它導致此錯誤消息:

TypeError: Unknown format for file myfile.segy 

於是,我就指定格式:

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

這是我得到的錯誤:

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

「支持的類型:」之後有.....什麼也沒有!

任何想法?

回答

1

對不起,反應遲緩:

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跟蹤標頭解包所有跟蹤標頭

Find here further details