• 【可视化】地震数据体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) 
  • 相关阅读:
    eslint 入门学习
    sqlite数据库 select 查询带换行符数据
    (ios)ARC常用设置,部分文件编译设置ARC
    (ios实战)ios调试总结(转载)
    IOS沙盒Files目录说明和常用操作
    (Ios 实战) 自定义UITableView
    iphone,pad等真机不被xcode识别,解决方法
    Xcode模拟器和真机生成的日志查看(转载)
    项目管理(转载)
    互联网教育,未来当有这10个特质(转载)
  • 原文地址:https://www.cnblogs.com/defineconst/p/15896143.html
Copyright © 2020-2023  润新知