function plotshdpol( filename )

% plots a single TL surface in dB (polar coordinates)

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

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

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

rkm = rt / 1000.0;

% make plot polar

[th, r ] = meshgrid( zt, rkm );
th = ( 2 * pi / 360. ) * th;   % convert to radians
[x, y] = pol2cart( th, r );

xs = -12.0
ys =  13.8
%xs = -35.0 ;
%ys =   8.0.;

x = x + xs * ones( size( x ) );
y = y + ys * ones( size( x ) );

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

% *** plot ***

figure
surfc( x, y, tlt ); shading flat; ...
colormap( jet ); caxis( [ -90 -60 ] ); colorbar; view( 2 )
xlabel( 'Range (m)' ); ylabel( 'Range (m)' );
title( deblank( pltitl ) )

% box for Case 1

xbtank = [ 0.65 0.65 1.50 1.50 1.30 1.30 0.65 ];
ybtank = [ 0.90 2.20 2.20 1.30 1.30 0.90 0.90 ];

xb = -ybtank;
yb =  xbtank;
hold on
plot( xb, yb )
axis( [ min( xb ) max( xb ) min( yb ) max( yb ) ] );

% box for Case 2

xbtank = [ 0.85 0.85 0.80 0.80 1.70 1.70 0.85 ];
ybtank = [ 3.00 3.60 3.60 4.60 4.60 3.00 3.00 ];

xb = -ybtank;
yb =  xbtank;
hold on
%plot( xb, yb )

%axis( [ min( xb ) max( xb ) min( yb ) max( yb ) ] );
