function plotshd( filename )

% plots a single TL surface in dB

% open the file
fid = fopen( filename, 'r' );

% read

pltitl = fgetl( fid );
junk   = fgetl( fid );
junk   = fscanf( fid, '%f', 1 );
nsd    = fscanf( fid, '%i', 1 );
nrd    = fscanf( fid, '%i', 1 );
nrr    = fscanf( fid, '%i', 1 );

sd     = fscanf( fid, '%f', nsd );
rd     = fscanf( fid, '%f', nrd );
rr     = fscanf( fid, '%f', nrr );

isd = 1;
for i = 1:isd
   temp1   = fscanf( fid, '%f', [ 2 * nrr, nrd ] );
   i, size(temp1)
end

fclose( fid );

zt = rd;
taker = 1:nrr;
rt = rr( taker );

rkm = rt / 1000.0;

figure

tlt = 20.0 * log10( abs( temp1( 1:2:2*nrr, : )' + sqrt( -1 ) * temp1( 2:2:2*nrr, : )') );

% optionally remove cylindrical spreading:

% tlt = tlt + ones( nrd, 1 ) * 10.0 * log10( rt )';

pcolor( rt, zt, tlt );  caxis( [ -90 -50 ] ); ...
shading flat; colormap( jet ); colorbar; view( 0, -90 );
xlabel( 'Range (m)' ); ylabel( 'Depth (m)' );
title( deblank( pltitl ) )


