loadImageSR: Load Landsat 8/9 surface reflectance (and surface...

View source: R/water_RSfunctions.R

loadImageSRR Documentation

Load Landsat 8/9 surface reflectance (and surface temperature) from a folder

Description

Loads Landsat 8 or 9 Collection 2 Level-2 surface reflectance bands 2 to 7 (*_SR_B2.TIF to *_SR_B7.TIF) from a folder, scaled as DN * 0.0000275 - 0.2. Pixels where any band is fill (0) or outside the valid range of the product (7273 to 43636 DN, reflectance 0 to 1) are set to NA in all layers, with a message giving the number of out-of-range pixels: slightly negative blue reflectance over dense crops is masked too. All six bands are required. If *_ST_B10.TIF is present it is added as the last layer, "Band_10", in Kelvin (DN * 0.00341802 + 149, fill value 0 set to NA). It can be passed as surf.temp to METRIC.EB(), METRIC.Rn() or METRIC.G(). Landsat 7 Level-2 products are not supported (different band numbers).

Usage

loadImageSR(path = getwd(), aoi)

Arguments

path

folder where band files are stored

aoi

Optional area of interest (e.g. from createAoi()) to crop the image. If missing, the image is not cropped

Value

SpatRaster with surface reflectance (unitless) in layers B, G, R, NIR, SWIR1 and SWIR2 (Landsat 8/9 bands 2 to 7). If *_ST_B10.TIF is present, a seventh layer Band_10 with surface temperature (K) is added.

Author(s)

Guillermo Federico Olmedo

See Also

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

Examples

scene_folder <- system.file("extdata", "L8_C2", package = "water")
image.SR <- loadImageSR(path = scene_folder)
names(image.SR)
plot(image.SR[["NIR"]])

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