Skip to content
Snippets Groups Projects
  • jacques.grelet_ird.fr's avatar
    4e1fd3a8
    incorporation d'un module de lecture d'un fichier .ini associé au fichier... · 4e1fd3a8
    jacques.grelet_ird.fr authored
    incorporation d'un module de lecture d'un fichier .ini associé au fichier labview contenant les attibuts globaux et coefficients de calibration.
    Definition d'un nouveau format pour ce fichier basé sur les conventions du fichier netcdf
    On a 3 variables de dimension 7 pour les coefficients calibration et 3 de dim 2 pour les coeffs de linearisation + autant de variables prefixées avec _CONV pour les cles (char array de 7x8 et 2x8)
    4e1fd3a8
    History
    incorporation d'un module de lecture d'un fichier .ini associé au fichier...
    jacques.grelet_ird.fr authored
    incorporation d'un module de lecture d'un fichier .ini associé au fichier labview contenant les attibuts globaux et coefficients de calibration.
    Definition d'un nouveau format pour ce fichier basé sur les conventions du fichier netcdf
    On a 3 variables de dimension 7 pour les coefficients calibration et 3 de dim 2 pour les coeffs de linearisation + autant de variables prefixées avec _CONV pour les cles (char array de 7x8 et 2x8)
plot_Tsg.m 2.55 KiB
function plot_Tsg( hTsgGUI, hAxes, PlotNum, X, Y, QC, para, colVal, ...
                   lineType, markType, markSize )
%
% Function to plot TSG parameters
% The program can plot parameter of style SSPS or SSPS_ADJUSTED
% in that last case we need to extract the name of the parameter
%
% Input
% -----
% hTsgGUI ........ Handle to the user interface
% hAxes   ........ Handle to the graphic axes
% PlotNum ........ Plot Number (used for the TAG)
% X
% Y
% QC ............. QC array - If empty plot using  Color specification
% para
% colVal ..........[]       - Draw Para taking into account color QC code
%                  'k''b'... - Draw Para using Color code 
% lineType ....... Matlab type : 'none', '-', '--', ':', '-.'
% markType ....... Matlab type
% markSize ....... Integer
% Para ........... Parametre whose difference with TSG data is plot
%
% $Id$

% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hTsgGUI, 'tsg_data');

if ~isempty( X ) && ~isempty( Y )
  
  % get axes
  % --------
  axes( hAxes(PlotNum) );

  % Plot using QC
  % -------------
  if ~isempty(QC)

    % get list of keys from hashtable tsg.qc.hash, defined inside
    % tsg_initialisation.m
    % -----------------------------------------------------------
    qc_list = get(tsg.qc.hash);

    % Plot Sample/TSG differences on axe 2
    % iterate (loop) on each key store inside hastable
    % ------------------------------------------------
    for i=1:numel(qc_list)

      % get key and some values in hashtable
      % ------------------------------------
      key   = qc_list{i};
      qcState = get(tsg.qc.hash, key, 'state');
      qcCode  = get(tsg.qc.hash, key, 'code');
      qcColor = get(tsg.qc.hash, key, 'color');

      % plot tsg salinity sample with right code/color
      % ----------------------------------------------
      ind = find( QC == qcCode );
      if ~isempty( ind )

        line( X(ind), Y(ind), ...
          'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para '_' key],...
          'LineStyle', lineType, ...
          'Marker', markType, 'MarkerSize', markSize, 'Color', qcColor);

      end
    end

  else

    line( X, Y, 'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para], ...
                'LineStyle', lineType, ...
                'Marker', markType, 'MarkerSize', markSize, 'Color', colVal);
  end
  
%   hold off;

  % Write some 'Y' label
  % ------------------
  set(get(hAxes(PlotNum), 'Ylabel'), 'Interpreter', 'none', 'String', para);

end