Skip to content

Commit

Permalink
Add scenario for imosErrorVelocitySetQC
Browse files Browse the repository at this point in the history
  • Loading branch information
lbesnard committed Jun 28, 2023
1 parent 4777cd6 commit aa7be9f
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions AutomaticQC/qcFilterMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,28 @@ function addFailedTestsFlags()
failedTestsIdx_probGood = probGoodIdx;
failedTestsIdx_bad = badIdx;
elseif strcmp(filterName, 'imosErrorVelocitySetQC') % see https://github.com/aodn/imos-toolbox/wiki/QCProcedures#adcp-error-velocity-test---imoserrorvelocitysetqc---optional
% a pass test for this test only is if the data is flagged good
% or probably good if ECUR is NaN
% for this specific QC routine, a test is considerer to be pass
% if the data is flagged good or probably good if ECUR is NaN

% TODO: implement this scenario
% find variable index for ECUR
notdone = true;
while notdone
for kk = 1:length(sam.(type{m}))
if strcmp(sam.(type{m}){kk}.name, 'ECUR')
notdone = false;
break
end
end
end

if not(notdone)
if all(isnan(sam.(type{m}){kk}.data(:)))
failedTestsIdx = badIdx | probBadIdx;
else
failedTestsIdx = badIdx | probBadIdx | probGoodIdx ;
end
end

strcmp(sam.(type{m}){k}.name, 'ECUR') ;
failedTestsIdx = badIdx;
else
failedTestsIdx = probGoodIdx | probBadIdx | badIdx; % result matrice for all variables
end
Expand Down

0 comments on commit aa7be9f

Please sign in to comment.