-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #744 from aodn/hotfix_parser_qc_development
Hotfix parser qc development
- Loading branch information
Showing
53 changed files
with
1,213 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,7 @@ | |
% z = randn(1,10); | ||
% z(10) = 10000; | ||
% [spikes] = imosSpikeClassifierRunningStats(z,@mean,@std,2); | ||
% assert(spikes(10)==1) | ||
% assert(spikes(1:9)==0) | ||
% assert(spikes==10) | ||
% | ||
% author: [email protected] | ||
% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,7 @@ | |
% z = randn(1,10); | ||
% z(10) = 10000; | ||
% [spikes] = imosSpikeClassifierRunningStats(z,@mean,@std,2); | ||
% assert(spikes(10)==1) | ||
% assert(spikes(1:9)==0) | ||
% assert(spikes==10) | ||
% | ||
% author: [email protected] | ||
% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ | |
% | ||
% Example: | ||
% | ||
% len = 100 | ||
% [limits] = imosTimeSeriesSpikeQCLimits(len) | ||
% len = 100; | ||
% [limits] = imosSpikeClassifiersLimits(len); | ||
% assert(limits.hampel_half_window_width.min==1) | ||
% assert(limits.hampel_half_window_width.max==len/2) | ||
% assert(limits.hampel_madfactor.max = 20) | ||
% assert(limits.hampel_madfactor.max==20) | ||
% | ||
% author: [email protected] | ||
% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,30 @@ | |
% | ||
% Example: | ||
% | ||
% % find different samplings | ||
% dsignal = diff([0:10:100, 101:110]); | ||
% [t] = otsu_threshold(dsignal,2); | ||
% assert(t>1); | ||
% assert(isequal(find(dsignal>t),1:10)) | ||
% [t] = otsu_threshold(dsignal,100); | ||
% assert(t>1); | ||
% | ||
% % spike simple case | ||
% x = randn(1,100)*10; | ||
% spikes = [3,30:40,90]; | ||
% x(spikes) = 100; | ||
% dsignal = diff(x); | ||
% t = otsu_threshold(dsignal,2); | ||
% assert(t<100); | ||
% assert(abs(x(3)-x(2))>t) | ||
% assert(abs(x(30)-x(29))>t) | ||
% assert(abs(x(90)-x(89))>t) | ||
% | ||
% % simple threshold only detects the first | ||
% % occurence, and with a shifted index given | ||
% % the difference operation | ||
% assert(isequal(find(dsignal>t),[2,29,89])) | ||
% | ||
% [threshold] = compute_otsu_threshold(signal,nbins) | ||
% assert() | ||
% | ||
% author: [email protected] | ||
% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,78 +22,116 @@ | |
% Examples: | ||
% | ||
% sensors = struct('Temperature',true,'Depth',true,'Conductivity',false,'SpeedOfSound',true,'Pitch',true,'Roll',true,'Heading',true); | ||
% | ||
% imap = Workhorse.import_mappings(sensors,4,'','beam'); | ||
% fields = fieldnames(imap); | ||
% assert(inCell(fields,'VEL1')) | ||
% assert(~inCell(fields,'VCUR')) | ||
% assert(inCell(fields,'HEADING')) | ||
% assert(inCell(fields,'ABSIC4')) | ||
% assert(isequal(imap.('VEL1'),{'velocity','velocity1'})) | ||
% assert(isequal(imap.('VEL2'),{'velocity','velocity2'})) | ||
% assert(isequal(imap.('VEL3'),{'velocity','velocity3'})) | ||
% assert(isequal(imap.('VEL4'),{'velocity','velocity4'})) | ||
% | ||
% imap = Workhorse.import_mappings(sensors,4,'','earth'); | ||
% fields = fieldnames(imap); | ||
% assert(inCell(fields,'VCUR')) | ||
% assert(~inCell(fields,'VEL1')) | ||
% assert(inCell(fields,'HEADING')) | ||
% assert(inCell(fields,'ABSIC4')) | ||
% assert(isequal(imap.('UCUR'),{'velocity','velocity1'})) | ||
% assert(isequal(imap.('VCUR'),{'velocity','velocity2'})) | ||
% assert(isequal(imap.('WCUR'),{'velocity','velocity3'})) | ||
% assert(isequal(imap.('ECUR'),{'velocity','velocity4'})) | ||
% | ||
% %MAG declination renaming. | ||
% | ||
% imap = Workhorse.import_mappings(sensors,4,'_MAG','earth'); | ||
% fields = fieldnames(imap); | ||
% | ||
% assert(~inCell(fields,'VEL1_MAG')) | ||
% assert(inCell(fields,'VCUR_MAG')) | ||
% assert(isequal(imap.('VCUR_MAG'),{'velocity','velocity1'})) | ||
% assert(inCell(fields,'UCUR_MAG')) | ||
% assert(isequal(imap.('UCUR_MAG'),{'velocity','velocity2'})) | ||
% | ||
% assert(inCell(fields,'ECUR')) | ||
% assert(isequal(imap.('UCUR_MAG'),{'velocity','velocity1'})) | ||
% assert(inCell(fields,'VCUR_MAG')) | ||
% assert(isequal(imap.('VCUR_MAG'),{'velocity','velocity2'})) | ||
% assert(inCell(fields,'WCUR')) | ||
% | ||
% assert(inCell(fields,'CMAG1')) | ||
% assert(isequal(imap.('CMAG1'),{'corrMag','field1'})) | ||
% | ||
% assert(inCell(fields,'PERG4')) | ||
% assert(isequal(imap.('PERG4'),{'percentGood','field4'})) | ||
% assert(isequal(imap.('WCUR'),{'velocity','velocity3'})) | ||
% assert(inCell(fields,'ECUR')) | ||
% assert(isequal(imap.('ECUR'),{'velocity','velocity4'})) | ||
% | ||
% assert(inCell(fields,'ABSIC4')) | ||
% assert(isequal(imap.('ABSIC4'),{'echoIntensity','field4'})) | ||
% assert(inCell(fields,'CMAG3')) | ||
% assert(isequal(imap.('CMAG3'),{'corrMag','field3'})) | ||
% assert(inCell(fields,'PERG2')) | ||
% assert(isequal(imap.('PERG2'),{'percentGood','field2'})) | ||
% | ||
% assert(inCell(fields,'HEADING_MAG')) | ||
% assert(isequal(imap.('HEADING_MAG'),{'variableLeader','heading'})) | ||
% assert(inCell(fields,'TX_VOLT')) | ||
% assert(isequal(imap.('TX_VOLT'),{'variableLeader','adcChannel1'})) | ||
% | ||
% %test beam_vars | ||
% [~,vel_vars,beam_vars,ts_vars] = Workhorse.import_mappings(sensors,3,'_MAG','earth'); | ||
% assert(inCell(vel_vars,'UCUR_MAG')) | ||
% assert(inCell(vel_vars,'WCUR')) | ||
% assert(inCell(beam_vars,'ABSIC1')) | ||
% assert(inCell(beam_vars,'CMAG2')) | ||
% assert(inCell(beam_vars,'PERG3')) | ||
% assert(inCell(ts_vars,'HEADING_MAG')) | ||
% assert(~inCell(ts_vars,'PSAL')) | ||
% | ||
% | ||
% author: [email protected] | ||
% | ||
|
||
narginchk(4, 4); | ||
|
||
imap = struct(); | ||
|
||
switch frame_of_reference | ||
case 'earth' | ||
vel_vars = {['VCUR' name_extension], ['UCUR' name_extension], 'WCUR'}; | ||
if num_beams>3 | ||
imap.(['UCUR' name_extension]) = {'velocity', 'velocity1'}; | ||
imap.(['VCUR' name_extension]) = {'velocity', 'velocity2'}; | ||
imap.('WCUR') = {'velocity', 'velocity3'}; | ||
vel_vars = {['UCUR' name_extension], ['VCUR' name_extension], 'WCUR'}; | ||
if num_beams == 4 | ||
imap.('ECUR') = {'velocity', 'velocity4'}; | ||
vel_vars{end+1} = 'ECUR'; | ||
end | ||
case 'beam' | ||
imap.('VEL1') = {'velocity', 'velocity1'}; | ||
imap.('VEL2') = {'velocity', 'velocity2'}; | ||
imap.('VEL3') = {'velocity', 'velocity3'}; | ||
vel_vars = {'VEL1','VEL2','VEL3'}; | ||
if num_beams>3 | ||
if num_beams == 4 | ||
imap.('VEL4') = {'velocity', 'velocity4'}; | ||
vel_vars{end+1} = 'VEL4'; | ||
end | ||
otherwise | ||
errormsg('Frame of reference %s not implemented.',frame_of_reference) | ||
end | ||
|
||
beam_vars = {'ABSIC1', 'ABSIC2', 'ABSIC3', 'ABSIC4', 'CMAG1', 'CMAG2', 'CMAG3', 'CMAG4', 'PERG1', 'PERG2', 'PERG3', 'PERG4'}; | ||
ts_vars = {}; | ||
|
||
imap = struct(); | ||
|
||
for k = 1:num_beams | ||
imap.(vel_vars{k}) = {'velocity', ['velocity' num2str(k)]}; | ||
%follow the order of previous definitions for compatibility | ||
beam_vars = cell(1,num_beams*3); %ABSIC,CMAG,PERG | ||
c=0; | ||
for k=1:num_beams | ||
c=c+1; | ||
imap.(['ABSIC' num2str(k)]) = {'echoIntensity', ['field' num2str(k)]}; %backscatter | ||
beam_vars{c} = ['ABSIC' num2str(k)]; | ||
end | ||
for k=1:num_beams | ||
c=c+1; | ||
imap.(['CMAG' num2str(k)]) = {'corrMag', ['field' num2str(k)]}; %correlation | ||
beam_vars{c} = ['CMAG' num2str(k)]; | ||
end | ||
for k=1:num_beams | ||
c=c+1; | ||
imap.(['PERG' num2str(k)]) = {'percentGood', ['field' num2str(k)]}; %percentGood | ||
beam_vars{c} = ['PERG' num2str(k)]; | ||
end | ||
|
||
ts_vars = {}; | ||
if sensors.Temperature | ||
ts_vars = [ts_vars, 'TEMP']; | ||
imap.('TEMP') = {'variableLeader', 'temperature'}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
% | ||
% Example: | ||
% | ||
% idata = StaroddiParser({'0-4T3769.DAT'},'timeSeries'); | ||
% %see test/Parser/testStaroddi.m | ||
% | ||
% author: [email protected] | ||
% | ||
|
Oops, something went wrong.