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

factorisation du code de maj de la vitesse tsg.SPDC dans updateTsgStruct

parent 2db12bb6
No related branches found
No related tags found
No related merge requests found
......@@ -85,33 +85,15 @@ if fid ~= -1
tsg.LONX = lon;
tsg.SSJT = sst;
tsg.SSPS = sss;
tsg.SPDC = sog;
% Remplacer la valeur par tsg.qc.code.NOCONTROL
tsg.SSPS_QC = ones(nblig,1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%tsg.SSPS_ADJ = tsgData(:,12);
%tsg.SSPS_ERR = tsgData(:,13);
tsg.SPDC = sog;
% Compute ship velocity from positions if sog not available
% ---------------------------------------------------------
if isempty(tsg.SPDC)
range = m_lldist(tsg.LONX,tsg.LATX);
ind = size(tsg.DAYD);
tsg.SPDC = zeros(size(ind));
for i=1:length(tsg.DAYD)-1
tsg.SPDC(i) = range(i) / ((tsg.DAYD(i+1)-tsg.DAYD(i)) * 24 * 1.854);
end
tsg.SPDC = [tsg.SPDC';0];
end
% populate tsg.file structure
% ---------------------------
tsg.file.name = filename;
tsg.file.type = 'ASCII';
tsg.file.type = 'LABVIEW';
% Save the data in the application GUI
% ------------------------------------
......
......@@ -60,23 +60,9 @@ tsg.LONX = tsgData(:,8);
tsg.SSJT = tsgData(:,9);
tsg.SSPS = tsgData(:,10);
tsg.SSPS_QC = tsgData(:,11);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tsg.SSPS_ADJ = tsgData(:,12);
tsg.SSPS_ERR = tsgData(:,13);
% Compute ship velocity from positions if sog not available
% ---------------------------------------------------------
if isempty(tsg.SPDC)
range = m_lldist(tsg.LONX,tsg.LATX);
ind = size(tsg.DAYD);
tsg.SPDC = zeros(size(ind));
for i=1:length(tsg.DAYD)-1
tsg.SPDC(i) = range(i) / ((tsg.DAYD(i+1)-tsg.DAYD(i)) * 24 * 1.854);
end
tsg.SPDC = [tsg.SPDC';0];
end
% populate tsg.file structure
% ---------------------------
tsg.file.name = filename;
......
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