-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwn_from_wd_spot_file.awk
executable file
·31 lines (29 loc) · 1.54 KB
/
wn_from_wd_spot_file.awk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/awk
### This awk script takes a file of 34 field WD extended spot lines and output 11 field wsprnet batch upload spot lines
### Doing that requries moving the 'sync_quality' to field 3 and transforming the 'pkt_mode' field in field $18 of extended spots to a subset in field 11 of the WN spot line
NF != 34 {
printf ("ERROR: WD spot file %s has %d fields instead of the expected 34 fields\n", FILENAME, NF )
}
NF == 34 {
if ( $8 == "none" ) {
$8 = " "
}
wd_pkt_mode = $18
if ( wd_pkt_mode == 2 ) ### produced by 'wsprd'
wn_pkt_mode = 2 ### WSPR-2
else if ( wd_pkt_mode == 15 ) ### produced by 'wsprd'
wn_pkt_mode = 15 ### WSPR-15
else if ( wd_pkt_mode == 3 ) ### added by WD to the lines produced by 'jt9'
wn_pkt_mode = 3 ### FST4W-120
else if ( wd_pkt_mode == 6 ) ### added by WD to the lines produced by 'jt9'
wn_pkt_mode = 5 ### FST4W-300
else if ( wd_pkt_mode == 16 ) ### added by WD to the lines produced by 'jt9'
wn_pkt_mode = 15 ### FST4W-900
else if ( wd_pkt_mode == 31 ) ### added by WD to the lines produced by 'jt9'
wn_pkt_mode = 30 ### FST4W-1800
else {
wn_pkt_mod= 2
printf ("ERROR: WD spot line has pkt_mode = '%s', not one of the expected 2/3/5/15/16/30 values: ", wd_pkt_mode)
}
printf ( "%6s %4s %5.2f %3d %5.2f %12.7f %-14s %-6s %2d %2d %4d\n", $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, wn_pkt_mode)
}