calculate_TerraBella_indices: Calculate TerraBella spectral indices

Description Usage Arguments Value Note Examples

View source: R/calculate_TerraBella_indices.r

Description

When given a TerraBella .tif file, calculate chosen spectral indices

Usage

1
2
calculate_TerraBella_indices(inp_tif_fnames, index_names, outp_dir,
  overwrite = T)

Arguments

inp_tif_fnames

Filenames of an TerraBella tif files

index_names

Character vector of spectral indices (see CanHeMonR::spectral_indices) you want to have calculated. Remember TerraBella is 4 broad bands only

outp_dir

Directory to write output to

overwrite

Should existing output be overwritten? Default is T.

Value

a raster brick with the chosen indices and a file for each index, written away to the output directory

Note

TO DO: adapt to work in parallel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#calculate NDVI for all the TerraBella scenes of Granadilla
raster::rasterOptions(progress='text')
raster::rasterOptions(tmpdir = 'E:/beckpie/temp/Raster_temp/')
inpdir <- 'X:/Imagery/Granadilla/Skybox/dark_object_corrected'
fnames <- list.files(inpdir)
fnames <- fnames[grep('.tif',fnames)]
fnames <- fnames[substr(fnames,nchar(fnames)-3,nchar(fnames))==".tif"]
fnames <- file.path(inpdir, fnames)

calculate_TerraBella_indices(inp_tif_fnames = fnames, index_names='NDVI',
                           outp_dir ="X:/Imagery/Granadilla/Skybox/dark_object_corrected/spectral_indices")

## End(Not run)

pieterbeck/CanHeMonR documentation built on May 25, 2019, 7:11 a.m.