calcSR: Calculates surface reflectance for Landsat 7

View source: R/water_RSfunctions.R

calcSRR Documentation

Calculates surface reflectance for Landsat 7

Description

Calculates surface reflectance from top-of-atmosphere reflectance using the model developed by Tasumi et al. (2008) and Allen et al. (2007), applied band by band. Only for Landsat 7: for Landsat 8 and 9 use the Collection 2 Level-2 surface reflectance (see loadImageSR).

Usage

calcSR(
  image.TOAr,
  sat = "auto",
  incidence.hor,
  WeatherStation,
  surface.model,
  MTL,
  Kt = 1,
  aoi
)

Arguments

image.TOAr

SpatRaster with top-of-atmosphere reflectance in layers B, G, R, NIR, SWIR1 and SWIR2, e.g. from calcTOAr(). Layers are selected by name; a stack without the standard names is used by position, with a warning, and a stack with these names that lacks a needed layer is an error.

sat

Only "L7" is supported; "L8" and "L9" stop with an error. "auto" detects the satellite from the MTL file (MTL is then required)

incidence.hor

solar incidence angle (radians) on a horizontal surface, from solarAngles()

WeatherStation

waterWeatherStation object (see read.WSdata) or the data.frame returned by getDataWS()

surface.model

SpatRaster with layers DEM, Slope and Aspect, from METRICtopo()

MTL

path to the Landsat metadata (*_MTL.txt) file. Needed for sat = "auto"

Kt

clearness (turbidity) coefficient of the atmosphere, 0 < Kt <= 1: 1 (default) for clean air, 0.5 for extremely turbid, dusty or polluted air (Allen et al., 2007). See SWtransmissivity

aoi

Not used (a warning is given when it is passed); kept for backward compatibility

Value

SpatRaster with surface reflectance (unitless) in layers B, G, R, NIR, SWIR1 and SWIR2.

Author(s)

Guillermo Federico Olmedo

David Fonseca-Luengo

References

Tasumi, M., Allen, R. G., & Trezza, R. (2008). At-surface reflectance and albedo from satellite for operational calculation of land surface energy balance. Journal of Hydrologic Engineering, 13(2), 51-63. https://doi.org/10.1061/(ASCE)1084-0699(2008)13:2(51)

R. G. Allen, M. Tasumi, and R. Trezza, "Satellite-based energy balance for mapping evapotranspiration with internalized calibration (METRIC) - Model" Journal of Irrigation and Drainage Engineering, vol. 133, p. 380, 2007

See Also

Other remote sensing support functions: calcRadiance(), calcTOAr(), cfmask(), loadImage(), loadImageSR()

Examples

# a small window of the Landsat 7 example scene, to run quickly
MTL <- system.file("extdata", "L7.MTL.txt", package = "water")
WeatherStation <- read.WSdata(WSdata = system.file("extdata", "apples.csv", package = "water"),
  date.format = "%d/%m/%Y", lat = -35.42222, long = -71.38639, elev = 201, height = 2.2,
  cf = c(1, 0.2777778, 1), tz = "America/Santiago", MTL = MTL)
image.DN <- terra::rast(L7_Talca)[1:60, 1:80, drop = FALSE]
DEM <- terra::rast(DEM_Talca)[1:60, 1:80, drop = FALSE]
surface.model <- METRICtopo(DEM)
solar.angles <- solarAngles(surface.model = surface.model,
                            WeatherStation = WeatherStation, MTL = MTL)
image.TOAr <- calcTOAr(image.DN, sat = "L7", MTL = MTL,
                       incidence.rel = solar.angles$incidence.rel)
image.SR <- suppressWarnings(calcSR(image.TOAr, sat = "L7", surface.model = surface.model,
                   incidence.hor = solar.angles$incidence.hor, WeatherStation = WeatherStation))
plot(image.SR)

water documentation built on Nov. 25, 2026, 5:08 p.m.