Skip to content

Commit

Permalink
Merge pull request #353 from aodn/2.5.10
Browse files Browse the repository at this point in the history
2.5.10
  • Loading branch information
ggalibert committed May 30, 2016
2 parents bcf31e5 + 1c10a87 commit e98338d
Show file tree
Hide file tree
Showing 79 changed files with 418 additions and 361 deletions.
7 changes: 3 additions & 4 deletions AutomaticQC/imosImpossibleDepthQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@
depthInfos = {'DEPTH', 'PRES_REL', 'PRES'};
if ~any(strcmpi(paramName, depthInfos)), return; end

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

switch mode
case 'profile'
Expand Down Expand Up @@ -198,7 +197,7 @@
end
end

otherwise % 'timeSeries'
case 'timeSeries'
% this test doesn't apply on dimensions
if ~strcmp(type, 'variables'), return; end

Expand Down
7 changes: 3 additions & 4 deletions AutomaticQC/imosInOutWaterQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@
end
time = sample_data.(tTime){iTime}.data;

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

switch mode
case 'profile'
Expand All @@ -110,7 +109,7 @@
error(['TIME value ' datestr(time, 'yyyy-mm-dd HH:MM:SS') ' is greater than time_deployment_end ' datestr(time_out_water, 'yyyy-mm-dd HH:MM:SS') ' => Check ddb station time values against data file time values!']);
end

otherwise % 'timeSeries'
case 'timeSeries'
qcSet = str2double(readProperty('toolbox.qc_set'));
rawFlag = imosQCFlag('raw', qcSet, 'flag');
failFlag = imosQCFlag('bad', qcSet, 'flag');
Expand Down
5 changes: 2 additions & 3 deletions AutomaticQC/imosRegionalRangeQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
% site = sample_data.meta.site_name; % source = ddb
% if strcmpi(site, 'UNKNOWN'), site = sample_data.site_code; end % source = global_attributes file
site = sample_data.site_code;
site = imosSites(site);

% test if site information exists
if isempty(site)
Expand Down Expand Up @@ -121,11 +120,11 @@
end

% read values from imosRegionalRangeQC properties file
[regionalMin, regionalMax, isSite] = getImosRegionalRange(site.name, paramName);
[regionalMin, regionalMax, isSite] = getImosRegionalRange(site, paramName);

if ~isSite
fprintf('%s\n', ['Warning : ' 'File imosRegionalRangeQC.txt is not documented '...
'for site ' site.name]);
'for site ' site]);
else
if ~isnan(regionalMin)
% get the flag values with which we flag good and out of range data
Expand Down
2 changes: 1 addition & 1 deletion AutomaticQC/imosVerticalVelocityQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
% get all necessary dimensions and variables id in sample_data struct
idWcur = 0;
paramName = sample_data.(type){k}.name;
if strcmpi(paramName, 'WCUR'), idWcur = k; end
if strncmpi(paramName, 'WCUR', 4), idWcur = k; end

