How to finding GAPS in satellite access times.
Show older comments
Hello,
Appreciate any help on how to find gaps in satellite access. The attached picture shows Iridium satellite accesses to a radio near Dulles during 1 day. You can see there are many overlapping accesses. I am trying to find any periods of time that do not have access (any time gaps in coverage). I do have Aerospace Toolbox which quickly calculates all the access intervals.
My question is a may be a more complex verion of this Q&A:
I have tried several plotting approaches but not luck yet. The plot function needed seems like a combination of "stairs" and many, superimposed "fplot" intervals; however fplot intervals do not seem to accept datetime input (the attached shows an attempt to fplot just one access interval).
Thanks in advance.
-Mike
Accepted Answer
More Answers (1)
There are ways to do this without loops, but the most straight-forward way (assuming the data are sorted by start time) is brute force, something like this:
StartTime = datetime(2023,11,22,0,[0,1,4,5,10,12,14,17,21]',0);
StopTime = datetime(2023,11,22,0,[1,2,11,16,21,20,25,24,28]',0);
Dur = StopTime - StartTime;
t = table(StartTime,StopTime,Dur)
for i = height(t):-1:2
upper = max(t.StopTime(1:i-1));
if t.StartTime(i) <= upper
t.StopTime(i-1) = max(t.StopTime(i),upper);
t(i,:) = [];
t.Dur(i-1) = t.StopTime(i-1) - t.StartTime(i-1);
end
t
end
In your data, IIUC, you had no gaps, so I changed them a bit. now you just need
gaps = table(t.StopTime(1:end-1),t.StartTime(2:end),t.StartTime(2:end)-t.StopTime(1:end-1),VariableNames=["GapStart" "GapStop" "GapDur"])
1 Comment
Michael Hurley
on 29 Nov 2023
Edited: Michael Hurley
on 29 Nov 2023
Categories
Find more on Scenario Generation and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!