MODIStsp_resetindexes: Remove custom spectral indexes

Description Usage Value Note Author(s) See Also Examples

View source: R/MODIStsp_resetindexes.R

Description

Function used to remove all user-defined Spectral Indexes from MODIStsp, thus resetting the list of available indexes to the default ones.

Usage

1

Value

The function is called for its side effects. On success, the MODIStsp_indexes.json file is modified so to remove all previously custom-specified Spectral Indexes.

Note

License: GPL 3.0

Author(s)

Lorenzo Busetto, phD (2014-2017) busetto.l@irea.cnr.it

See Also

MODIStsp_addindex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
# Remove all custom-defined spectral indexes from an options file

# Add a custom index for testing purposes
library(jsonlite)
opts_jsfile = system.file("testdata/test_addindex.json",
                             package = "MODIStsp")
 MODIStsp_addindex(
   opts_jsfile = opts_jsfile,
   gui = FALSE,
   new_indexbandname = paste0("Index_", as.character(sample(10000, 1))),
   new_indexformula = "b1_Red - b2_NIR",
   new_indexfullname = paste0("Index_", as.character(sample(10000, 1)))
   )

 opts <- jsonlite::fromJSON(indexes_file)
 opts$custom_indexes[1]

 # Now remove all custom indexes
 MODIStsp_resetindexes()
 opts <- jsonlite::fromJSON(opts_jsfile)
 opts$custom_indexes[1]
 
## End(Not run)

MODIStsp documentation built on Jan. 13, 2021, 11:18 a.m.