Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function [soundvelocity] = selectSoundspeed()
%SELECTSOUNDSPEED Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Get required variables
soundsourceNames = fieldnames(artoaWorkspace.filteredSoundsources);
trackParameter = artoa.data.getMember(artoaWorkspace, {'trackParameter'}, false);
soundspeedTable = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'soundspeed'}, false);
%% Get used method
if ~islogical(trackParameter)
method = trackParameter.soundspeedMethodString;
else
method = 'del grosso';
end
%% Fill with manual values or NaN
if ~islogical(soundspeedTable)
initMatrix = repmat(soundspeedTable{'Soundspeed', 'Empirical'}, length(soundsourceNames), 1);
else
initMatrix = NaN(length(soundsourceNames), 1);
end
%% Initialize table
soundvelocity = table(initMatrix, 'RowNames', soundsourceNames);
%% If manual has been chosen, we are ready
if strcmpi(method, 'manual')
return;
end
%% Get every velocity for each soundsource
if strcmpi(method, 'soundsource file')
for i = 1:length(soundsourceNames)
soundvelocity{soundsourceNames{i}, 1} = ...
artoaWorkspace.filteredSoundsources.(soundsourceNames{i}).sound_speed;
end
return;
end
soundvelocity{:, :} = artoa.data.calculateSoundVelocity( ...
artoaWorkspace.temperature(artoaWorkspace.statusTemperature == 1), ...
artoaWorkspace.pressure(artoaWorkspace.statusPressure == 1), ...
method ...
);
end