Skip to content
Snippets Groups Projects
Commit e5c1ee05 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

add writing time informations on console

parent 6fe6415d
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ function [error] = writeTSGDataNetCDF( hTsgGUI, filename)
%
% $Id$
% Open the file
%% Open the file
% -------------
nc = netcdf(filename, 'clobber');
if isempty(nc)
......@@ -27,6 +27,10 @@ if isempty(nc)
return;
end
% Display read file info on console
% ---------------------------------
fprintf('\nWRITE_NETCDF_FILE\n'); tic;
% Initialize loading NetCDF file waitbar
% --------------------------------------
wb = waitbar(0, 'Initializing NetCDF file. Please wait...');
......@@ -54,7 +58,11 @@ ncv = tsg_nc('tsg_ncvar.csv');
ncv_keys = keys(ncv);
ncv_fieldNames = get_fieldnames(ncv);
% Create NetCDF file:
% Display more info about write file on console
% ---------------------------------------------
fprintf('...writing %s : ', filename);
%% Create NetCDF file:
% -------------------
% Variable dimensions
......@@ -77,7 +85,7 @@ nc('N1') = 1;
% ---------------------------------------------------------------------
waitbar(1/50,wb,['Writing file: ' filename ' Please wait...']);
% Create NetCDF global attributes
%% Create NetCDF global attributes
% -------------------------------
for i=1:numel(nca_keys)
nc.(nca_keys{i}) = tsg.(nca_keys{i});
......@@ -102,7 +110,7 @@ for i=1:numel(ncv_keys)
end
end
% Create data to NetCDF file:
%% Create data to NetCDF file:
% ---------------------------
% Write global attributes
......@@ -148,6 +156,10 @@ close(wb)
endef(nc)
close(nc)
% Display time to write file on console
% -------------------------------------
t = toc; fprintf('...done (%6.2f sec).\n\n',t);
% Everything OK
% -------------
error = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment