?? readarrivalsasc.m
字號(hào):
function [ amp, delay, SrcAngle, RcvrAngle, NumTopBnc, NumBotBnc, narrmat, nsd, nrd, nr, sd, rd, rr ] ...
= read_arrivals_asc( ARRFIL, narrmx );
% read_arrivals_asc
% useage:
%[ amp, delay, narrmat, nsd, nrd, nr, sd, rd, rr ] ...
% = read_arrivals_asc( ARRFIL, narrmx );
%
% Loads the arrival time/amplitude data computed by BELLHOP
% You must set the string ARRFIL specifying the Arrivals File
% narrmx specifies the maximum number of arrivals allowed
% mbp 9/96
%
%Modded by A Duncan
ExpectBounceCounts = 1; %1 if version of bellhop produces counts of interface bounces for each path, 0 otherwise
if ExpectBounceCounts
NField = 7;
else
NField = 4;
end
fid = fopen( ARRFIL, 'r'); % open the file
% read the header info
freq = fscanf( fid, '%f', 1 );
nsd = fscanf( fid, '%i', 1 );
nrd = fscanf( fid, '%i', 1 );
nr = fscanf( fid, '%i', 1 );
sd = fscanf( fid, '%f', nsd );
rd = fscanf( fid, '%f', nrd );
rr = fscanf( fid, '%f', nr );
% loop to read all the arrival info (delay and amplitude)
amp = zeros( nr, 100, nrd, nsd );
delay = zeros( nr, 100, nrd, nsd );
narrmat = zeros(nr, nrd, nsd);
for isd = 1:nsd
for ird = 1:nrd
for ir = 1:nr
narr = fscanf( fid, '%i', 1 ); % number of arrivals
narrmat( ir, ird, isd ) = narr;
if narr > 0 % do we have any arrivals?
da = fscanf( fid, '%f', [ NField, narr ] );
amp( ir, 1:narr, ird, isd ) = da( 1, : ) .* exp( i * da( 2, : )*pi/180);
delay( ir, 1:narr, ird, isd ) = da( 3, : );
SrcAngle( ir, 1:narr, ird, isd ) = da( 4, : );
if ExpectBounceCounts
RcvrAngle( ir, 1:narr, ird, isd ) = da( 5, : );
NumTopBnc( ir, 1:narr, ird, isd ) = da( 6, : );
NumBotBnc( ir, 1:narr, ird, isd ) = da( 7, : );
else
RcvrAngle = [];
NumTopBnc = [];
NumBotBnc = [];
end
end
end % next receiver range
end % next receiver depth
end % next source depth
fclose( fid );
%amp = amp( :, 1:narrmx, :, : );
%delay = delay( :, 1:narrmx, :, : );
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -