Clear Filters
Clear Filters

Is there a function to determine whethere there is line of sight between two geodetic points?

3 views (last 30 days)
I'm trying to determine whether a satellite is visible from a location on earth. By providing the lat long and alt location of the satellite and the location on earth, is there Matlab function that would determine whether there is line of sight between the two points?

Answers (2)

Steven Lord
Steven Lord on 24 Jun 2016
Have you tried the los2 function in Mapping Toolbox?
  2 Comments
Keihan
Keihan on 24 Jun 2016
Steven, thank you for your response. It looks like los2 provides the information I need. However, I'm not sure if I'm using it correctly. I'm trying to determine if there is LOS between a geosynchronous satellite and an aircraft flying at 6700 meters near the north pole. Here's my code:
clear all;
close all;
%satellite location:
I5_lat = 0;
I5_long = 62.2;
I5_alt = 35786000; %m
effectiveradius = 4/3*earthRadius;
actualradius = earthRadius;
%aircraft location
UA_lat = 85;
UA_long = -5;
UA_alt = 6700;
lat=54:0.1:89.5;
long = -17.1:0.1:43.3;
latlim = [54 89.5];
lonlim = [-17.1 43.3];
%obtain elevation data:
layers = wmsfind('nasa.network*elev', 'SearchField', 'serverurl');
layers = wmsupdate(layers);
aster = layers.refine('earthaster', 'SearchField', 'layername');
cellSize = dms2degrees([0,6,0]);
[ZA, RA] = wmsread(aster, 'Latlim', latlim, 'Lonlim', lonlim, ...
'CellSize', cellSize, 'ImageFormat', 'image/bil');
%determine line of sight
vis = los2(double(ZA),double(RA),UA_lat,UA_long,I5_lat,I5_long,UA_alt,I5_alt,'MSL', ...
'MSL',earthRadius,4/3*earthRadius)
I don't expect there to be any line of sight between the aircraft and the satellite, however los2 function returns 1. Can you tell if I'm using the los2 function correctly?
thank you, Keihan if true % code end
Steven Lord
Steven Lord on 24 Jun 2016
I don't actually use Mapping Toolbox all that often. The documentation page to which I linked includes an example that visualizes the terrain, the observer, and the object to be observed and shows the line-of-sight graphically. Perhaps you can adapt that example to your data to see a picture of what's happening for your terrain data? Maybe the line-of-sight comes very close to being blocked but just barely lets the aircraft and satellite see one another.

Sign in to comment.


Keihan
Keihan on 24 Jun 2016
Steven, thank you for your response. It looks like los2 provides the information I need. However, I'm not sure if I'm using it correctly. I'm trying to determine if there is LOS between a geosynchronous satellite and an aircraft flying at 6700 meters near the north pole. Here's my code:
clear all;
close all;
%satellite location:
I5_lat = 0;
I5_long = 62.2;
I5_alt = 35786000; %m
effectiveradius = 4/3*earthRadius;
actualradius = earthRadius;
%aircraft location
UA_lat = 85;
UA_long = -5;
UA_alt = 6700;
lat=54:0.1:89.5;
long = -17.1:0.1:43.3;
latlim = [54 89.5];
lonlim = [-17.1 43.3];
%obtain elevation data:
layers = wmsfind('nasa.network*elev', 'SearchField', 'serverurl');
layers = wmsupdate(layers);
aster = layers.refine('earthaster', 'SearchField', 'layername');
cellSize = dms2degrees([0,6,0]);
[ZA, RA] = wmsread(aster, 'Latlim', latlim, 'Lonlim', lonlim, ...
'CellSize', cellSize, 'ImageFormat', 'image/bil');
%determine line of sight
vis = los2(double(ZA),double(RA),UA_lat,UA_long,I5_lat,I5_long,UA_alt,I5_alt,'MSL', ...
'MSL',earthRadius,4/3*earthRadius)
I don't expect there to be any line of sight between the aircraft and the satellite, however los2 function returns 1. Can you tell if I'm using the los2 function correctly?
thank you, Keihan

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!