diff --git a/AutomaticQC/imosEchoIntensitySetQC.m b/AutomaticQC/imosEchoIntensitySetQC.m index ae0234953..9791f505f 100644 --- a/AutomaticQC/imosEchoIntensitySetQC.m +++ b/AutomaticQC/imosEchoIntensitySetQC.m @@ -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 diff --git a/AutomaticQC/imosEchoIntensityVelocitySetQC.m b/AutomaticQC/imosEchoIntensityVelocitySetQC.m index cd96138bb..eebd2a1d0 100644 --- a/AutomaticQC/imosEchoIntensityVelocitySetQC.m +++ b/AutomaticQC/imosEchoIntensityVelocitySetQC.m @@ -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); diff --git a/AutomaticQC/imosSurfaceDetectionByDepthSetQC.m b/AutomaticQC/imosSurfaceDetectionByDepthSetQC.m index ffb071294..c8c39228a 100644 --- a/AutomaticQC/imosSurfaceDetectionByDepthSetQC.m +++ b/AutomaticQC/imosSurfaceDetectionByDepthSetQC.m @@ -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 diff --git a/AutomaticQC/qcFilterMain.m b/AutomaticQC/qcFilterMain.m index 53295f538..b4660af7e 100644 --- a/AutomaticQC/qcFilterMain.m +++ b/AutomaticQC/qcFilterMain.m @@ -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); diff --git a/Java/ddb.jar b/Java/ddb.jar index 9cdf6a343..d9569a506 100644 Binary files a/Java/ddb.jar and b/Java/ddb.jar differ diff --git a/Preprocessing/depthPP.m b/Preprocessing/depthPP.m index 251554dc2..04c096ebc 100644 --- a/Preprocessing/depthPP.m +++ b/Preprocessing/depthPP.m @@ -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( ... diff --git a/Util/genSampleDataDesc.m b/Util/genSampleDataDesc.m index d93b0e02d..9120005ea 100644 --- a/Util/genSampleDataDesc.m +++ b/Util/genSampleDataDesc.m @@ -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 @@ -73,7 +79,7 @@ filename = 'Unknown'; end -[~, fName, fSuffix] = fileparts(sam.toolbox_input_file); +[~, fName, fSuffix] = fileparts(filename); fName = [fName fSuffix]; @@ -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); diff --git a/build.py b/build.py index 50ca49b3f..2cda57abd 100755 --- a/build.py +++ b/build.py @@ -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"] = [ diff --git a/imosToolbox.m b/imosToolbox.m index 340d68e84..ed3b2a844 100644 --- a/imosToolbox.m +++ b/imosToolbox.m @@ -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 diff --git a/imosToolbox_Linux64.bin b/imosToolbox_Linux64.bin index 48bd3177f..fb04faaa1 100755 Binary files a/imosToolbox_Linux64.bin and b/imosToolbox_Linux64.bin differ diff --git a/imosToolbox_Win64.exe b/imosToolbox_Win64.exe index 7e34e12b4..8de6d0b1a 100644 Binary files a/imosToolbox_Win64.exe and b/imosToolbox_Win64.exe differ diff --git a/test/Preprocessing/testDepthPP.m b/test/Preprocessing/testDepthPP.m new file mode 100644 index 000000000..46bd73f69 --- /dev/null +++ b/test/Preprocessing/testDepthPP.m @@ -0,0 +1,31 @@ +classdef testDepthPP < matlab.unittest.TestCase + + % Test DepthPP + % + % by hugo.oliveira@utas.edu.au + % + 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