% check if the data is compatible with the QC algorithm
idMandatory = idWcur;
Expand Down
53 changes: 9 additions & 44 deletions FlowManager/autoIMOSToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,16 @@ function autoIMOSToolbox(toolboxVersion, fieldTrip, dataDir, ppChain, qcChain, e
%
narginchk(1, 6);

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode.
mode = readProperty('toolbox.mode');

% validate and save field trip
if nargin > 1
if isnumeric(fieldTrip), error('field trip must be a string'); end
switch mode
case 'profile'
writeProperty('startDialog.fieldTrip.profile', fieldTrip);
otherwise
writeProperty('startDialog.fieldTrip.timeSeries', fieldTrip);
end
writeProperty(['startDialog.fieldTrip.' mode], fieldTrip);
else
try
switch mode
case 'profile'
fieldTrip = readProperty('startDialog.fieldTrip.profile');
otherwise
fieldTrip = readProperty('startDialog.fieldTrip.timeSeries');
end
fieldTrip = readProperty(['startDialog.fieldTrip.' mode]);
catch e
end
end
Expand All @@ -95,20 +84,10 @@ function autoIMOSToolbox(toolboxVersion, fieldTrip, dataDir, ppChain, qcChain, e
if ~ischar(dataDir), error('dataDir must be a string'); end
if ~exist(dataDir, 'dir'), error('dataDir must be a directory'); end

switch mode
case 'profile'
writeProperty('startDialog.dataDir.profile', dataDir);
otherwise
writeProperty('startDialog.dataDir.timeSeries', dataDir);
end
writeProperty(['startDialog.dataDir.' mode], dataDir);
else
try
switch mode
case 'profile'
dataDir = readProperty('startDialog.dataDir.profile');
otherwise
dataDir = readProperty('startDialog.dataDir.timeSeries');
end
dataDir = readProperty(['startDialog.dataDir.' mode]);
catch e
end
end
Expand All @@ -134,12 +113,7 @@ function autoIMOSToolbox(toolboxVersion, fieldTrip, dataDir, ppChain, qcChain, e
ppChainStr = '';
end

switch mode
case 'profile'
writeProperty('preprocessManager.preprocessChain.profile', ppChainStr);
otherwise
writeProperty('preprocessManager.preprocessChain.timeSeries', ppChainStr);
end
writeProperty(['preprocessManager.preprocessChain.' mode], ppChainStr);
end

% validate and save qc chain
Expand All @@ -163,12 +137,7 @@ function autoIMOSToolbox(toolboxVersion, fieldTrip, dataDir, ppChain, qcChain, e
qcChainStr = '';
end

switch mode
case 'profile'
writeProperty('autoQCManager.autoQCChain.profile', qcChainStr);
otherwise
writeProperty('autoQCManager.autoQCChain.timeSeries', qcChainStr);
end
writeProperty(['autoQCManager.autoQCChain.' mode], qcChainStr);
end

% validate and save export dir
Expand All @@ -189,15 +158,11 @@ function autoIMOSToolbox(toolboxVersion, fieldTrip, dataDir, ppChain, qcChain, e
[~, sourceFolder] = fileparts(dataDir);
fprintf('%s\n', ['Processing field trip ' fieldTrip ' from folder ' sourceFolder]);

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));

% get infos from current field trip
switch mode
case 'profile'
[~, deps, sits, dataDir] = getCTDs(true);
otherwise
case 'timeSeries'
[~, deps, sits, dataDir] = getDeployments(true);
end

Expand Down
5 changes: 2 additions & 3 deletions FlowManager/autoQCManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

% get last filter chain if there is one
try
% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% get the toolbox execution mode
mode = readProperty('toolbox.mode');
qcChain = textscan(readProperty(['autoQCManager.autoQCChain.' mode]), '%s');
qcChain = qcChain{1};
Expand Down Expand Up @@ -227,8 +227,7 @@
qcRoutines = listAutoQCRoutines();
qcChain = {};

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

% get default filter chain if there is one
Expand Down
7 changes: 3 additions & 4 deletions FlowManager/displayManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ function displayManager(windowTitle, sample_data, callbacks)
qcSet = str2double(readProperty('toolbox.qc_set'));
badFlag = imosQCFlag('bad', qcSet, 'flag');

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

% define the user options, and create the main window
states = {'Import', 'Metadata', 'Raw data', 'QC data', 'QC stats', 'Reset manual QC' ...
Expand Down Expand Up @@ -240,7 +239,7 @@ function rawDataCallback()
switch mode
case 'profile'
nVar = length(sample_data{setIdx}.variables) - 5;
otherwise
case 'timeSeries'
nVar = length(sample_data{setIdx}.variables) - 3;
end
vars(vars > nVar) = [];
Expand Down
58 changes: 29 additions & 29 deletions FlowManager/exportManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ function exportManager(dataSets, levelNames, output, auto)
otherwise, error(['unknown output type: ' output]);
end

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

setNames = {};
for k = 1:numSets
Expand Down Expand Up @@ -246,38 +245,39 @@ function exportQCPlots(sample_data, exportDir, mode, auto, progress)

paramsName = unique(paramsName);

if strcmpi(mode, 'timeseries')
% we get rid of specific parameters
notNeededParams = {'TIMESERIES', 'PROFILE', 'TRAJECTORY', 'LATITUDE', 'LONGITUDE', 'NOMINAL_DEPTH'};
for i=1:length(notNeededParams)
iNotNeeded = strcmpi(paramsName, notNeededParams{i});
paramsName(iNotNeeded) = [];
end

% timeseries specific plots
nParams = length(paramsName);
for i=1:nParams
if ~auto
waitbar(i / nParams, progress, ['Exporting ' paramsName{i} ' plots']);
switch mode
case 'timeSeries'
% we get rid of specific parameters
notNeededParams = {'TIMESERIES', 'PROFILE', 'TRAJECTORY', 'LATITUDE', 'LONGITUDE', 'NOMINAL_DEPTH'};
for i=1:length(notNeededParams)
iNotNeeded = strcmpi(paramsName, notNeededParams{i});
paramsName(iNotNeeded) = [];
end

% timeseries specific plots
nParams = length(paramsName);
for i=1:nParams
if ~auto
waitbar(i / nParams, progress, ['Exporting ' paramsName{i} ' plots']);
end
try
lineMooring1DVar(sample_data, paramsName{i}, true, true, exportDir);
scatterMooring1DVarAgainstDepth(sample_data, paramsName{i}, true, true, exportDir);
scatterMooring2DVarAgainstDepth(sample_data, paramsName{i}, true, true, exportDir);
%pcolorMooring2DVar(sample_data, paramsName{i}, true, true, exportDir);
catch e
errorString = getErrorString(e);
fprintf('%s\n', ['Error says : ' errorString]);
end
end
case 'profile'
% profile specific plots
try
lineMooring1DVar(sample_data, paramsName{i}, true, true, exportDir);
scatterMooring1DVarAgainstDepth(sample_data, paramsName{i}, true, true, exportDir);
scatterMooring2DVarAgainstDepth(sample_data, paramsName{i}, true, true, exportDir);
%pcolorMooring2DVar(sample_data, paramsName{i}, true, true, exportDir);
lineCastVar(sample_data, paramsName, true, true, exportDir);
catch e
errorString = getErrorString(e);
fprintf('%s\n', ['Error says : ' errorString]);
end
end
else
% profile specific plots
try
lineCastVar(sample_data, paramsName, true, true, exportDir);
catch e
errorString = getErrorString(e);
fprintf('%s\n', ['Error says : ' errorString]);
end
end


Expand Down
5 changes: 2 additions & 3 deletions FlowManager/flowManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ function flowManager(toolboxVersion)

lastAutoQCSetIdx = 0;

% get the toolbox execution mode. Values can be 'timeSeries' and 'profile'.
% If no value is set then default mode is 'timeSeries'
mode = lower(readProperty('toolbox.mode'));
% get the toolbox execution mode
mode = readProperty('toolbox.mode');

% import data
nonUTCRawData = importManager(toolboxVersion);
Expand Down
Loading

0 comments on commit e98338d

Please sign in to comment.