%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PURPOSE: Plot items related to the lbl navigation estimator.
% AUTHOR:  rsm
% DATE:    00/8/20
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

  if( (exist('nfix') ~= 1) & (exist('nfix_sa') ~= 1) ), return, end;

  if( (norm(dataNav(:,filter_north))    == 0) & ...
      (norm(dataNav(:,filter_north_sa)) == 0)  ), 
    return, 
  end;

  str = [' ',titleStr,' Plotted on ',myDate];
  PaperPosn = [.5 .5 3.75 2.5];
  FigurePosn = [5 30 815 760];
  i = 0;


  if exist( 'kalfig' ) ~= 1
    kalfig = figure;
    winpos( position(1,:) );
  else
    figure(kalfig);
  end
  set( kalfig, 'Name', 'LBL Kalman Filter Plot', 'DeleteFcn', 'clear kalfig' );
%
% This uses variables created by navplot; posx0 and posy0.
%
  nstrips = 7;
  subplot(nstrips,1,1)
  plot(dataNav(:,1), dataNav(:,filter_north)-posx0);
  ylabel('Northing')
%  xlabel('Elapsed Time (s)');
  title(strvcat('Kalman Filter States; ',...
	        ['Initial UTM Coord North = ', num2str(posx0),' ',...
		 'East = ', num2str(posy0)], ...
		str))
  grid on
  zoom on

  subplot(nstrips,1,2)
  plot(dataNav(:,1), dataNav(:,filter_east)-posy0);
  ylabel('Easting')
%  xlabel('Elapsed Time (s)');
  grid on;
  zoom on;

  subplot(nstrips,1,3)
  plot(dataNav(:,1), dataNav(:,filter_depth));
  ylabel('Depth')
%  xlabel('Elapsed Time (s)');
  grid on;
  zoom on;

  subplot(nstrips,1,4)
  plot(dataNav(:,1), dataNav(:,north_current));
  ylabel('N Current')
%  xlabel('Elapsed Time (s)');
  grid on;
  zoom on;

  subplot(nstrips,1,5)
  plot(dataNav(:,1), dataNav(:,east_current));
  ylabel('E Current')
%  xlabel('Elapsed time (s)');
  grid on;
  zoom on;

  subplot(nstrips,1,6)
  plot(dataNav(:,1), dataNav(:,speed_bias));
  ylabel('Spd Bias')
%  xlabel('Elapsed Time (s)');
  grid on;
  zoom on;

  subplot(nstrips,1,7)
  plot(dataNav(:,1), dataNav(:,heading_bias)*r2d);
  ylabel('Hdg Bias')
  xlabel('Elapsed Time (s)');
  grid on;
  zoom on;




