SKYVIEW

Sky visibility from elevation data


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: References

Back to top

Description


Calculates the percentage of the sky that is visible at each pixel in a DEM. Sky view values range between 1 and 100 percent, where 100 percent represents a completely unobstructed view to the horizon, in all directions. The output sky view raster is often used when running ATCOR to perform an atmospheric correction on satellite imagery captured over rugged terrain.
Back to top

Parameters


skyview(filedem, dbec, filo, dboc, elevunit, elfactor, backelev)

Name Type Caption Length Value range
FILEDEM * str Input file name 1 -    
DBEC List[int] Input elevation channel 0 - 1 Default: 1
FILO * str Output file name 1 -    
DBOC List[int] Output sky view channel 0 - 2  
ELEVUNIT str Units for elevation values 0 - 7 METER | FEET | US_FEET
ELFACTOR List[float] Elevation offset and scale 0 - 2  
BACKELEV List[float] Background elevation value 0 - 1  

* Required parameter
Back to top

Parameter descriptions

FILEDEM

Specifies the name of the input file that contains the elevation data used to compute the sky view raster.

DBEC

Specifies the input channel that contains the elevation data.

FILO

Specifies the name of the output file to receive the computed sky view raster.

If the specified output file does not exist, a new file will be created.

If the specified output file already exists, it must be in a format that is updatable, and must already contain a suitable channel to receive the sky view data.

FILO can equal FILEDEM, as long as FILEDEM meets the above criteria.

DBOC

Specifies the output channel to receive the sky view data.

If the output file is a new file, this parameter should be left unspecified (defaulted); the program will create a new channel to hold the sky view data.

If the specified output file already exists, this parameter must specify an existing channel.

The channel receiving the sky view data can be 8-, 16-, or 32-bit.

SKYVIEW creates a new metadata tag at the channel level to identify the channel that received the sky view data. The generated metadata tag is named TERRAIN_LAYER_NAME with the value SKYVIEW.

If the input file (FILEDEM) is the same as the output file (FILO), SKYVIEW checks whether the elevation channel has a TERRAIN_LAYER_NAME metadata tag associated with it. If the tag is not found, SKYVIEW creates a TERRAIN_LAYER_NAME tag for the elevation channel with the value ELEVATION.

ELEVUNIT

Specifies the units used to describe the elevation values of the input file (FILI).

Supported units are:

This parameter is used to ensure that the vertical (elevation) unit matches the horizontal (projection) unit, which is required for the correct computation of the sky view. If a discrepancy exists, an on-the-fly conversion is applied so that the vertical and horizontal units match.

If this parameter is not specified, the program checks for an ELEVATION_UNITS metadata tag at the file level, and again at the channel level.

If this value is not specified or is not found in the metadata, ELEVUNIT defaults to METER.

ELFACTOR

Specifies the values used to shift and scale the DEM pixel values to values in the units indicated by the Elevation Units (ELEVUNIT) parameter.

Two values are specified using this parameter: the first number defines the offset, while the second optionally specifies the scale.

The conversion formula is:

elevation_value = scale * (DEM_pixel_value + offset)

If a single value is specified, that value is used to specify the offset; the scale value defaults to 1.0.

If this parameter is not specified, SKYVIEW checks for an ELEVATION_SCALE and ELEVATION_OFFSET metadata tags at the file level, and again at the channel level.

If this value is not specified or found in the metadata, the offset defaults to 0.0 and the scale defaults to 1.0, indicating that there is no offset and that the scale is 1:1.

BACKELEV

Specifies a special value, in the input elevation channel, used to indicate which pixel value is to be handled as no data (no elevation)

If this parameter is not specified, SKYVIEW checks for a NO_DATA_VALUE metadata tag at the file level, and again at the channel level.

If this value is not specified or found in the metadata, all pixels of the DEM are assumed to be valid.

Typically, the output No Data value written to the sky view raster is the same as the input No Data value. Also, if the output No Data value is outside the bit depth range of the specified output channel (DBOC), the output No Data value will be snapped to the minimum value for the given bit depth. For example, if the background elevation value (BACKELEV) is -150 and the output channel is 8-bit, the output No Data value will be snapped to 0.

Back to top

Details

SKYVIEW uses elevation values to calculate the percentage of unobstructed sky for each pixel in the input DEM. The values provided in the sky view raster range from 1 - 100 percent. A value of 100% indicates that, from the given pixel, the horizon can be seen in all directions. If a terrain feature, such as a mountain, prevents the horizon from being seen for a given looking direction, the sky view percentage will be less than 100.

The sky view raster is used by the ATCOR algorithm when computing the amount of irradiant and reflected terrain radiation received at a given pixel.

SKYVIEW uses the Horizon Line ray tracing program, which inspects 360 degrees around a pixel and computes the fraction of hemispherical sky not obstructed by neighboring terrain features.

FILO can specify a new or existing PCIDSK file. If FILO specifies a new file, SKYVIEW creates a new 8-bit channel to hold the sky view data. If FILO specifies a new PCIDSK file, DBOC should be unspecified (defaulted).

If FILO specifies an existing file, DBOC must specify an existing channel. The program will then overwrite the output channel with the computed sky view values. The channel receiving the sky view data can be 8-, 16-, or 32-bit.

Accurate computation of the sky view values depends on the proper specification of the elevation unit (ELEVUNIT), as well as the elevation scale and offset (ELFACTOR). Specifying the elevation unit (ELEVUNIT) allows SKYVIEW to perform a preprocessing check to ensure that the projection unit and elevation unit match and, if necessary, apply an appropriate conversion. If the input DEM has been scaled (that is, to fit an 8-bit channel) the elevation scale and offset (ELFACTOR) parameters should be specified to define how to properly un-scale the elevation values prior to computing the sky view.

When a DEM with a lat/long projection is provided, SKYVIEW converts the resolution of a pixel from degrees to the elevation unit (ELEVUNIT). This conversion is used solely for the correct computation of sky view values and does not affect the georeferencing of the output file.

The background elevation value (BACKELEV) specifies which pixel value from the input elevation channel should be interpreted as background (no data). An output No Data value will be provided in the sky view raster for pixels that correspond to background (no data) pixels from the input DEM. The output No Data value for the sky view raster is 255. A NO_DATA_VALUE metadata record will be created for the output sky view channel to identify this value as "no data".

Back to top

Example

This example calculates the sky view of 16-bit signed elevation data from channel 10 of the file irvine.pix and places the output in channel 7. Each pixel in the image represents a projected ground area of 30 m x 30 m, and each increment in the gray level of the elevation image corresponds to the default elevation change of 1 m.

from pci.skyview import skyview

filedem	=	'irvine.pix'	# input file
dbec	=	[10]	# input DEM channel
filo	=	'irvine.pix'	# output file
dboc	=	[7]	# output sky view channel
elevunit	=	'METER'	# default elevation units
elfactor	=	[0.0,1.0]	# default offset, scale
backelev	=	[]

skyview( filedem, dbec, filo, dboc, elevunit, elfactor, backelev )
Back to top

References

J. Dozier, J. Bruno, 1981. A fast solution to the horizon problem. Computers & Geosciences, Vol. 7, pp. 145-151.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.