xref: /freebsd/contrib/ntp/scripts/stats/ensemble.awk (revision f386f04f11679fd31731bce42208bb4363b79e75)
1# program to produce loran ensemble statistics from clockstats files
2#
3# usage: awk -f ensemble.awk clockstats
4#
5# format of input record (time values in seconds)
6# 49165 8.628 127.127.10.1 93:178:00:00:07.241 LORAN ENSEMBLE
7# -6.43E-08 +5.02E-08 .091 +5.98E-08 +1.59E-08 .909 +4.85E-08 +3.52E-08
8#
9# format of output record (time values in nanoseconds)
10#  MJD       sec     GPS    wgt    LORAN   wgt      avg   sigma
11# 49165     8.628   -64.3  0.091    59.8  0.909    48.5    35.2
12#
13# select LORAN ENSEMBLE records with valid format and weights
14{
15	if (NF >= 14 && $6 == "ENSEMBLE" && $9 > 0 && $12 > 0)
16		printf "%5s %9.3f %7.1f %6.3f %7.1f %6.3f %7.1f %7.1f\n", $1, $2, $7*1e9, $9, $10*1e9, $12, $13*1e9, $14*1e9
17}
18