Skip to content
Snippets Groups Projects
plot_Interpolation.m 2.3 KiB
Newer Older
Yves Gouriou's avatar
Yves Gouriou committed
function plot_Interpolation( hMainFig, hPlotAxes, nPlot )

% Get tsg application data
% ------------------------
tsg  = getappdata( hMainFig, 'tsg_data');

% Get INTERPOLATED_VALUE code
% ---------------------------
INTERPOLATED_VALUE = tsg.qc.hash.INTERPOLATED_VALUE.code;
Yves Gouriou's avatar
Yves Gouriou committed
switch nPlot
  
  % ---------------------------------------------------------------------
  case 1

    erase_Line( hPlotAxes, 1 );

    % Find records with no position
    % -----------------------------
    if ~isempty( tsg.LATX ) && ~isempty( tsg.SSPS)

      ind = find( isnan(tsg.LATX) == 1 | isnan(tsg.LONX) == 1);
      if ~isempty( ind )
Yves Gouriou's avatar
Yves Gouriou committed
        plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD(ind), tsg.SSPS(ind), [],...
          'SSPS_NOPOS','b','none','*',2);
Yves Gouriou's avatar
Yves Gouriou committed
      end

      ind = find( isnan(tsg.LATX) == 0 | isnan(tsg.LONX) == 0);
      if ~isempty( ind )
Yves Gouriou's avatar
Yves Gouriou committed
        plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD(ind), tsg.SSPS(ind), [],...
          'SSPS','k','none','*',2);
      end
    end
Yves Gouriou's avatar
Yves Gouriou committed
    
%    set( hPlotAxes(1) ,'xlim', [tsg.DAYD(1) tsg.DAYD(end)] );
Yves Gouriou's avatar
Yves Gouriou committed

  % ---------------------------------------------------------------------
  case 2
    
    erase_Line( hPlotAxes, 2 );
     
    if ~isempty( tsg.LATX )
      plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD, tsg.LATX,[],...
        'LATX','k','none','*',2);
    end
    
   if ~isempty(tsg.POSITION_QC)
      ind = find( tsg.POSITION_QC == INTERPOLATED_VALUE );
      if ~isempty( ind )
        plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD(ind), tsg.LATX(ind),[],...
                 'LATX_INTERP','r','none','*',2);
      end
Yves Gouriou's avatar
Yves Gouriou committed
%   set( hPlotAxes(2) ,'xlim', [tsg.DAYD(1) tsg.DAYD(end)] );

    
Yves Gouriou's avatar
Yves Gouriou committed
  % ---------------------------------------------------------------------
  case 3
    erase_Line( hPlotAxes, 3 );
    
    if ~isempty( tsg.LONX )
      plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.LONX,[],...
        'LONX','k','none','*',2);
    end
    
    if ~isempty(tsg.POSITION_QC)
      ind = find( tsg.POSITION_QC == INTERPOLATED_VALUE );
      if ~isempty( ind )
        plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD(ind), tsg.LONX(ind),[],...
                  'LONX_INTERP','r','none','*',2);
      end
Yves Gouriou's avatar
Yves Gouriou committed
    
%   set( hPlotAxes(3) ,'xlim', [tsg.DAYD(1) tsg.DAYD(end)] );
Yves Gouriou's avatar
Yves Gouriou committed
end

axesCommonProp( hPlotAxes );

end