0% found this document useful (0 votes)
40 views5 pages

Azimuth and elevation-SAT COMM

This document discusses calculating azimuth and elevation angles for satellite positions based on variables like latitude, longitude, altitude and GPS time. It presents a Matlab code to plot calculated satellite positions or trajectories in an elevation-azimuth plot based on input data. The code takes satellite data with IDs, GPS times and elevation-azimuth angles and plots the positions or trajectories on a polar graph with labels for different time samples.

Uploaded by

nayyab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

Azimuth and elevation-SAT COMM

This document discusses calculating azimuth and elevation angles for satellite positions based on variables like latitude, longitude, altitude and GPS time. It presents a Matlab code to plot calculated satellite positions or trajectories in an elevation-azimuth plot based on input data. The code takes satellite data with IDs, GPS times and elevation-azimuth angles and plots the positions or trajectories on a polar graph with labels for different time samples.

Uploaded by

nayyab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SATELLITE NETWORK DESIGN

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;

Re = 6378.137; % Equatorial Earh's radius [km]


Rp = 6356.7523; % Polar Earh's radius [km]
f = (Re - Rp)/Re; % Oblateness or flattening
C1 = (Re/(1 - (2*f - f^2)*sind(lat)^2)^0.5 + H)*cosd(lat);
C2 = (Re*(1 - f)^2/(1 - (2*f - f^2)*sind(lat)^2)^0.5 +
H)*sind(lat);
% Position vector of the observer,GEF
R_ob = [C1*cosd(lst); C1*sind(lst);C2];
% Position vector of the spacecraft relative to the observer
R_rel = R_sc - R_ob;
GE_TH = [-sind(lst) cosd(lst) 0;
-sind(lat)*cosd(lst) -sind(lat)*sind(lst) cosd(lat);
cosd(lat)*cosd(lst) cosd(lat)*sind(lst) sind(lat)
];
R_rel_TH = GE_TH*R_rel;
rv = R_rel_TH/norm(R_rel_TH);
Elev = asin(rv(3))*180/pi % Elevation angle
Az =atan2(rv(1),rv(2))*180/pi % Azimuth angle

%-----------------------%
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

You might also like