xref: /netbsd-src/external/bsd/ntp/dist/scripts/stats/itf.awk (revision abb0f93cd77b67f080613360c65701f85e5f5cfe)
1*abb0f93cSkardel# program to produce intewrnal time/frequence statistics from clockstats files
2*abb0f93cSkardel#
3*abb0f93cSkardel# usage: awk -f itf.awk clockstats
4*abb0f93cSkardel#
5*abb0f93cSkardel# format of input record
6*abb0f93cSkardel# 49227 67.846 127.127.10.1 93:240:00:00:51.816 ITF
7*abb0f93cSkardel# COCO 0 +2.0579E-07 -3.1037E-08 -7.7723E-11 +6.5455E-10 500.00 4.962819
8*abb0f93cSkardel#
9*abb0f93cSkardel# format of output record (time values in nanoseconds)
10*abb0f93cSkardel#  MJD      sec      time        freq
11*abb0f93cSkardel# 49227   67.846  +2.0579E-07  -7.7723E-11
12*abb0f93cSkardel#
13*abb0f93cSkardel# select ITF records with valid format
14*abb0f93cSkardel{
15*abb0f93cSkardel	if (NF >= 10 && $5 == "ITF") {
16*abb0f93cSkardel		printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $8 * 1e9, $10
17*abb0f93cSkardel	}
18*abb0f93cSkardel}
19*abb0f93cSkardel
20