Azimuth and elevation-SAT COMM
Azimuth and elevation-SAT COMM
Satellite Communications
Submitted to:
Dr. Qamar ul Islam
Submitted by:
Hafiza Ammara Khurshid
Reg. No.: 140411006
MS (WC)
AZIMUTH & ELEVATION ANGLE
Azimuth and elevation angles can be calculated for different position vectors of a satellite at
different latitude and longitude heights and GPS time.
This utility plots the calculated satellite positions or trajectories in an elevation-azimuth plot
'el-az' martix which rows contain an SV id number, a GPS time (seconds), and the elevation-
azimuth look angles (degrees) to the satellite location; if positional plot is desired the following
condition must be met: the GPS time for all satellites must be the same; if trajectory plot is desired
the following conditions must be met: the same number of satellites must be included in each
sample and within each sample all GPS times must be the same.
Matlab Code
%plot & calculate satellite positions in an elevation-azimuth
plot
function [ ] = plotSat(el_az);
el_az=[377,480];
%---------------------%
R_sc = [-2000;4500;-4500];
H = 0.42;
lat = 40.5;
lst = 90.5;
%-----------------------%
gpsTime = el_az(1,2);
i = 1;
t = gpsTime;
while ((i ~= size(el_az,1)) & (t == gpsTime))
i = i + 1;
t = el_az(i,2);
end
if (t == gpsTime)
sats = i;
else
sats = i - 1;
end;
samples = size(el_az,1) / sats;
% convert all elevation and azimuth measurements into radians
degrad=4.5;
SVs = el_az(1:sats,1);
elevation = el_az(:,1) .* degrad;
azimuth = el_az(:,1) .* degrad;
% initialize polar - plotting area
close;
axis([-1.4 1.4 -1.1 1.1]);
axis('off');
axis(axis);
hold on;
% plot circular axis and labels
th = 0:pi/50:2*pi;
x = [ cos(th) .67.*cos(th) .33.*cos(th) ];
y = [ sin(th) .67.*sin(th) .33.*sin(th) ];
plot(x,y,'color','w');
text(1.1,0,'90','horizontalalignment','center');
text(0,1.1,'0','horizontalalignment','center');
text(-1.1,0,'270','horizontalalignment','center');
text(0,-1.1,'180','horizontalalignment','center');
% plot spoke axis and labels
th = (1:6)*2*pi/12;
x = [ -cos(th); cos(th) ];
y = [ -sin(th); sin(th) ];
plot(x,y,'color','w');
text(-.46,.93,'0','horizontalalignment','center');
text(-.30,.66,'30','horizontalalignment','center');
text(-.13,.36,'60','horizontalalignment','center');
text(.04,.07,'90','horizontalalignment','center');
% plot titles
if (samples == 1)
title('Satellite Position Plot');
subtitle = sprintf('GPS time : %.2f
sec',el_az(1,2));
else
title('Satellite Trajectory Plot');
subtitle = sprintf('GPS time range : %.2f sec to %.2f
sec', ...
el_az(1,2),el_az(size(el_az,1),2));
text(-1.6,1,'SVID/Last Position','color','r');
text(-1.6,.9,'Positive Elevation','color','y');
text(-1.6,.8,'Negative Elevation','color','b');
end
text(0,-1.3,subtitle,'horizontalalignment','center');
for s = 1:samples
% plot each satellite location for that sample
for sv = 1:sats
% check if positive or negative elevation
if (elevation((s - 1) * sats + sv) < 0)
elNeg = 1;
else
elNeg = 0;
end
% convert to plottable cartesian coordinates
el = elevation((s - 1) * sats + sv);
az = azimuth((s - 1) * sats + sv);
x = (pi/2-abs(el))/(pi/2).*cos(az-pi/2);
y = -1*(pi/2-abs(el))/(pi/2).*sin(az-pi/2);
% check for final sample
if (s == samples)
plot(x,y,'r*');
text(x,y+.07,int2str(SVs(sv)), ...
'horizontalalignment', ...
'center','color','r');
else
% check for +/- elevation
if (elNeg == 0)
plot(x,y,'y.');
else
plot(x,y,'b.');
end
end
end
end
return;
Output
Elev = -36.4541
Az = 90.8015