diff --git a/@tsg_nc/tsg_platform.csv b/@tsg_nc/tsg_platform.csv index a35749fbd8292556b335461d588d2a694502fda4..06d599ec2c9e695c480e4fe881926b78c8dd39f1 100644 --- a/@tsg_nc/tsg_platform.csv +++ b/@tsg_nc/tsg_platform.csv @@ -1,7 +1,5 @@ -% tsg_platform.csv: 15 members & 2 lines with data; VERSION = 1.4840 +% tsg_platform.csv: 14 members & 0 lines with data; VERSION = 1.4850 % % id;PLATFORM_NAME;SHIP_CALL_SIGN;SHIP_MMSI;PROJECT_NAME;TYPE_TSG;NUMBER_TSG;TYPE_TINT;NUMBER_TINT;SAMPLING_PERIOD;SSPS_DEPH;SSPS_DEPH_MIN;SSPS_DEPH_MAX;SSTP_DEPH;SSTP_DEPH_MIN;SSTP_DEPH_MAX;DATE_TSG;endl -char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float -#;PACIFIC ISLANDER 2;;;;;;;;;8;6.000000;10.000000;NaN;NaN;NaN;;# -#;Atalante;;;;;;;;;3;2.600000;3.400000;3.000000;2.600000;2.600000;;# +char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float diff --git a/ReleaseNotes b/ReleaseNotes index 8c8b68b60bbbd0df5187ae620d9e9d891aadb7b3..4ebff3d564b27056757edb6c3cd1a4258e048b63 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -1,6 +1,13 @@ TSG-QC Release notes Contact: jacques.grelet@ird.fr +v1.48.5rc3 (2018-09-11) ++ add command line argument DEBUGGING option ++ remove tsg_icon from matlabpath at the end of program tsgqc ++ swap and improve error message in read_Climatology function ++ add climatology menu on map to disable/enable 2D climatology ++ remove/comment set(hAxes(PlotNum), 'YLimMode', 'auto'); in plot_Tsg.m + v1.48.5rc2 (2018-09-06) + regression on labview read file: the use of lat_dec and lon_dec by default introduced a bug, lat_mn and lon_mn could not be read. Returns to the default diff --git a/compiler/Windows (x86)/R2012b/tsgqc.prj b/compiler/Windows (x86)/R2012b/tsgqc.prj index daab37f24accb68ab7cfece90c2cc6b828a50f03..67c070b535fbe66849bcc4145c267e8a29446965 100644 --- a/compiler/Windows (x86)/R2012b/tsgqc.prj +++ b/compiler/Windows (x86)/R2012b/tsgqc.prj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <deployment-project plugin="plugin.deploytool" plugin-version="1.0"> - <configuration target="target.standalone" target-name="Console Application" name="tsgqc" location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\R2012b" file="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\R2012b\tsgqc.prj" build-checksum="1887185077"> + <configuration target="target.standalone" target-name="Console Application" name="tsgqc" location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\R2012b" file="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\R2012b\tsgqc.prj" build-checksum="2601449902"> <param.project.name>C:\svn\tsg-qc\trunk\compiler\Windows (x86)\R2012b\tsgqc.prj</param.project.name> <param.target.type>Console Application</param.target.type> <param.appname>tsgqc</param.appname> @@ -91,8 +91,8 @@ <matlab> <root>C:\Program Files (x86)\MATLAB\R2012b</root> <path> - <directory>C:\svn\oceano\trunk\lib\matlab</directory> <directory>C:\Users\jgrelet\Documents\MATLAB</directory> + <directory>C:\svn\oceano\trunk\lib\matlab</directory> <directory>C:\svn\tsg-qc\trunk</directory> <directory>C:\Users\jgrelet\Documents\MATLAB\toolbox\m_map</directory> <directory>${MATLAB_ROOT}\toolbox\matlab\demos</directory> @@ -149,7 +149,11 @@ <directory>${MATLAB_ROOT}\toolbox\matlab\system</directory> <directory>${MATLAB_ROOT}\toolbox\matlab\timeseries</directory> <directory>${MATLAB_ROOT}\toolbox\matlab\hds</directory> + <directory>C:\svn\tsg-qc\trunk\tsg_util</directory> + <directory>C:\svn\tsg-qc\trunk\tsg_data</directory> + <directory>C:\svn\tsg-qc\trunk\tsg_io</directory> <directory>C:\svn\tsg-qc\trunk\tsg_icon</directory> + <directory>C:\svn\tsg-qc\trunk\tsg_map</directory> </path> </matlab> <platform> diff --git a/tsg_io/private/lbvParameterChoice.m b/tsg_io/private/lbvParameterChoice.m index 91ba3f04e9d6292f8e43212154e80317ed313fb5..919681ae0558ae78be0c6b000b35d5175668b22f 100644 --- a/tsg_io/private/lbvParameterChoice.m +++ b/tsg_io/private/lbvParameterChoice.m @@ -14,6 +14,8 @@ function [colParaNo, error] = lbvParameterChoice( header ) % colParaNo .......... Column/line of the chosen parameter % error .............. 1: OK ; -1 : an error occured +global DEBUGGING + % Initialisation % -------------- error = -1; diff --git a/tsg_io/readTsgIniLabview.m b/tsg_io/readTsgIniLabview.m index dbd111183cbbf6141519e10c87e31e37515e347f..a79d9b02d14240206d3126974ed3903e34dffb39 100644 --- a/tsg_io/readTsgIniLabview.m +++ b/tsg_io/readTsgIniLabview.m @@ -13,6 +13,8 @@ function readTsgIniLabview(hMainFig, fid) % % $Id$ +global DEBUGGING + % Get the tsg struct from the application GUI % ------------------------------------------- tsg = getappdata( hMainFig, 'tsg_data'); @@ -79,7 +81,9 @@ while ~feof(fid) % for debbuging only % ------------------ - fprintf('%s -> %s\n', clef, tsg.(clef)); + if DEBUGGING + fprintf(1, '%s -> %s\n', clef, tsg.(clef)); + end continue end @@ -154,7 +158,9 @@ while ~feof(fid) % for debbuging only % ------------------ - fprintf('%s => %s\n', clef, tsg.(clef)); + if DEBUGGING + fprintf(1,'%s => %s\n', clef, tsg.(clef)); + end case 2 @@ -166,7 +172,9 @@ while ~feof(fid) % for debbuging only % ------------------ + if DEBUGGING fprintf('%s => %f\n', clef, tsg.(clef)); + end end @@ -261,7 +269,9 @@ while ~feof(fid) % for debbuging only % ------------------ - fprintf('%s: %s -> %f\n', clef, k, v); + if DEBUGGING + fprintf('%s: %s -> %f\n', clef, k, v); + end case 2 @@ -273,7 +283,9 @@ while ~feof(fid) % for debbuging only % ------------------ - fprintf('%s: %f\n', clef, tsg.(clef)); + if DEBUGGING + fprintf('%s: %f\n', clef, tsg.(clef)); + end end % quit for loop diff --git a/tsg_io/read_Climatology.m b/tsg_io/read_Climatology.m index 613d6e4c4e17008d6b55f7be9af1efb4a09af6f5..145cea76583b14bfa584bfeac6de2086a9072be9 100644 --- a/tsg_io/read_Climatology.m +++ b/tsg_io/read_Climatology.m @@ -20,6 +20,8 @@ function read_Climatology(hMainFig) % % $Id$ +global DEBUGGING + % Get data % ----------------------- tsg = getappdata( hMainFig, 'tsg_data' ); @@ -45,11 +47,13 @@ if strcmp( tsg.levitus.type, 'none') || ~strcmp(tsg.levitus.type, s.type) ... % check for file existence % ------------------------ if ~exist(file, 'file') - errordlg({['NetCDF climatology file: ' theFile], ... - 'is wrong type or obsolete. Internal structure as changed',... - 'Download new one from: ',... + % show dialog box with help to get climatology file + % ------------------------------------------------- + errordlg({['NetCDF climatology file: ', theFile], ... + 'not present in you Matlab path.',... + 'Check your Matlab path or download the file from',... strcat('ftp://ftp.ifremer.fr/ifremer/ird/us191/oceano/lib/matlab/', theFile)},... - 'NetCDF climatology file error'); + 'NetCDF climatology file access error'); % disable climatology toolbar hdl = findobj( '-regexp', 'tag', 'PUSHTOOL_CLIM'); @@ -60,7 +64,9 @@ if strcmp( tsg.levitus.type, 'none') || ~strcmp(tsg.levitus.type, s.type) ... % open netcdf climatology file % ---------------------------- levitus = read_file_woa(file); - fprintf(1, 'Read climato: %s\n', file); + if DEBUGGING + fprintf(1, 'Read climatology file: %s\n', file); + end % check if the new climatology format is used: % before V1.0RC5, structure was levitus.WOA01_TIME @@ -86,13 +92,11 @@ if strcmp( tsg.levitus.type, 'none') || ~strcmp(tsg.levitus.type, s.type) ... else - % show dialog box with help to get climatology file - % ------------------------------------------------- - errordlg({'NetCDF climatology file :', file, ... - 'not present in you path',... - 'Check your matlab path or download it from',... + errordlg({['NetCDF climatology file: ' theFile], ... + 'is wrong type or obsolete. Internal structure as changed',... + 'Download new one from: ',... strcat('ftp://ftp.ifremer.fr/ifremer/ird/us191/oceano/lib/matlab/', theFile)},... - 'NetCDF climatology file access error'); + 'NetCDF climatology file error'); % init tsg.levitus state % ---------------------- diff --git a/tsg_util/plot_Tsg.m b/tsg_util/plot_Tsg.m index 710385e5a6a25799275b084bbeb642bcfab3f435..a71d8bd37f2ba4cc60fef2d9809477018a922aa5 100644 --- a/tsg_util/plot_Tsg.m +++ b/tsg_util/plot_Tsg.m @@ -100,7 +100,7 @@ set(get(hAxes(PlotNum), 'Ylabel'), 'Interpreter', 'none', 'String', para); % update axes YLim property after zoom and with a new parameter % ------------------------------------------------------------- -set(hAxes(PlotNum), 'YLimMode', 'auto'); +% set(hAxes(PlotNum), 'YLimMode', 'auto'); diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index 5f78cc9350162cc5e42a42654a1de01fa8f52ed1..0942abcf84dbfc2a7d9dcea4789d381d20537067 100644 --- a/tsg_util/plot_map.m +++ b/tsg_util/plot_map.m @@ -35,7 +35,7 @@ set(get(hPlotAxes(4), 'parent'), 'pointer', 'watch'); % -------------------- border = tsg.preference.map_border; -% Retrieve map resolution +% Retrieve map resolution % set 'checked' property to 'on' for current map resolution if user % change it from menu option/preferences % ------------------------------------------------------------ @@ -123,13 +123,15 @@ if ~isempty( ind ) lon = LONX(indLon); lat = LATX(indLat); - % plot climatogogy - m_pcolor(lon, lat, climato(indLat, indLon)); - shading flat; - %colormap(m_colmap('jet','step',10)); - colorbar; - else - colorbar('off'); + % plot 2D climatogogy on map + if tsg.preference.map_climatology + m_pcolor(lon, lat, climato(indLat, indLon)); + shading flat; + %colormap(m_colmap('jet','step',10)); + colorbar; + else + colorbar('off'); + end end % select map type and resolution @@ -252,11 +254,11 @@ if ~isempty( ind ) % Write title % ----------- - if strcmp(get(hdl, 'state'), 'on') % if climato selected + if tsg.preference.map_climatology % if climato selected on 2D map climato_title = sprintf(' - climatology: %s %s', tsg.levitus.version,... tsg.levitus.type); else - climato_title = ''; + climato_title = ''; end title( ['Cruise: ' tsg.file.name climato_title], 'fontsize',tsg.fontSize +2, ... 'fontweight', 'bold','interpreter','none'); diff --git a/tsg_util/preferencesForm.m b/tsg_util/preferencesForm.m index b9851b4563cf96e85237f732441533fc7d5fb746..29ed60a124080ebc501aac0c7d81ccd168d5b94d 100644 --- a/tsg_util/preferencesForm.m +++ b/tsg_util/preferencesForm.m @@ -10,6 +10,8 @@ function error = preferencesForm(hTsgGUI) % % $Id$ +global DEBUGGING + error = -1; % Get the data from the application GUI @@ -935,8 +937,9 @@ uiwait(hPreferencesFig); % The climatology level are not the same between WOA and ISAS % ----------------------------------------------------------- function update_climato_depth(obj, event) - % debug - % disp(get(prefs.PREFERENCES_CLIMATOLOGY_VALUE, 'value')) + if DEBUGGING + disp(get(prefs.PREFERENCES_CLIMATOLOGY_VALUE, 'value')) + end if get(prefs.PREFERENCES_CLIMATOLOGY_VALUE, 'value') == 1 set(prefs.PREFERENCES_CLIMATOLOGY_DEPTH, 'string', {'0', '10'}); else diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m index b5d9a6343d97932dbad37099129eaf6b7a113285..51faf7a4631aade0c7918fb667c8242a6f512942 100644 --- a/tsg_util/tsg_preferences.m +++ b/tsg_util/tsg_preferences.m @@ -17,7 +17,7 @@ function ok = tsg_preferences(hTsgGUI, app_name, DEFAULT_PATH_FILE) % global variable VERSION, update revision number when tsg structure change % ------------------------------------------------------------------------- -global VERSION CHAR_VERSION DATE_VERSION +global VERSION CHAR_VERSION DATE_VERSION DEBUGGING % Initialize loading preference file waitbar % ------------------------------------------ @@ -30,8 +30,11 @@ waitbar( 1/10, wb, 'loading structure tsg' ); % Construct config file path % -------------------------- config_file = [prefdir, filesep, app_name, '.mat']; -% debug -% config_file + +% Debug +if DEBUGGING + fprintf(1, 'Configuration file is %s\n', config_file); +end % Open config file % ---------------- @@ -76,7 +79,7 @@ switch fid % quit program % ------------ ok = false; - return + return end @@ -116,6 +119,12 @@ updateTsgStructWithSmoothVars(hTsgGUI) % ------------------------------- tsg_initialisation(hTsgGUI); +% debug +% ------ +if DEBUGGING + disp(tsg.preference) +end + % display waitbar % --------------- waitbar( 1/2, wb, 'loading structure tsg' ); @@ -129,7 +138,7 @@ close(wb) set(hTsgGUI,'Pointer','arrow'); ok = true; -return +return % ---------------------------------------------------------------------- % nested function new_config @@ -160,6 +169,7 @@ return preference.map_border_string = {'0','1','2','5','10','15'}; preference.map_border_value = 4; preference.map_border = 5; % default + preference.map_climatology = 1; preference.plot_connected_string = {'none', '-', '--', ':', '-.'}; preference.plot_connected_value = 1; % 0, line not connected % QC test @@ -195,6 +205,11 @@ return % ------------------------------------ preference.ws_timediff = '5'; + % debug + % ------ + if DEBUGGING + fprintf(1, 'Reload default configuration file\n'); + end % save preference struct to 'prefdir.mat' file % --------------------------------------------- diff --git a/tsgqc.m b/tsgqc.m index d89d91411ff410d66175298153c8d8414f7bc06c..1b07086206652295d904d4c9e87401e9aab18dfa 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -38,13 +38,14 @@ global VERSION global CHAR_VERSION global DATE_VERSION global GOSUD_FORMAT_VERSION +global DEBUGGING % version number, may be used to initialize some files when it change % 0.90x -> 1.0RCx % ------------------------------------------------------------------- VERSION = 1.485; % -> 1.44 -CHAR_VERSION = '1.48.5RC2'; -DATE_VERSION = '06/09/2018'; +CHAR_VERSION = '1.48.5RC3'; +DATE_VERSION = '10/09/2018'; % netcdf file version, see DATA FORMAT TSG document: % CORTSG_format_gosud.doc @@ -126,8 +127,9 @@ guiLimits(4) = guiLimits(4) - 0.15; % -------------------- inputFile = ''; outputFile = ''; -display = 'off'; -help = 'off'; +display = false; +DEBUGGING = false; +help = false; % parse and set optional arguments with couple 'property', 'value' % ----------------------------------------------------------------- @@ -146,6 +148,8 @@ while length(property_argin) >= 2 outputFile = value; case 'display' display = value; + case 'debug' + DEBUGGING = value; case 'help' help = value; otherwise @@ -155,7 +159,7 @@ end % if property display is set to display, display them and quit % ----------------------------------------------------------- -if strcmp(display, 'on') +if display fprintf('inputFile: %s\noutpuFile: %s\n', inputFile, outputFile); return; end @@ -166,8 +170,9 @@ if strcmp(help, 'on') fprintf('tsgqc\n'); fprintf('tsgqc(''<file>'')\n'); fprintf('tsgqc(''inputfile'', <file>, ''outputfile'', <file>)\n'); - fprintf('tsgqc(''inputfile'', <file>, ''outputfile'', <file>),''display'',''on''\n'); - fprintf('tsgqc(''help'',''on'')\n'); + fprintf('tsgqc(''inputfile'', <file>, ''outputfile'', <file>),''display'',''true''\n'); + fprintf('tsgqc(''help'',''true'')\n'); + fprintf('tsgqc(''<file>'', ''debug'', 1)\n'); return; end @@ -796,6 +801,8 @@ uimenu(hMapResolutionMenu,'Label','High',... hdl = flipud(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_RESOLUTION_')); set(hdl(tsg.preference.map_resolution), 'checked', 'on'); +% display map Border menu +% ------------------------ hMapBorderMenu = uimenu(... 'Parent', hMapFig,... 'HandleVisibility', handleVisibility,... @@ -837,15 +844,17 @@ uimenu(hMapBorderMenu,'Label','15',... 'Enable', 'on',... 'Callback', {@mapDynaBorderCallback, 15}); -% set 'checked' property to 'on' for current map resolution -% ------------------------------------------------------------ +% set 'checked' property to 'on' for current map border menu +% ---------------------------------------------------------- hdl = flipud(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_BORDER_')); set(hdl(tsg.preference.map_border_value), 'checked', 'on'); +% map Type menu +% -------------- hMapPatchMenu = uimenu(hMapFig,'Label','Type', ... 'Tag', 'TAG_UIMENU_MAP_PATCH'); -% preset map menu with preference +% preset map patch menu from preference if tsg.preference.map_patch_value == 2 chk_with_patch = 'on'; chk_without_patch = 'off'; @@ -866,6 +875,34 @@ uimenu(hMapPatchMenu,'Label','Map with patch (slower)',... 'Enable', 'on',... 'Callback', {@mapPatchMenuCallback, 1}); +% map Climatology menu +% -------------------- +hMapClimatologyMenu = uimenu(hMapFig,'Label','Climatology', ... + 'Tag', 'TAG_UIMENU_MAP_CLIMATOLOGY'); + +% preset map climatology menu from preference +if tsg.preference.map_climatology == 1 + chk_with_climatology = 'on'; + chk_without_climatology = 'off'; +else + chk_with_climatology = 'off'; + chk_without_climatology = 'on'; +end + +uimenu(hMapClimatologyMenu,'Label','Map with surface climatology',... + 'Checked', chk_with_climatology,... + 'Tag','TAG_UIMENU_MAP_CLIMATOLOGY_WITH',... + 'Enable', 'on',... + 'Callback', {@mapClimatologyCallback, 1}); + +uimenu(hMapClimatologyMenu,'Label','Map without surface climatology',... + 'Checked', chk_without_climatology,... + 'Tag','TAG_UIMENU_MAP_CLIMATOLOGY_WITHOUT',... + 'Enable', 'on',... + 'Callback', {@mapClimatologyCallback, 0}); + +% set map axes +% ------------ hPlotAxes(4) = axes(... % the axes for plotting ship track map 'Parent', hMapFig, ... 'Units', 'normalized', ... @@ -3660,6 +3697,7 @@ end end + %% function mapDynaBorderCallback % -------------------------------- function mapDynaBorderCallback(src, evnt, border) @@ -3679,6 +3717,23 @@ end plot_map(hMainFig, hPlotAxes); end + function mapClimatologyCallback(src, evnt, climato) + + hdl = findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_CLIMATOLOGY_'); + set(hdl, 'Checked', 'off'); + set(src, 'Checked', 'on'); + + % change the map 2D climatology from menu on map + % -------------------------------------- + tsg.preference.map_climatology = climato; + setappdata( hMainFig, 'tsg_data', tsg); + + % redraw map + % ------------------------------------------ + erase_Line( hPlotAxes, 4 ); + plot_map(hMainFig, hPlotAxes); + end + %% HeaderMenuCallback % ------------------------------------------------------------------- % Callback function run when the headerForm tool bar item is selected @@ -4337,6 +4392,7 @@ end rmpath( [DEFAULT_PATH_FILE filesep 'tsg_util'] ); rmpath( [DEFAULT_PATH_FILE filesep 'tsg_data'] ); rmpath( [DEFAULT_PATH_FILE filesep 'tsg_io'] ); + rmpath( [DEFAULT_PATH_FILE filesep 'tsg_icon'] ); rmpath( [DEFAULT_PATH_FILE filesep 'tsg_map'] ); end