Extent is reset to extent of DEM after the loop
r.los manual recommends that the maximum visibibility distance does not exceed 1000 rows and columns (500 cells in any one direction from the observer). Added a constrain that MAX_VIS_DIST does not exceed this given the raster resolution (new param R_RES).