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)
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
......
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' ...
......
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