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

Bugfix, Reference position was not plotted correctly.

parent 32d5e4b0
No related branches found
No related tags found
No related merge requests found
......@@ -21,11 +21,6 @@ if any(strcmp(pCombinationsTable.soundsources, ''))
return;
end
if any(strcmp(pCombinationsTable.referencePosition, ''))
message = 'The "Reference Position" column contains an invalid value!';
return;
end
if any(isnan(pCombinationsTable.soundspeed1)) ...
|| any(isnan(pCombinationsTable.soundspeed2)) ...
|| any(isnan(pCombinationsTable.soundspeed3)) ...
......
......@@ -37,13 +37,6 @@ uniqueToaDates = unique(pToaData.toaDate);
[involvedSoundsources, involvedSoundsourceNames] = ...
artoa.controller.track.getInvolvedSoundsources();
%% Add float drift to TOA
pToaData = artoa.data.addFloatDrift( ...
pToaData, ...
pTrackingParameter.soundsourceOffsets{'Float', 'Begin'}, ...
pTrackingParameter.soundsourceOffsets{'Float', 'End'} ...
);
%% Initialize return variables
trajectory = false;
trajectoryDates = false;
......@@ -110,12 +103,7 @@ for i = 1:length(involvedSoundsources)
kx = find(abs(currentToaDate - dates(oDates)) < 1/2);
currentToa(kx) = currentToa(kx) - offsets(oDates);
end
% subtract offset (corrective value) of sound source
soundsourceOffsetCorrectiveValue = ...
pTrackingParameter.soundsourceOffsets{currentSoundsource.sourcename, 'Begin'};
currentToa = currentToa - soundsourceOffsetCorrectiveValue;
% interpolate toa data
[ ...
preparedData.(currentSoundsource.sourcename).toaDate, ...
......@@ -128,7 +116,6 @@ for i = 1:length(involvedSoundsources)
pTrackingParameter.gapSize, ...
lower(pTrackingParameter.interpolationMethodString) ...
);
%preparedData.(currentSoundsource.sourcename).toaIndex = preparedData.(currentSoundsource.sourcename).toaIndex';
% combine interpolated and original data and sort them
preparedData.(currentSoundsource.sourcename).toaDate = ...
......@@ -196,8 +183,6 @@ end
%% Get static data
floatReferenceTime = pFloatDetails.phasereftime;
%startPosition = [pSatData.lat_sat(1) pSatData.lon_sat(1)];
%trackingMethod = lower(pTrackingParameter.trackingMethodString);
trajectory = [];
trajectoryDates = [];
......
......@@ -14,6 +14,7 @@ cla(pAxesHandle);
%% Plot data
hold(pAxesHandle, 'on');
counter = 1;
for i = 1:length(fnames)
current = pTrajectory.timeDivergenceToGps.(fnames{i});
if isempty(current)
......@@ -22,7 +23,8 @@ for i = 1:length(fnames)
x = current(:, 1);
y = current(:, 2);
handleTimeDivergenceToGps.(fnames{i}) = plot(pAxesHandle, x, y, '.-');
legendText{i} = fnames{i};
legendText{counter} = fnames{i};
counter = counter + 1;
end
hold(pAxesHandle, 'off');
......
......@@ -2,14 +2,19 @@ function [scatterHandles, textHandles] = plotTrajectoryReferencePositions(pAxesH
%PLOTTRAJECTORYREFERENCEPOSITIONS Summary of this function goes here
% Detailed explanation goes here
%% Prepare variables
referencePositions = pTrajectory.trackParameter.soundsourceCombinations.referencePosition;
referencePositions = cellfun(@strsplit, referencePositions, 'UniformOutput', false);
referencePositions = cellfun(@str2double, referencePositions, 'UniformOutput', false);
referencePositions = cell2mat(referencePositions);
x = referencePositions(:, 2);
y = referencePositions(:, 1);
x = [];
y = [];
for i = 1:length(pTrajectory.trackParameter.soundsourceCombinations.referencePosition)
current = pTrajectory.trackParameter.soundsourceCombinations.referencePosition{i};
if strcmp('', strtrim(current))
continue;
end
tmp = str2double(strsplit(current));
x = [x; tmp(2)];
y = [y; tmp(1)];
end
%% Plot
......
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