Skip to content

Commit

Permalink
Merge pull request #735 from aodn/release_2.6.11
Browse files Browse the repository at this point in the history
Release 2.6.11, fixes #733
  • Loading branch information
lbesnard authored Apr 15, 2021
2 parents 5fa0045 + 34b8f98 commit 5b73e90
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 23 deletions.
6 changes: 2 additions & 4 deletions AutomaticQC/imosEchoIntensitySetQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@

if ~valid
%TODO: we may need to include a global verbose flag to avoid pollution here.
for k = 1:numel(reason)
dispmsg('Skipping %s. Reason: \n', sample_data.toolbox_input_file, reason{k})
end

unwrapped_msg = ['Skipping %s. Reasons: ' cell2str(reason,'')];
dispmsg(unwrapped_msg,sample_data.toolbox_input_file)
return
end

Expand Down
20 changes: 16 additions & 4 deletions AutomaticQC/imosEchoIntensityVelocitySetQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,22 @@
if strcmpi(paramName, ['ABSIC' cc]), idABSIC{j} = i; end
end
end
idHeight = getVar(sample_data.dimensions, 'HEIGHT_ABOVE_SENSOR');
Bins = sample_data.dimensions{idHeight}.data';
idDepth = getVar(sample_data.variables, 'DEPTH');
depth = sample_data.variables{idDepth}.data;
try
idHeight = getVar(sample_data.dimensions, 'HEIGHT_ABOVE_SENSOR');
Bins = sample_data.dimensions{idHeight}.data';
catch
dispmsg('No HEIGHT_ABOVE_SENSOR variable. Skipping...')
return
end

try
idDepth = getVar(sample_data.variables, 'DEPTH');
depth = sample_data.variables{idDepth}.data;
catch
dispmsg('No DEPTH variable. Skipping...')
return
end


% check if the data is compatible with the QC algorithm
idMandatory = (idUcur | idVcur | idWcur | idCspd | idCdir);
Expand Down
5 changes: 2 additions & 3 deletions AutomaticQC/imosSurfaceDetectionByDepthSetQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
[valid,reason] = IMOS.validate_dataset(sample_data,currentQCtest);
if ~valid
%TODO: we may need to include a global verbose flag to avoid pollution here.
for k=1:numel(reason)
dispmsg('Skipping %s. Reason: \n', sample_data.toolbox_input_file, reason{k})
end
unwrapped_msg = ['Skipping %s. Reasons: ' cell2str(reason,'')];
dispmsg(unwrapped_msg,sample_data.toolbox_input_file)
return
end

Expand Down
2 changes: 1 addition & 1 deletion AutomaticQC/qcFilterMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
% user cancelled
if ~isempty(cancel) && getappdata(cancel, 'cancel'), return; end

if contains(filterName,'SpikeQC')
if contains(filterName,'TimeSeriesSpikeQC')
varname = sam.(type{m}){k}.name;
if ~exist('varflags','var')
[varflags, varlogs] = filter(sam, auto);
Expand Down
Binary file modified Java/ddb.jar
Binary file not shown.
13 changes: 6 additions & 7 deletions Preprocessing/depthPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -844,18 +844,17 @@
continue;
end
end

if depthIdx(iCurSam)
% update existing depth data in data set
sample_data{iCurSam}.(depthVarType).data = computedDepth;

depthComment = sample_data{iCurSam}.(depthVarType).comment;
depth_index = depthIdx(iCurSam);
sample_data{iCurSam}.(depthVarType){depth_index}.data = computedDepth;
depthComment = sample_data{iCurSam}.(depthVarType){depth_index}.comment;
if isempty(depthComment)
sample_data{iCurSam}.(depthVarType).comment = computedDepthComment;
sample_data{iCurSam}.(depthVarType){depth_index}.comment = computedDepthComment;
else
sample_data{iCurSam}.(depthVarType).comment = [comment ' ' computedDepthComment];
sample_data{iCurSam}.(depthVarType){depth_index}.comment = [comment ' ' computedDepthComment];
end

else
% add depth data as new variable in data set
sample_data{iCurSam} = addVar( ...
Expand Down
22 changes: 20 additions & 2 deletions Util/genSampleDataDesc.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@

try
time_coverage_start = sam.time_coverage_start;
if isempty(time_coverage_start)
time_coverage_start = 0;
end
catch
time_coverage_start = 0;
end

try
time_coverage_end = sam.time_coverage_end;
if isempty(time_coverage_end)
time_coverage_end = 0;
end
catch
time_coverage_end = 0;
end
Expand All @@ -73,7 +79,7 @@
filename = 'Unknown';
end

[~, fName, fSuffix] = fileparts(sam.toolbox_input_file);
[~, fName, fSuffix] = fileparts(filename);

fName = [fName fSuffix];

Expand All @@ -84,7 +90,19 @@
alias_file = '';
end

instrument_entry = [sam.meta.instrument_make ' ' sam.meta.instrument_model];
try
maker = sam.meta.instrument_make;
catch
maker = 'None';
end
try
model = sam.meta.instrument_model;
catch
model = 'None';
end

instrument_entry = [maker ' ' model ];

if ~isempty(alias_file)
try
map = readMappings(alias_file);
Expand Down
4 changes: 3 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def find_items(folder: str) -> dict:
items["standard_matfiles"] = [
x.as_posix()
for x in all_files
if x.suffix == ".mat" and "/+" not in x.parent.as_posix()
if "data/testfiles/" not in x.as_posix()
if x.suffix == ".mat"
and "/+" not in x.parent.as_posix()
]

items["standard_miscfiles"] = [
Expand Down
2 changes: 1 addition & 1 deletion imosToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function imosToolbox(auto, varargin)
%

% Set current toolbox version
toolboxVersion = ['2.6.10 - ' computer];
toolboxVersion = ['2.6.11 - ' computer];

if nargin == 0, auto = 'manual'; end

Expand Down
Binary file modified imosToolbox_Linux64.bin
Binary file not shown.
Binary file modified imosToolbox_Win64.exe
Binary file not shown.
31 changes: 31 additions & 0 deletions test/Preprocessing/testDepthPP.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
classdef testDepthPP < matlab.unittest.TestCase

% Test DepthPP
%
% by [email protected]
%
properties (TestParameter)
mode = {'profile','timeSeries'};
end

methods (Test)
function testDepthPPOverwriteDepth(~, mode)
d = IMOS.gen_dimensions(mode,1,{'TIME'},{@double},{randn(100,1)});
parr = 100*ones(100,1);
darr = randn(100,1);
v = IMOS.gen_variables(d,{'X','PRES','DEPTH'},{@double,@double,@double},{randn(1,1),parr,darr},'coordinates','');
dataset = struct();
dataset.dimensions = d;
dataset.variables = v;
dataset.instrument_nominal_depth = 200;
dataset.site_nominal_depth = 205;
dataset.toolbox_input_file = '';
dataset.meta = struct();
dataset = makeNetCDFCompliant(dataset);
disp('Select from PRES measurements to overwrite DEPTH and make this test pass')
x = depthPP({dataset},'qc',false); %select from PRES to overwrite DEPTH
assert(~isequal(x{1}.variables{end}.data,darr));
end
end

end

0 comments on commit 5b73e90

Please sign in to comment.