⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_header_int2double.m

📁 基于Matlab的地震数据处理显示和测井数据显示于处理的小程序
💻 M
字号:
function seismic=s_header_int2double(seismic,header,fpformat)% Convert the bit pattern of integers in a header to floating point numbers % (used in case header values in an SEG-Y file should have been read as  % floating-point numbers)%% Background: By default (and following the SEG-Y standard), function % "read_segy_file" reads trace headers as two-byte or 4-byte integers. % However, some programs --- such as ProMAX --- allow users to put floating-point % numbers into the headers. Thus the values of these headers are read% incorrectly. This function converts header values read as integers to the% values they would have had they been read as floating point numbers.% % Written by: E. R.: June 30, 2005% Last updated:%%           seismic=s_header_int2double(seismic,header,fpformat)% INPUT% seismic   seismic data set% header    mnemonic of header to convert% fpformat  string with floating-point format (possible values are 'ibm' and 'ieee')% OUTPUT% seismic   seismic with converted header%       Find header to convertindex=header_index1(seismic,header);temp=seismic.headers(index,:);%       Write header to temporary filetempfile=fullfile(tempdir,'tempconversion');fid=fopen(tempfile,'w');fwrite(fid,temp,'int32');fclose(fid);%       Read temporary filefid=fopen(tempfile,'r');if strcmpi(fpformat,'ibm')   temp=ibm2ieee(fread(fid,inf,'uint'));elseif strcmpi(fpformat,'ieee')   temp=fread(fid,inf,'float32');else   error('Unknown floating point format')endseismic.headers(index,:)=temp;%       Close temporary filefclose(fid);try   if ispc      [ier,msg]=dos(['del ',tempfile]);   else      ier=unix(['rm -f ',tempfile]);   endcatchend

⌨️ 快捷键说明

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