Skip to content
Snippets Groups Projects
Commit 2b62443c authored by leprob001's avatar leprob001
Browse files

Adjusted soundspeed calculations.

parent eafcf6fe
No related branches found
No related tags found
No related merge requests found
...@@ -30,10 +30,6 @@ for i = 1:size(soundVelocity, 1) ...@@ -30,10 +30,6 @@ for i = 1:size(soundVelocity, 1)
if strcmpi( ... if strcmpi( ...
artoaWorkspace.trackParameter.soundspeedMethodString, ... artoaWorkspace.trackParameter.soundspeedMethodString, ...
'manual' ... 'manual' ...
) ...
&& strcmpi( ...
artoaWorkspace.trackParameter.trackingMethodString, ...
'hyperbolic' ...
) )
soundVelocity(i, :) = [ ... soundVelocity(i, :) = [ ...
artoaWorkspace.trackParameter.soundsourceCombinations.soundspeed1(i), ... artoaWorkspace.trackParameter.soundsourceCombinations.soundspeed1(i), ...
...@@ -42,17 +38,20 @@ for i = 1:size(soundVelocity, 1) ...@@ -42,17 +38,20 @@ for i = 1:size(soundVelocity, 1)
]; ];
elseif strcmpi( ... elseif strcmpi( ...
artoaWorkspace.trackParameter.soundspeedMethodString, ... artoaWorkspace.trackParameter.soundspeedMethodString, ...
'manual' ... 'soundsource file' ...
) )
soundVelocity(i, :) = ... % get soundsource names
artoaWorkspace.trackParameter.soundsourceCombinations.soundspeed1(i); 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 else
fnames = fieldnames(artoaWorkspace.filteredSoundsources);
soundVelocity(i, :) = artoa.data.calculateSoundVelocity( ... soundVelocity(i, :) = artoa.data.calculateSoundVelocity( ...
artoaWorkspace.temperature(artoaWorkspace.statusTemperature == 1), ... artoaWorkspace.temperature(artoaWorkspace.statusTemperature == 1), ...
artoaWorkspace.pressure(artoaWorkspace.statusPressure == 1), ... artoaWorkspace.pressure(artoaWorkspace.statusPressure == 1), ...
artoaWorkspace.trackParameter.soundspeedMethodString, ... artoaWorkspace.trackParameter.soundspeedMethodString ...
artoaWorkspace.filteredSoundsources.(fnames{1}) ... % WHICH SOUNDSOURCE TO USE IF "soundsource" IS SELECTED??
); );
% TODO: IMPLEMENT OTHER SOUNDVELOCITY OPTIONS % TODO: IMPLEMENT OTHER SOUNDVELOCITY OPTIONS
end end
......
function [calculatedSoundVelocity] = calculateSoundVelocity(pTemperature, pPressure, pMethod, pSoundSource) function [calculatedSoundVelocity] = calculateSoundVelocity(pTemperature, pPressure, pMethod)
%CALCULATESOUNDVELOCITY Calculates the sound velocity based on the given values. %CALCULATESOUNDVELOCITY Calculates the sound velocity based on the given values.
% Parameters: % Parameters:
% pTemperature The temperature array. % pTemperature The temperature array.
...@@ -23,8 +23,6 @@ switch lower(pMethod) % del grosso is default ...@@ -23,8 +23,6 @@ switch lower(pMethod) % del grosso is default
calculatedSoundVelocity = 1490; calculatedSoundVelocity = 1490;
end end
clear indices; clear indices;
case 'soundsource'
calculatedSoundVelocity = pSoundSource.sound_speed;
otherwise otherwise
calculatedSoundVelocity = artoa.vendor.oceanstoolbox.sndspd( ... calculatedSoundVelocity = artoa.vendor.oceanstoolbox.sndspd( ...
35, mean(pTemperature(~isnan(pTemperature))), mean(pPressure(~isnan(pPressure))), 'del grosso' ... 35, mean(pTemperature(~isnan(pTemperature))), mean(pPressure(~isnan(pPressure))), 'del grosso' ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment