diff --git a/lib/+artoa/+controller/+track/run.m b/lib/+artoa/+controller/+track/run.m index 495ad66ac1013a21d74dccea525806f1f9dcdd3c..d00abfa35fa4d0c40b4c010961c899a319bf4479 100644 --- a/lib/+artoa/+controller/+track/run.m +++ b/lib/+artoa/+controller/+track/run.m @@ -30,10 +30,6 @@ for i = 1:size(soundVelocity, 1) if strcmpi( ... artoaWorkspace.trackParameter.soundspeedMethodString, ... 'manual' ... - ) ... - && strcmpi( ... - artoaWorkspace.trackParameter.trackingMethodString, ... - 'hyperbolic' ... ) soundVelocity(i, :) = [ ... artoaWorkspace.trackParameter.soundsourceCombinations.soundspeed1(i), ... @@ -42,17 +38,20 @@ for i = 1:size(soundVelocity, 1) ]; elseif strcmpi( ... artoaWorkspace.trackParameter.soundspeedMethodString, ... - 'manual' ... + 'soundsource file' ... ) - soundVelocity(i, :) = ... - artoaWorkspace.trackParameter.soundsourceCombinations.soundspeed1(i); + % get soundsource names + soundsourceNames = strsplit(artoaWorkspace.trackParameter.soundsourceCombinations.soundsources{i}); + % get soundspeed for every soundsource + for oName = 1:length(soundsourceNames) + soundVelocity(i, oName) = ... + artoaWorkspace.filteredSoundsources.(soundsourceNames{oName}).sound_speed; + end else - fnames = fieldnames(artoaWorkspace.filteredSoundsources); soundVelocity(i, :) = artoa.data.calculateSoundVelocity( ... artoaWorkspace.temperature(artoaWorkspace.statusTemperature == 1), ... artoaWorkspace.pressure(artoaWorkspace.statusPressure == 1), ... - artoaWorkspace.trackParameter.soundspeedMethodString, ... - artoaWorkspace.filteredSoundsources.(fnames{1}) ... % WHICH SOUNDSOURCE TO USE IF "soundsource" IS SELECTED?? + artoaWorkspace.trackParameter.soundspeedMethodString ... ); % TODO: IMPLEMENT OTHER SOUNDVELOCITY OPTIONS end diff --git a/lib/+artoa/+data/calculateSoundVelocity.m b/lib/+artoa/+data/calculateSoundVelocity.m index dd302a6b9a820f8655831678c2e5b6d787f891de..06499f64cfc3802f1b7079feb7622c35110e2682 100644 --- a/lib/+artoa/+data/calculateSoundVelocity.m +++ b/lib/+artoa/+data/calculateSoundVelocity.m @@ -1,4 +1,4 @@ -function [calculatedSoundVelocity] = calculateSoundVelocity(pTemperature, pPressure, pMethod, pSoundSource) +function [calculatedSoundVelocity] = calculateSoundVelocity(pTemperature, pPressure, pMethod) %CALCULATESOUNDVELOCITY Calculates the sound velocity based on the given values. % Parameters: % pTemperature The temperature array. @@ -23,8 +23,6 @@ switch lower(pMethod) % del grosso is default calculatedSoundVelocity = 1490; end clear indices; - case 'soundsource' - calculatedSoundVelocity = pSoundSource.sound_speed; otherwise calculatedSoundVelocity = artoa.vendor.oceanstoolbox.sndspd( ... 35, mean(pTemperature(~isnan(pTemperature))), mean(pPressure(~isnan(pPressure))), 'del grosso' ...