Learn R Programming

satellite (version 1.0.5)

calcTopoCorr: Correct for topographic effects.

Description

Correct for topographic effects.

Usage

# S4 method for Satellite
calcTopoCorr(x, mask = TRUE)

# S4 method for RasterStackBrick calcTopoCorr(x, hillsh, cloudmask = NULL, ...)

# S4 method for RasterLayer calcTopoCorr(x, hillsh, cloudmask = NULL, ...)

Value

If x is a Satellite object, a Satellite object with added, topographic corrected layers; if x is a raster::Raster* object, a raster::Raster* object with converted layer(s).

Arguments

x

Satellite or Raster* object.

mask

logical. If TRUE, the cloudmask from the Satellite object (if available) will be considered in the regression model.

hillsh

A RasterLayer created with hillShade.

cloudmask

A RasterLayer in which clouds are masked with NA values, passed to mask.

...

Additional arguments passed to writeRaster.

Details

The method of Civco (1989) is applied on atmospherically corrected bands (if not already available in the Satellite object, calcAtmosCorr is performed with its default settings.): First, an analytical hillshade image is created based on a DEM and sun elevation and sun zenith information from the metadata. A regression between the hillshade (independent variable) and each channel is then calculated with consideration of a cloudmask (if available). The regression coefficents are used to calibrate the hillshade raster (for each channel individually). Finally, the calibrated hillshade image is subtracted from the corresponding channel and the mean value of the channel is added.

References

CIVCO, D.L. (1989): Topographic normalization of Landsat Thematic Mapper digitalimagery. Photogrammetric Engineering & Remote Sensing, 55, 1303-1309.

Examples

Run this code
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC08*.TIF"), full.names = TRUE)
sat <- satellite(files)

## dem

files_dem <- list.files(path, pattern = "DEM", full.names = TRUE)
DEM <- raster(files_dem)

sat <- addSatDataLayer(sat, data = DEM, info = NULL, bcde = "DEM", in_bcde="DEM")

if (FALSE) {
sat <- calcTopoCorr(sat)
}

Run the code above in your browser using DataLab