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

Bugfixes, due to new soundspeed selection method.

parent cd7630f7
No related branches found
No related tags found
No related merge requests found
284 285
\ No newline at end of file \ No newline at end of file
...@@ -9,9 +9,6 @@ variableNames = { ... ...@@ -9,9 +9,6 @@ variableNames = { ...
'soundsources', ... 'soundsources', ...
'referencePosition', ... 'referencePosition', ...
'referencePositionEnd', ... 'referencePositionEnd', ...
'soundspeed1', ...
'soundspeed2', ...
'soundspeed3', ...
'trackingMethod', ... 'trackingMethod', ...
'backwardTracking' ... 'backwardTracking' ...
}; };
......
...@@ -20,9 +20,6 @@ emptyCell = { ... ...@@ -20,9 +20,6 @@ emptyCell = { ...
'', ... '', ...
referencePosition, ... referencePosition, ...
'', ... '', ...
1464, ...
1464, ...
1464, ...
'', ... '', ...
false ... false ...
}; };
......
...@@ -16,7 +16,9 @@ if any(isnan(pCombinationsTable.combinationEnd)) ...@@ -16,7 +16,9 @@ if any(isnan(pCombinationsTable.combinationEnd))
return; return;
end end
if any(strcmp(pCombinationsTable.soundsources, '')) unfilledSoundsources = strcmp(pCombinationsTable.soundsources, '');
isInterpolationMethod = artoa.trajectory.isInterpolationMethod(pCombinationsTable.trackingMethod);
if any(unfilledSoundsources & ~isInterpolationMethod)
message = 'The "Sound Sources" column contains an invalid value!'; message = 'The "Sound Sources" column contains an invalid value!';
return; return;
end end
......
...@@ -57,6 +57,28 @@ trackingMethod = pCombinationDetails.trackingMethod{:}; ...@@ -57,6 +57,28 @@ trackingMethod = pCombinationDetails.trackingMethod{:};
segmentStart = pCombinationDetails{1, 1}; segmentStart = pCombinationDetails{1, 1};
segmentEnd = pCombinationDetails{1, 2}; segmentEnd = pCombinationDetails{1, 2};
%% If it is interpolation method, call method directly
if artoa.trajectory.isInterpolationMethod(trackingMethod)
pStartEndPosition = [ ...
str2double(strsplit(pCombinationDetails.referencePosition{1}, ' ')); ...
str2double(strsplit(pCombinationDetails.referencePositionEnd{1}, ' ')) ...
];
pluginTables = struct( ...
'combinationBegin', pCombinationDetails.combinationBegin, ...
'combinationEnd', pCombinationDetails.combinationEnd ...
);
[segmentPositions, segmentClockError] = artoa.plugins.tracking.callTrackingMethod( ...
trackingMethod, ...
pluginTables, ...
NaN, ...
NaN, ...
pStartEndPosition ...
);
segmentDates = [pCombinationDetails.combinationBegin:1:pCombinationDetails.combinationEnd]';
segmentResiduals = struct();
return;
end
%% Filter toa data %% Filter toa data
intersectedToaDates = pCorrectedData.(soundsourceNames{1}).toaDate; intersectedToaDates = pCorrectedData.(soundsourceNames{1}).toaDate;
soundsourcePositions = [pCorrectedData.(soundsourceNames{1}).position]; soundsourcePositions = [pCorrectedData.(soundsourceNames{1}).position];
...@@ -137,16 +159,6 @@ if pBackwardTracking ...@@ -137,16 +159,6 @@ if pBackwardTracking
pCombinationDetails.referencePosition{1} = pCombinationDetails.referencePositionEnd{1}; pCombinationDetails.referencePosition{1} = pCombinationDetails.referencePositionEnd{1};
end end
if artoa.trajectory.isInterpolationMethod(pCombinationDetails.trackingMethod{1})
pStartEndPosition = [ ...
str2double(strsplit(pCombinationDetails.referencePosition{1}, ' ')); ...
str2double(strsplit(pCombinationDetails.referencePositionEnd{1}, ' ')) ...
];
pluginTables = struct( ...
'combinationBegin', pCombinationDetails.combinationBegin, ...
'combinationEnd', pCombinationDetails.combinationEnd ...
);
end
%% Call the corresponding tracking method from the plugin folder %% Call the corresponding tracking method from the plugin folder
[segmentPositions, segmentClockError] = artoa.plugins.tracking.callTrackingMethod( ... [segmentPositions, segmentClockError] = artoa.plugins.tracking.callTrackingMethod( ...
...@@ -166,24 +178,13 @@ if pBackwardTracking ...@@ -166,24 +178,13 @@ if pBackwardTracking
end end
%% Store toa dates %% Store toa dates
if artoa.trajectory.isInterpolationMethod(pCombinationDetails.trackingMethod{1}) segmentDates = intersectedToaDates;
segmentDates = [pCombinationDetails.combinationBegin:1:pCombinationDetails.combinationEnd]';
else
segmentDates = intersectedToaDates;
end
%% Calculate residuals %% Calculate residuals
% initalize variables % initalize variables
segmentResiduals = struct(); segmentResiduals = struct();
if artoa.trajectory.isInterpolationMethod(pCombinationDetails.trackingMethod{1})
for i = 1:length(soundsourceNames)
segmentResiduals.(soundsourceNames{i}) = NaN(length(segmentDates), 1);
end
return;
end
for i = 1:length(soundsourceNames) for i = 1:length(soundsourceNames)
segmentResiduals.(soundsourceNames{i}) = []; segmentResiduals.(soundsourceNames{i}) = [];
end end
......
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