%    USBLRDOT - Range rate, range and USBL time of detection subplots in one
%    large window.
%
%    B. A. Moran, 10-Dec-1997

%    Copyright (C) 1997-1998
%    Massachussetts Institute of Technology
%    Sea Grant AUV Laboratory
%    $Id: usblrdot.m,v 1.1 2000/01/10 19:08:40 rob Exp $


if exist( 'h_rdot' ) ~= 1
    h_rdot = figure;
    if strcmp( computer, 'SGI' )
        winpos( [100+100*rand 200+100*rand 800 600] );
    else
        winpos( position(2,:) );
    end
else
    h_rdot = figure( h_rdot );
end

set( h_rdot, 'name', 'USBL Range Rate', 'DeleteFcn', 'clear h_rdot');
ind = find( finite(data(:,m_usbl_time)) );


ind2 = find(finite(data(:,m_usbl_rdot_mean)));

subplot( 2, 1, 1 );
cla
plot( data(ind,m_present_time), data(ind,m_usbl_rdot), '+', ...
    data(ind,m_present_time), data(ind,m_usbl_rdot_mean), 'r' );
zoom on
set( gca, 'YLim', 4*[-1 1] )
title( 'USBL Range Rate' )
ylabel( 'velocity (m/s)' )


clrs = get( gca, 'ColorOrder' );

subplot( 2, 1, 2 );
cla

plot( data(ind,m_present_time), [0; diff(data(ind,m_usbl_time))], '+', ...
        'Color', clrs(3,:) ); set( gca, 'YLim', [0 6] );
zoom on
title( 'USBL Differential Detection Time' )
ylabel( 'reduced time (s)' )

clear clrs ind
