其他分享
首页 > 其他分享> > 【可视化】地震数据体Segy文件inline、xline道数据计算获取

【可视化】地震数据体Segy文件inline、xline道数据计算获取

作者:互联网

'''
    {
        "CDPMax": 792,
        "CDPMin": 58,
        "LineMax": 796,
        "LineMin": 510,
        "bps": 4,
        "dsf": 1,
        "dsfDesc": "IBM Float",
        "dt": 4000,
        "ns": 1252,
        "ntraces": 210945,
        "paramIndex": "[[21:24],[222:224]]",
        "segyType": 3
    }
'''
'''
inline和xline数据提取
1. 获取指定inline对应道行列的数据,比如inlineIndex在区间(LineMin,LineMax)
2. LineMax - LineMin + 1 = 列数量
3. CDPMax - CDPMin + 1 = 行数量
4. (行 + 1  ) * (列 + 1) = 总道数
5. inlineIndex 列上的道间距计算:
----列平移X:inlineIndex - LineMin
----起始道:(inlineIndex - LineMin) * 行数量 + 1
----终止道:(inlineIndex - LineMin + 1) * 行数量 
6. xlineIndex 行上的道间距数据计算,不连续需要逐个道提取
---行平移Y:xlineIndex - CDPMin
---起始道:第一列上的数据,从CDPMin到CDPMax,即xlineIndex - CDPMin + 1起算
---往右横向增加行数量,直到最后一列CDPMax
'''

'''
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
'''

 

#!/usr/bin/env python
# testsegy.py

import sys
import os
import json
from time import *


sys.path.append('../')

# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/2d.segy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/shotgather.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/1.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/A1.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/L3.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/lineE.sgy"

# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/seismic_marmousi-ii.segy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/shot.segy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/bigEndianIEEEFloat.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/2D/example_for_segy.segy"

fileName = "D:/3000_Seismic/Data/2D-3DData/3D/Kerry3D.segy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/3D/Sooner3D.sgy"
# fileName = "D:/3000_Seismic/Data/2D-3DData/3D/seismic850_1230_3D.sgy"

#########################################################################

#########################################################################
# inlineIndex = 510
# inlinePosTrace = getInlineTraceIndexArray(fileName,inlineIndex,SH)
# print(len(inlinePosTrace))
# print(inlinePosTrace)    

# inlineIndex = 796
# inlinePosTrace = getInlineTraceIndexArray(fileName,inlineIndex,SH)
# print(len(inlinePosTrace))
# print(inlinePosTrace)


# xlineIndex = 58
# xlinePosTrace = getXlineTraceIndexArray(fileName,xlineIndex,SH)
# print(len(xlinePosTrace))
# print(xlinePosTrace)
# xlineIndex = 792
# xlinePosTrace = getXlineTraceIndexArray(fileName,xlineIndex,SH)
# print(len(xlinePosTrace))
# print(xlinePosTrace)

#########################################################################

begin_time = time()

inlineIndex = 510
inlinePosTrace = getSegyTraceDataByInlineIndex(fileName,inlineIndex)
print(len(inlinePosTrace))
print(len(inlinePosTrace[0]))

inlineIndex = 796
inlinePosTrace = getSegyTraceDataByInlineIndex(fileName,inlineIndex)
print(len(inlinePosTrace))
print(len(inlinePosTrace[0]))


xlineIndex = 58
xlinePosTrace = getSegyTraceDataByXlineIndex(fileName,xlineIndex)
print(len(xlinePosTrace))
print(len(xlinePosTrace[0]))

xlineIndex = 792
xlinePosTrace = getSegyTraceDataByXlineIndex(fileName,xlineIndex)
print(len(xlinePosTrace))
print(len(xlinePosTrace[0]))

end_time = time()
run_time = end_time-begin_time
print ('该程序运行时间(s):',run_time) 

 

标签:xline,Segy,inlineIndex,fileName,2D,3000,print,inline,Seismic
来源: https://www.cnblogs.com/defineconst/p/15896143.html