getnshot.m

来自「这是matlab在地球物理数据处理方面的源码」· M 代码 · 共 34 行

M
34
字号
% ********************************
% *** Program GetnShot         ***
% *** Read a shot gather from  ***
% *** a segy file              ***
% *** files must be named      ***
% *** nshot000.sgy             ***
% *** Written by Y. Bouzidi    ***
% *** U. of Alberta, Physics   ***
% ********************************
%
% *** inputs: ShotNumber ***
% *** outputs: traces and their offsets ***
%
      function [traces,offset]=GetnShot(ShotNumber);
      nt=1250;
      nx=48;  
      str='nshot000.sgy';
      s=num2str(ShotNumber);
      if(ShotNumber<10)
        str(8:8)=s;
      else
        str(7:8)=s;
      end
      fid=fopen(str,'r','l');
      fseek(fid,3600,'bof');
      traces=reshape(fread(fid,nx*(nt+60),'float'),nt+60,nx);
      ntraces=traces(61:nt+60,:);
      traces=ntraces;
      fclose(fid)
      [offset]=GetOffset(str,1,nx);
      return
%
% *** end of program ***

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?