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

The eigenvectors are now calculated by two variations [0 1], [0 -1] and [1 0], [-1 0].

parent 27f9b4b4
No related branches found
No related tags found
No related merge requests found
301 302
\ No newline at end of file \ No newline at end of file
function [plotHandles] = plotOffsetVariations(pAxesHandle, pVariationResults, pColor) function [plotHandles] = plotOffsetVariations(pAxesHandle, pVariationResults, pOffsetVariations, pColor)
%PLOTOFFSETVARIATIONS Summary of this function goes here %PLOTOFFSETVARIATIONS Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -16,6 +16,10 @@ lat = cellfun(@(x) x.observations(end, 1), pVariationResults)'; ...@@ -16,6 +16,10 @@ lat = cellfun(@(x) x.observations(end, 1), pVariationResults)';
lon = cellfun(@(x) x.observations(end, 2), pVariationResults)'; lon = cellfun(@(x) x.observations(end, 2), pVariationResults)';
dates = cellfun(@(x) x.date, pVariationResults)'; dates = cellfun(@(x) x.date, pVariationResults)';
%% Find indices of 0 1, 0 -1 and 1 0, -1 0
indicesFirstDimension = [find(all(pOffsetVariations == [0, 1], 2)), find(all(pOffsetVariations == [0, -1], 2))];
indicesSecondDimension = [find(all(pOffsetVariations == [1, 0], 2)), find(all(pOffsetVariations == [-1, 0], 2))];
%% Plot the eigenvectors and ellipse for every position %% Plot the eigenvectors and ellipse for every position
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
for i = 1:length(dates) for i = 1:length(dates)
...@@ -29,14 +33,17 @@ for i = 1:length(dates) ...@@ -29,14 +33,17 @@ for i = 1:length(dates)
continue; continue;
end end
[ver_line_lat, ver_line_lon] = track2(currentResults.observations(indicesFirstDimension(1), 1), currentResults.observations(indicesFirstDimension(1), 2), currentResults.observations(indicesFirstDimension(2), 1), currentResults.observations(indicesFirstDimension(2), 2));
[hor_line_lat, hor_line_lon] = track2(currentResults.observations(indicesSecondDimension(1), 1), currentResults.observations(indicesSecondDimension(1), 2), currentResults.observations(indicesSecondDimension(2), 1), currentResults.observations(indicesSecondDimension(2), 2));
if mod(i, 10) == 0 if mod(i, 10) == 0
plotHandles = [ ... plotHandles = [ ...
plotHandles, ... plotHandles, ...
{ ... { ...
line(plot_values.new_ver_line(1, :), plot_values.new_ver_line(2, :)), ... line(ver_line_lon, ver_line_lat), ...line(plot_values.new_horz_line(1, :), plot_values.new_horz_line(2, :)), ...
line(plot_values.new_horz_line(1, :), plot_values.new_horz_line(2, :)), ... line(hor_line_lon, hor_line_lat), ...
plot(plot_values.rotated_ellipse(1, :), plot_values.rotated_ellipse(2, :), 'Color', pColor), ... plot(plot_values.rotated_ellipse(1, :), plot_values.rotated_ellipse(2, :), 'Color', pColor), ...
scatter(currentResults.observations(:, 2), currentResults.observations(:, 1), 10, 'k', 'filled') ... scatter(currentResults.observations(:, 2), currentResults.observations(:, 1), 10, [.6 .6 .6], 'filled') ...
} ... } ...
]; ];
else else
......
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