From 71d259919d77da2d9df861fff28e18551a5ac7ac Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Tue, 8 Jan 2008 15:13:28 +0000 Subject: [PATCH] renomme le fichier --- tsg_util/readTsgDataXML.m | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tsg_util/readTsgDataXML.m diff --git a/tsg_util/readTsgDataXML.m b/tsg_util/readTsgDataXML.m new file mode 100644 index 0000000..8f2b79d --- /dev/null +++ b/tsg_util/readTsgDataXML.m @@ -0,0 +1,58 @@ +function [error] = readTsgDataXML( hTsgGUI, filename) +% Function to read the TSG data XML file +% +% Input +% ----- +% hTsgGUI ............ Handel to the main user interface +% filename ........... Data filename +% +% Output +% ------ +% error .............. 1: OK - -1 : an error occured +% +% The data are store using setappdata - Variable name : 'tsg_data' +% +% Function not yet implemented +% Caution : replace the fill-value with NaN +% $Id$ + +% Open the file +% ------------- +fid = fopen( filename, 'r' ); + +error = -1; +if fid ~= -1 + disp('Read XML file, not yet implemeted ...'); +% % Read the file +% % ------------- +% tsgData = fscanf(fid, '%d/%d/%d %d:%d:%d %f %f %f %f %d %f %f', ... +% [13 Inf])'; +% +% % Every variable are put in a structure +% % ------------------------------------- +% tsg.TIME = datenum(tsgData(:,3), tsgData(:,2),tsgData(:,1), ... +% tsgData(:,4),tsgData(:,5),tsgData(:,6)); +% tsg.LATITUDE = tsgData(:,7); +% tsg.LONGITUDE = tsgData(:,8); +% tsg.TEMP_TSG = tsgData(:,9); +% tsg.PSAL = tsgData(:,10); +% tsg.PSAL_QC = tsgData(:,11); +% tsg.PSAL_ADJ = tsgData(:,12); +% tsg.PSAL_ERR = tsgData(:,13); +% +% % Save the data in the application GUI +% % ------------------------------------ +% setappdata( hTsgGUI, 'tsg_data', tsg ); + + % Clear the Workspace + % ------------------- + clear tsgdata + + % Close the file + % -------------- + fclose( fid ); + + % Everything is not OK + % ------------- + error = -1; +end -- GitLab