is program computes a map of visibility from a selected point on a topography. It has been written to help the search for radio relay best location. Because it considers only direct line of sight, it gives a good estimation for possible radio link for short distances only (less than 10 km), neglecting curvature of the Earth, Fresnel zone and atmospheric refraction on radio waves propagation. The program computes the relative elevation angle of the mask for each point (the angle is null or negative if the point is visible).
The function needs a digital elevation model Z and associated (X,Y) vectors or matrices of coordinates (same unit as Z), position of the point (X0,Y0), the antenna height H0 (for instance 4 m), and the hypothetic antenna height Ha on each topography points (for instance 3 m). When no output argument is given, the function plots a map of the results (color map of mask angles, and blank for visible points, see example screenshot).
The script is not fully optimized because it makes a global loop on the matrix elements to compute each profile of topography... (I didn't find (yet) a way to fully vectorize the problem), so it takes some time to compute, depending on the number of element of Z. However, I found a faster algorithm (about 2 times faster), giving approximate result but usefull to process a first map.
The function has interest with real topography ; try this example with the gradient modulus of PEAKS function (the point (x0,y0) is set on the secondary hill):
surf(x,y,z), shading flat, light, view(-24,74)
See help for syntax, and script comments for details.
Adds some checks on input arguments, new default algorithm 3 times faster than before. 'fast' method is still 2 times faster than the default.
Adds an example with peaks Matlab's function (thanks David Wilson for suggestion). Adds an option 'fast' for a faster process (but approximative).
I added a simple example using gradient of peaks function (in the help text). By default, the function computes the real coverage map using interpolation; a faster approximate algorithm is available with 'fast' option.