1 # program to produce loran tdata statistics from clockstats files
3 # usage: awk -f tdata.awk clockstats
5 # format of input record (missing replaced by -40.0)
6 # 49228 36.852 127.127.10.1 93:241:00:00:20.812 LORAN TDATA
7 # M OK 0 0 1169.14 -7.4 3.16E-07 .424
8 # W CV 0 0 3329.30 -16.4 1.81E-06
9 # X OK 0 0 1737.19 -10.5 3.44E-07 .358
10 # Y OK 0 0 2182.07 -9.0 4.41E-07 .218
12 # format of output record (time in nanoseconds, signal values in dB)
13 # MJD sec time M W X Y Z
14 # 49228 36.852 175.0 -7.4 -16.4 -10.5 -9.0
16 # select LORAN TDATA records with valid format
18 if (NF >=
7 && $
6 ==
"TDATA") {
19 m = w = x = y = z =
-40.0
20 for (i =
7; i
< NF - 5; i
++) {
21 if ($i ==
"M" && $
(i
+1) ==
"OK") {
25 else if ($i ==
"W" && $
(i
+1) ==
"OK") {
29 else if ($i ==
"X" && $
(i
+1) ==
"OK") {
33 else if ($i ==
"Y" && $
(i
+1) ==
"OK") {
37 else if ($i ==
"Z" && $
(i
+1) ==
"OK") {
42 printf "%5s %9.3f %6.1f %6.1f %6.1f %6.1f %6.1f\n", $
1, $
2, m
, w
, x
, y
, z