This commit is contained in:
N9OZB
2019-07-20 05:52:03 -05:00
parent 047c2f9d27
commit c20c92fcfb
119 changed files with 0 additions and 14439089 deletions

View File

@@ -1,15 +0,0 @@
Utility for convertng .ant files to Signal Server Format
ant2azel
-i antfilenam
-o outputfile
-d enable debugging
-h print help
-a Set the azimuth of the antenna
-t Set the mechanical tilt of the antenna positive numbers are downtilt.
orginal version by kd7lxl, adapted to include the azimuth and tilt

View File

@@ -1,64 +0,0 @@
#!/usr/bin/env python
import sys
import getopt
import os.path
from os.path import splitext
def db_to_norm(db):
return 10**(db/10.)
def main(argv):
antfile = ''
outfile = ''
direction = 0
tilt = 0
debug = 0
program = os.path.basename(__file__)
try:
opts, args = getopt.getopt(argv,"dha:i:o:t:",["debug","help","azimuth=","infile=","outfile=","tilt="])
except getopt.GetoptError:
print program + ' --debug --help -a <azimuth> -t <mechanicaldowntilt> -i <inputfile> -o <outputfile>'
sys.exit(2)
for opt, arg in opts:
if opt in ("-d", "--debug"):
debug = 1
elif opt in ("-h", "--help"):
print program + ' --debug --help -a <azimuth> -t <mechanicaldowntilt> -i <inputfile> -o <outputfile>'
sys.exit(2)
elif opt in ("-i", "--infile"):
antfile = arg
elif opt in ("-o", "--outfile"):
outfile = arg
elif opt in ("-a", "--azimuth"):
direction = arg
elif opt in ("-t", "--tilt"):
tilt = arg
if antfile == '':
print program + ' --debug --help -a <azimuth> -t <mechanicaldowntilt> -i <inputfile> -o <outputfile>'
sys.exit(2)
if outfile == '' :
outfile = splitext(antfile)[0]
if debug :
print "outfile " + outfile
print "downtilt " + tilt
with open(antfile, 'r') as ant:
with open(outfile + '.az', 'w') as az:
# azimuth offset as provided by command arg or 0
az.write("%d\n" % float(direction))
# Read the first 360 lines of the file
for i in xrange(360):
az.write("%d\t%0.4f\n" % (i, db_to_norm(float(next(ant)))))
with open(outfile + '.el', 'w') as el:
# mechanical downtilt, azimuth of tilt
el.write("%0.1f\t%0.1f\n" % (float(tilt), float(direction)))
# Read the lines for elevations +10 through -90).
# The rest of the .ant is unused.
for i, line in enumerate(list(ant)[80:181], -10):
el.write("%d\t%0.4f\n" % (i, db_to_norm(float(line))))
if __name__ == "__main__":
main(sys.argv[1:])