%    LBLVALID - script to plot lbl navigation reply validity
%
%    B. A. Moran, 16-Jun-1997

%    Copyright (C) 1995-1998, Massachussetts Institute of Technology
%    Sea Grant Autonomous Underwater Vehicles Laboratory
%    $Id$	

if exist( 'h_val' ) ~= 1
    h_val = figure;
    winpos( [100+100*rand 100+50*rand 800 800] );
else
    h_val = figure(h_val);
end

set( h_val, 'Name', 'LBL Valid', 'DeleteFcn', 'clear h_val' );
clrs = get( gca, 'ColorOrder' );

chv = [m_lbl_valid1 m_lbl_valid2 m_lbl_valid3 m_lbl_valid4];

ind = find( any(finite(data(:,chv))')' );

for ii = 1:length(chv)
    subplot( length(chv), 1, ii );
    plot( time(ind), data(ind,chv(ii)), 'o', 'color', clrs(ii,:) );
    set( gca, 'ytick', 0:4, 'yticklabel', 'old|long|med|err|good' );
    ylabel( ['Ch ' num2str(ii)] );
end
