Skip to content

Commit

Permalink
Fix depthPP to not display warnings nor GUI when toolbox is used in p…
Browse files Browse the repository at this point in the history
…rofile mode.
  • Loading branch information
ggalibert committed Jun 22, 2017
1 parent 7b65d42 commit 7b206ba
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Preprocessing/depthPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@

% get the toolbox execution mode
mode = readProperty('toolbox.mode');

depthVarType = 'variables';
isProfile = false;
switch mode
case 'profile'
depthVarType = 'dimensions';

otherwise
depthVarType = 'variables';
isProfile = true;

end

Expand Down Expand Up @@ -160,7 +161,7 @@
useItsOwnPresRel(iCurSam) = readDatasetParameter(sample_data{iCurSam}.toolbox_input_file, currentPProutine, 'useItsOwnPresRel', useItsOwnPresRel(iCurSam));

% look for nearest instruments with depth or pressure information
if isSensorHeight || isSensorTargetDepth
if ~isProfile && (isSensorHeight || isSensorTargetDepth)
% let's see if part of a mooring with pressure data from other
% sensors
for iOtherSam = 1:nDatasets
Expand Down Expand Up @@ -309,10 +310,12 @@
secondNearestInst(iCurSam) = readDatasetParameter(sample_data{iCurSam}.toolbox_input_file, currentPProutine, 'secondNearestInst', secondNearestInst(iCurSam));
end
else
fprintf('%s\n', ['Warning : ' sample_data{iCurSam}.toolbox_input_file ...
' please document either instrument_nominal_height or instrument_nominal_depth '...
'global attributes so that an actual depth can be '...
'computed from other pressure sensors in the mooring']);
if ~isProfile
fprintf('%s\n', ['Warning : ' sample_data{iCurSam}.toolbox_input_file ...
' please document either instrument_nominal_height or instrument_nominal_depth '...
'global attributes so that an actual depth can be '...
'computed from other pressure sensors in the mooring']);
end
continue;
end
end
Expand Down Expand Up @@ -353,7 +356,7 @@
end
end

if ~auto
if ~auto && ~isProfile
f = figure(...
'Name', 'Depth Computation',...
'Visible', 'off',...
Expand Down

0 comments on commit 7b206ba

Please sign in to comment.