資源簡介
地震資料處理解釋中用于讀取地震segy數據體的matlab程序,適用于初學者。
代碼片段和文件信息
function?seismic_data=?readsegyfile(filename)
%???union?SI?si;//采樣點數?
%???union?SP?sp;//定義采樣率?
%???union?Data?data;//定義數據?
%???union?Line?line;//線號?
%???union?Trace?trace;//道號?
%???union?X_cor?x_cor;//X坐標?
%???union?Y_cor?y_cor;//Y坐標?
%???Line_num?????/最大線號?
%???Trace_num????/最大道號?
fid=fopen(filename‘r‘);?
???if?~fid?
???{?
???????disp(‘can‘‘t?open?file!‘);?
???????exit;?
???}?;
???end?
??fseek(fid3220‘bof‘);??%讀取采樣點數?
??SI=fread(fid1‘int16‘‘b‘)?;
??fseek(fid3216‘bof‘);??%讀取采樣率?
??SP=fread(fid1‘int16‘‘b‘)?;
??fseek(fid?0?‘eof‘);?%計算總文件字節數?
??file_n=ftell(fid);?
??Tn?=(file_n-3600)/(SI*4+240)?;?%計算道數?
??fclose(fid);??
?seismic_data=zeros(SITn);???
?fid=fopen(filename‘r‘);?
???if?~fid?
???{?
???????disp(‘can‘‘t?open?file!‘);?
???????exit;?
???}?;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1523??2012-05-17?01:41??讀寫segy文件\readsegyfile.m
?????文件???????2981??2012-05-17?01:40??讀寫segy文件\writesegyfile.m
?????目錄??????????0??2013-06-04?16:45??讀寫segy文件
-----------?---------??----------?-----??----
?????????????????4504????????????????????3
評論
共有 條評論