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

Bugfixes, NaN positions are now removed if tracking algorithm does not converge.

parent fef7ff43
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ scatterHandle = scatter( ...
t = artoa.convert.rd2dmy(trajectoryDates(surfaceDates));
trd = round(trajectoryDates(surfaceDates));
textHandles = cell(1, length(t));
for i = 1:length(t)
for i = 1:length(x)
textHandles{i} = text( ...
x(i), ...
y(i), ...
......
......@@ -228,6 +228,14 @@ for oCombination = 1:size(soundsourceCombinations, 1)
pSoundVelocity(oCombination, :), ...
pTrackingParameter.trackingMethodString ...
);
% remove NaNs from segment
validPositions = all(~isnan(segmentPositions), 2);
segmentPositions = segmentPositions(validPositions, :);
segmentDates = segmentDates(validPositions);
segmentClockError = segmentClockError(validPositions);
segmentResiduals = structfun(@(x) x(validPositions), segmentResiduals, 'UniformOutput', false);% segmentResiduals(validPositions);
if islogical(segmentPositions) && segmentPositions == false
trajectory = false;
trajectoryDates = false;
......@@ -290,10 +298,10 @@ for oCombination = 1:size(soundsourceCombinations, 1)
% get all sat dates
satDates = artoa.convert.dmy2rd(pSatData.day_sat, pSatData.month_sat, pSatData.year_sat);
% get all dates that intersect with segment
[~, index, ~] = intersect(round(segmentDates), round(satDates));
intersectedSegmentPositions = segmentPositions(index, :);
intersectedSegmentDates = segmentDates(index, :);
satPositions = [pSatData.lat_sat(index), pSatData.lon_sat(index)];
[~, segmentDatesIndex, satIndex] = intersect(round(segmentDates), round(satDates));
intersectedSegmentPositions = segmentPositions(segmentDatesIndex, :);
intersectedSegmentDates = segmentDates(segmentDatesIndex, :);
satPositions = [pSatData.lat_sat(satIndex), pSatData.lon_sat(satIndex)];
% get all soundsources of segment
segmentSoundsources = artoa.data.extractSoundsourcesFromStruct( ...
strsplit(soundsourceCombinations.soundsources{oCombination}), ...
......
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