Appendix c. antenna orientation computer program – Campbell Scientific TX312 High Data Rate GOES Transmitter User Manual
Page 47
C-1
Appendix C. Antenna Orientation
Computer Program (written in BASIC)
5 REM THIS PROGRAM CALCULATES THE AZIMUTH AND
ELEVATION FOR AN
6 REM ANTENNA USED WITH A DCP FOR GOES SATELLITE
COMMUNICATIONS
10 CLS : CLEAR 1000
20 INPUT "SATELLITE LONGITUDE (DDD.DD)"; SO
30 INPUT "ANTENNA LONGITUDE (DDD.DD)"; SA
40 PRINT "ANTENNA LATITUDE (DDD.DD)--(SOUTH LATITUDE
ENTERED"
45 INPUT "AS NEGATIVE NUMBER)"; AA: A = 90 - AA
50 INPUT "ANTENNA HEIGHT ABOVE SEA LEVEL IN FEET"; AH
60 T = SO - SA: TR = T * .01745329#: BR = 90 * .01745329#: AR = A *
.01745329#
70 X = COS(AR) * COS(BR) + SIN(AR) * SIN(BR) * COS(TR)
80 CR = -ATN(X / SQR(-X * X + 1)) + 1.5708
90 C = CR * (1 / .01745329#)
100 X1 = (SIN(BR) * SIN(TR)) / SIN(CR)
110 BR = ATN(X1 /SQR(-X1 * X1 + 1)): B = BR * (1 / .01745329#)
115 GOSUB
300
120 A1 = 90 - C: R1 = A1 * .01745329#
130 S1 = (6378 + (AH * .0003048)) / SIN(R1)
140 S2 = 35785! + 6378 - S1
150 A2 = 180 - A1: R2 = A2 * .01745329#
155 S4 = SQR(S1 ^ 2 - (6378 + AH * .0003048) ^ 2)
160 S3 = SQR(S4 ^ 2 + S2 ^ 2 - 2 * S4 * S2 * COS(R2))
170 X2 = (SIN(R2) / S3) * S2
180 ER = ATN(X2 / SQR(-X2 * X2 + 1)): E = ER * (1 / .01745329#)
190 PRINT "ANTENNA ELEVATION ANGLE="; E; " DEGREES"
200 PRINT "ANTENNA AZIMUTH ANGLE="; B; " DEGREES"
210 PRINT : PRINT : PRINT "HIT ANY KEY TO CONTINUE"
220 I$ = INKEY$: IF I$ = "" THEN 220 ELSE CLS : GOTO 20
300 IF T < 0 AND AA > 0 THEN B = B + 180: GOTO 380
310 IF T < 0 AND AA < 0 THEN B = B * -1: GOTO 380
320 IF T > 0 AND AA < 0 THEN B = 360 - B: GOTO 380
330 IF T > 0 AND AA > 0 THEN B = B + 180: GOTO 380
340 IF T = 0 AND AA > 0 THEN B = 180: GOTO 380
350 IF T = 0 AND AA < 0 THEN B = 360: GOTO 380
360 IF AA = 0 AND T > 0 THEN B = 270: GOTO 380
370 IF AA = 0 AND T < 0 THEN B = 90
380 RETURN
400 RETURN
460 RETURN