processLandsatBatch: Process Landsat data in batch mode

Description Usage Arguments Value Author(s) See Also Examples

Description

Batcher to process Landsat data from tarball or hdf to a list of Vegetation Index files. Runs processLandsat sequentially or in parallel

Usage

1
processLandsatBatch(x, pattern = NULL, outdir, srdir, mc.cores = 1, ...)

Arguments

x

Character. Directory where the data is located. Data can be of the following formats: hdf, geoTiff, tar.gz or zip)

pattern

Only useful if x if of length 1. See list.files for more details

outdir

Character. Directory where the vegetation index rasterLayer should be written.

srdir

Character. Directory where the tarball should be uncompressed. Can be ommited if untar is set to FALSE

mc.cores

Numeric. For multicore implementation only. See mclapply

...

Arguments to be passed to processLandsat (untar, delete) or to sr2vi (e, mask, keep, vi)

Value

Function is used for its side effect of calculating in batch mode Vegetation indices from surface reflectance Landsat data.

Author(s)

Loic Dutrieux

See Also

processLandsat and sr2vi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Get the directory where the Landsat archives are stored
dir <- system.file('external', package='bfastSpatial')

# Set the location of output and intermediary directories (everything in tmpdir in that case)
srdir <- dirout <- file.path(rasterOptions()$tmpdir, 'bfmspatial')
dir.create(dirout, showWarning=FALSE)
processLandsatBatch(x=dir, pattern=glob2rx('*.zip'), outdir=dirout, srdir=srdir, delete=TRUE, vi='ndvi', mask='fmask', keep=0, overwrite=TRUE)

# Visualize one of the layers produced
list <- list.files(dirout, pattern=glob2rx('*.grd'), full.names=TRUE)
plot(r <- raster(list[1]))

loicdtx/bfastSpatial documentation built on May 21, 2019, 7:37 a.m.