diff --git a/TSGQC_amelioration.xls b/TSGQC_amelioration.xls index 82f11c7d27ac5f35deb028795ec5ddde835844da..f2005ec6f344c04d52743d053c97ef78bf0bf68f 100644 Binary files a/TSGQC_amelioration.xls and b/TSGQC_amelioration.xls differ diff --git a/tsg_io/read_data.m b/tsg_io/read_data.m index fbcffcf50a98ff17477b67d56d11011867507770..455374e2262815d85c4c9414721979a4c41dc1cd 100644 --- a/tsg_io/read_data.m +++ b/tsg_io/read_data.m @@ -14,18 +14,18 @@ function [errTsg, errSpl] = read_data( hMainFig, filterIndex, fullFileName) % errSpl Error code for discrete data file % % Filter index values -% 1 - Argo file *.arg (G. Reverdin format) -% 2 - TSG Astrolabe text file *.ast -% 3 - WS ascii file *.btl (tsgqc ascci format) -% 4 - TSG labview file *.lbv -% 5 - TSG netcdf file *.nc -% 6 - TSG Oracle text file *.ora -% 7 - TSG SDF file *.sdf -% 8 - SPL ascii file *.spl (tsgqc ascci format) -% 9 - TSG Nuka transmit file *.transmit* -% 10 - TSG text file *.tsgqc (tsgqc ascci format) -% 11 - TSG XML file *.xml -% 12 - Seasave file .cnv +% *.arg - Argo file (G. Reverdin format) +% *.ast - TSG Astrolabe text file +% *.btl - WS ascii file (tsgqc ascci format) +% *.lbv - TSG labview file +% *.nc - TSG netcdf file +% *.ora - TSG Oracle text file +% *.sdf - TSG SDF file +% *.spl - SPL ascii file (tsgqc ascci format) +% *.transmit* - TSG Nuka transmit file +% *.tsgqc - TSG text file (tsgqc ascci format) +% *.xml - TSG XML file +% *.cnv - Seasave file % % errTsg, errSpl % 1 - File read OK @@ -46,7 +46,7 @@ switch filterIndex % Read discrete data (Water sample, Argo, etc.) % --------------------------------------------- - case {1, 3, 8} + case {'*.arg', '*.btl', '*.spl'} % A TSG file must have been uploaded before reading Water sample file % -------------------------------------------------------------------- @@ -67,7 +67,8 @@ switch filterIndex % Read TSG data file % ------------------ - case {2, 4, 5, 6, 7, 9, 10, 11, 12} +% case {2, 4, 5, 6, 7, 9, 10, 11, 12} + case {'*.ast', '*.lbv', '*.nc', '*.ora', '*.sdf', '*.transmit', '*.tsgqc', '*.xml', '*.cnv'} % Save the TSG structure - Temporary variable % ------------------------------------------- @@ -80,23 +81,23 @@ switch filterIndex % Read the file. TSG values are stored in a tsg variable % ------------- switch filterIndex - case 2 % read TSG Astrolabe text file *.ast + case '*.ast' % read TSG Astrolabe text file *.ast errTsg = readTsgDataAstrolabe(hMainFig, fullFileName); - case 4 % read TSG labview file *.lbv + case '*.lbv' % read TSG labview file *.lbv errTsg = readTsgDataLabview(hMainFig, fullFileName ); - case 5 % read TSG netcdf file *.nc + case '*.nc' % read TSG netcdf file *.nc errTsg = readTsgDataNetCDF(hMainFig, fullFileName ); - case 6 % read TSG Oracle text file *.ora + case '*.ora' % read TSG Oracle text file *.ora errTsg = readTsgDataOracle(hMainFig, fullFileName); - case 7 % read TSG SDF file *.sdf + case '*.sdf' % read TSG SDF file *.sdf errTsg = readTsgDataSDF(hMainFig, fullFileName ); - case 9 % read TSG Nuka transmit file *.transmit* + case '*.transmit*' % read TSG Nuka transmit file *.transmit* errTsg = readTsgDataNuka(hMainFig, fullFileName); - case 10 % read TSG text file *.tsgqc + case '*.tsgqc' % read TSG text file *.tsgqc errTsg = readAsciiTsg(hMainFig, fullFileName); - case 11 % read TSG XML file *.xml + case '*.xml' % read TSG XML file *.xml errTsg = readTsgDataXML(hMainFig, fullFileName ); - case 12 % read TSG XML file *.xml + case '*cnv' % read TSG XML file *.cnv errTsg = readTsgSeasave(hMainFig, fullFileName ); end diff --git a/tsgqc.m b/tsgqc.m index 83ed87a4e2507f030d119f025c2c061043c8a6b6..3d16ac087d0b3771f66bab73edf97538c10e926a 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -861,7 +861,7 @@ for key = qc_list state = tsg.qc.hash.(key).state; value = 0; - if strcmp(char(key), 'NO_CONTROL') || strcmp(char(key), 'GOOD') ||... + if strcmp(char(key), 'HARBOUR') || strcmp(char(key), 'GOOD') ||... strcmp(char(key), 'PROBABLY_GOOD') value = 1; end @@ -1232,9 +1232,9 @@ hrbInterpCancel = uicontrol( ... % Open standard dialog box for retrieving files % --------------------------------------------- - [fileName, pathname, filterIndex] = uigetfile( ... - {'*.arg';'*.ast';'*.btl';'*.lbv';'*.nc';'*.ora';'*.sdf';'*.spl';... - '*.transmit*'; '*.tsgqc';'*.xml';'*.cnv'}, 'Pick a file'); + fileExtension = ({'*.lbv';'*.nc';'*.arg';'*.ast';'*.btl';'*.ora';... + '*.sdf';'*.spl'; '*.transmit*'; '*.tsgqc';'*.xml';'*.cnv'}); + [fileName, pathname, filterIndex] = uigetfile( fileExtension, 'Pick a file'); % flushes the event queue and updates the closed uigetfile window % --------------------------------------------------------------- @@ -1255,8 +1255,8 @@ hrbInterpCancel = uicontrol( ... % Read the data % ------------- - [errTsg, errSpl] = read_data( hMainFig, filterIndex, fullFileName); - + [errTsg, errSpl] = read_data( hMainFig, char(fileExtension(filterIndex)), fullFileName); + % Get the tsg structure % --------------------- tsg = getappdata( hMainFig, 'tsg_data');