LS_L1C: Correct Landsat L1C products

View source: R/LS_L1C.R

LS_L1CR Documentation

Correct Landsat L1C products

Description

The function corrects Landsat 1-8 L1C images to L2A. For the digital number (DN) to top of atmosphere (TOA) reflectance I used the metadata from the MTL.txt with the following equation:
TOA_RAD = rawDN * RADIANCE_MULT_BAND + RADIANCE_ADD_BAND /sin(SUN_ELEVATION * 180)

At this point, only the following bands will be saved:
Red, Green, Blue, NIR, SWIR1, SWIR2

Usage

LS_L1C(
  l1c_path = NULL,
  out_dir = NULL,
  proc_dir = NULL,
  sf_mask = NA,
  bad_pixel = TRUE,
  dark_pixel = TRUE,
  indices = c("MNDWI", "NDVI"),
  cores = 1L,
  maxmemory = 1e+08
)

Arguments

l1c_path

Full/relative path of L1C product. This can be both the original .tar.gz file or the unzipped file.

out_dir

Directory where output L2A products will be placed.

proc_dir

(optional) Directory where processing is applied. If NULL (default), processing is done in l1c_path-directory and output L2A product is then moved to out_dir.

sf_mask

sf object; CRS from this sf object will be used to project all raster layers. This process is computationally expensive, therefore parallel computation is applied. The raster will also be cropped and masked to the bounding box of the sf_mask object.

bad_pixel

Remove pixels with values of <0.

dark_pixel

The Dark Object Subtraction method assumes that the darkest parts of an image (water, artificial structures) should be black, if not for the effects of atmospheric scatter. The lowest value of each band will therefore be subtracted.

indices

(optional) Character string or vector of indices to calculate.
MNDWI: Modified Normalized Difference Water Index: Xu H.
NDVI: Normalized Difference Vegetation Index: GIS Geography

cores

The number of cores to use; only necessary if sf_mask is provided.

maxmemory

numeric; Maximum number of bytes to read into memory. If a process is expected to require more than this value, canProcessInMemory will return FALSE.

Value

L2A.grd file in out_dir.


STBrinkmann/DRIGLUCoSE documentation built on Oct. 14, 2022, 11:26 a.m.