I have been trying to think about identifying points that we *didn't* receive packets,
I assume that every time I get a GPGGA I move on to a new time period (typically 1 second);
I assume that in a perfect world I should get a P3I log entry for the aircraft I am close to every new time period;
So this give us something like the below:
[kevin@quota Tracks]$ cat 2016-09-2*.trk | awk -F, '{ if ($1 == "$GPGGA") printf "."; else if ($1 == "$PFLAA" && $7 ~ "160XXX" && $7 ~ "#G") print; }' | head -3
........................................................$PFLAA,3,4,11,53,1,160XXX!#G-TOXX#,0,,0,,8*2C
.$PFLAA,3,7,8,56,1,160XXX!#G-TOXX#,0,,0,,8*12
.$PFLAA,3,8,6,56,1,160XXX!#G-TOXX#,0,,0,,8*13
We start off with no reception (whilst we wait for both units to get a GPS signal), and then get a PFLAA sentence every GPGGA time period (represented by 1 full stop).
Building from that, acknowledging that we dont need a perfect world to still give us saftey - lets assume that actually we only need a log entry once every 5 seconds;
And then lets count how many times we get a gap of more than 5 seconds in PFLAA packets for that specific aircraft across various distances between units:
kevin@quota Tracks$ cat 2016-09-2*.trk | awk -F, '{ if ($1 == "$GPGGA") printf "."; else if ($1 == "$PFLAA" && $7 ~ "160XXX" && $7 ~ "#G") printf(" %3.0f\n", sqrt($3*$3 + $4*$4)/1000 ); }' | grep -F ..... | awk '{ print $2; }' | sort -n | uniq -c
25 0
27 1
11 2
2 3
1 4
1 5
1 7
Thats about 70 times that P3I has been lost for 5 seconds or more - which includes 10 new flights and a few reboots, etc - lets call it 50 times we lost signal.
and for the other aircraft:
[kevin@quota Tracks]$ cat 2016-09-2*.trk | awk -F, '{ if ($1 == "$GPGGA") printf "."; else if ($1 == "$PFLAA" && $7 ~ "404XXX" && $7 ~ "#G") printf(" %3.0f\n", sqrt($3*$3 + $4*$4)/1000 ); }' | grep -F ..... | awk '{ print $2; }' | sort -n | uniq -c
7 0
3 1
2 2
2 3
2 4
1 6
Thats about 17 times that P3I has been lost for 5 seconds or more - which includes 10 new flights and a few reboots, etc - I think that's close to zero.
Do we think the code is accurately interpreting the log data?
Cheers
Kev