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

les variables POSITION_QC et var_ADJUSTED_QC n'étaient pas initialisee a zero...

les variables POSITION_QC et var_ADJUSTED_QC n'étaient pas initialisee a zero et prenaient la valeur -127 lors de la creation du fichier NetCDF, rajoute la commande sync dans write a la fin de l'ecriture des variables
parent ff153c0e
No related branches found
No related tags found
No related merge requests found
......@@ -388,7 +388,7 @@ for i=1:numel(ncv_keys)
% If a NetCDF variable has valid _FillValue attributes, then
% the data is filled accordingly.
% ----------------------------------------------------------
if self.autonan && isfield(s, 'FillValue_')
if self.autonan && isfield(s, 'FillValue_') && ~isempty(s.FillValue_)
value(isnan(value)) = s.FillValue_;
end
......@@ -404,6 +404,11 @@ for i=1:numel(ncv_keys)
'Cannot write netcdf file\n%s.', exception.message); %#ok<CTPCT>
end
% synchronize netcdf file to disk
% -------------------------------
netcdf.sync(self.nc_id);
end % end for ncv variables loop
% Close waitbar
......
......@@ -8,6 +8,6 @@ function [tabOut] = castByteQC( code, tabIn )
% $Id$
tabOut = int8(code) * int8( ones(size(tabIn) ));
tabOut = uint8(code) * uint8( ones(size(tabIn) ));
end
......@@ -20,8 +20,8 @@ shipVelocity( hMainFig );
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
nPARA = 2;
PARA = ['SSPS'; 'SSJT'];
nPARA = 3;
PARA = ['SSPS'; 'SSJT'; 'SSTP'];
% Get NO_CONTROL and INTERPOLATED_VALUE codes
% a modifier !!!!!!!!!!!!!
......@@ -72,6 +72,7 @@ tsg.DATE_END = [date(1:8) date(10:15)];
for i = 1: nPARA
para1 = PARA(i,:);
if ~isempty( tsg.(para1) ) && isempty( tsg.([para1 '_QC']) )
% If QC variables are emptied, fill them with NO_CONTROL code value
......@@ -79,8 +80,20 @@ for i = 1: nPARA
tsg.([para1 '_QC']) = castByteQC( NO_CONTROL, tsg.DAYD );
end
if ~isempty( tsg.(para1) ) && isempty( tsg.([para1 '_ADJUSTED_QC']) )
% If QC variables are emptied, fill them with NO_CONTROL code value
% -----------------------------------------------------------------
tsg.([para1 '_ADJUSTED_QC']) = castByteQC( NO_CONTROL, tsg.DAYD );
end
end
% initialize POSITION_QC
% ----------------------
tsg.('POSITION_ADJUSTED_QC') = castByteQC( NO_CONTROL, tsg.DAYD );
% Empty variables filled with NaN
% -------------------------------
names = fieldnames( tsg );
......
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