Collect all pixel values of both vegetation index,
and Swir Transformed Reflectance, for a time series of images.
Prepare data.frame of all pairs of values
(as input for the optram_wetdry_coefficients
function)
Usage
optram_ndvi_str(STR_list, VI_list, output_dir = tempdir(), aoi = NULL)
Arguments
- STR_list,
list of paths to STR raster files
- VI_list,
list of paths to NDVI raster files
- output_dir,
string, path to save data.frames (in RDS format)
- aoi,
sf POLYGON or MULTIPOLYGON, must have a numeric column named "ID" for coloring trapezoid points by features Default NULL, (no coloring)
Note
Use the option max_tbl_size
(see optram_options
)
to limit size of the NDVI-STR data.frame.
With a large area of interest, and long time frame,
the number of data points can overrun the computation resources.
This parameter sets a total size of data.frame from the max_tbl_size
parameter, together with the number of image time slots in the time range.
In some cases (i.e. water surfaces) NDVI can have values
below zero. These pixels can be removed from the trapezoid
by setting rm.low.vi
option to TRUE.
The vegetation index column is named "NDVI" even though it can represent other vegetation indices, such as SAVI, or MSAVI.
Examples
VI_list <- list.files(system.file("extdata", "NDVI"),
pattern = ".tif$", full.names = TRUE)
STR_list <- list.files(system.file("extdata", "STR"),
pattern = ".tif$", full.names = TRUE)
full_df <- optram_ndvi_str(STR_list, VI_list)
#> No raster files in directories
# Show structure of output data.frame
str(full_df)
#> NULL