Newer
Older
function [scatterHandle, textHandles] = scatterSatDataPositions(pAxesHandle, pSatDataPositions, pPlotAsMap)
%SCATTERSATDATAPOSITIONS Summary of this function goes here
% Detailed explanation goes here
%% Remove NaN
leprob001
committed
selection = ~isnan(pSatDataPositions.lon_sat) & ~isnan(pSatDataPositions.lat_sat);
x = pSatDataPositions.lon_sat(selection);
y = pSatDataPositions.lat_sat(selection);
% get all SAT dates to the positions
year = pSatDataPositions.year_sat(selection);
month = pSatDataPositions.month_sat(selection);
day = pSatDataPositions.day_sat(selection);
% fill all NaN with the rtc dates
year_rtc = pSatDataPositions.year_rtc(selection);
month_rtc = pSatDataPositions.month_rtc(selection);
day_rtc = pSatDataPositions.day_rtc(selection);
year(isnan(year)) = year_rtc(isnan(year));
month(isnan(month)) = month_rtc(isnan(month));
day(isnan(day)) = day_rtc(isnan(day));
steps = 1:length(x);
%% Prepare text cell
textCell = {};
for i = steps
leprob001
committed
textCell{end + 1} = {'', [' ' num2str(year(i)) '-' pad(num2str(month(i)), 2, 'left', '0') '-' pad(num2str(day(i)), 2, 'left', '0') ', ' num2str(artoa.convert.dmy2rd(day(i), month(i), year(i)))]};
% make handle the current axes
axes(pAxesHandle);
if pPlotAsMap
scatterHandle = scatterm(pAxesHandle, y, x, [], [.5 .5 .5]);
textHandles = textm(y(steps), x(steps), textCell, 'FontSize', 7, 'Color', [.5 .5 .5]);
else
scatterHandle = scatter(pAxesHandle, x, y, [], [.5 .5 .5]);
textHandles = text(pAxesHandle, x(steps), y(steps), textCell, 'FontSize', 7, 'Color', [.5 .5 .5]);
end