Function used to add a user-defined Spectral Index to the default list of computable spectral indexes. Execution without the GUI (i.e., to add a new index from a script) is also possible (see examples).
Usage
MODIStsp_addindex(
new_indexbandname = "",
new_indexfullname = "",
new_indexformula = "",
new_indexnodata_out = "32767"
)Arguments
- new_indexbandname
charactershort name (acronym) of the new spectral index (Ignored if gui == TRUE), Default: NULL- new_indexfullname
characterextended name (acronym) of the new spectral index (Ignored if gui == TRUE), Default: NULL- new_indexformula
characterstring containing the formula of the new spectral indexes (Ignored if gui == TRUE). Variables allowed in the formula are the names of the bands: b1_Red, b2_NIR, b3_Blue, b4_Green, b5_SWIR, b6_SWIR and b7_SWIR. Default: NULL- new_indexnodata_out
characternodata value to use for rasters containing the new index
Value
The function is called for its side effects. On success, the MODIStsp_indexes.json is modified so to allow computation of the additional indexes.
Details
The function asks the user to provide the info related to the new desired Spectral Index, checks for correctness of provided information (e.g., correct bandnames, computable formula, etc...). If the index is legit, it modifies the MODIStsp_addindex.json file so to allow computation of the additional index within MODIStsp for all products containing the required reflectance bands.
To remove all custom-added spectral indexes, run MODIStsp_resetindexes()
