Using QA band information, filter the NDVI time series.

filter_qa(DT, ndvi = "NDVI", qa = "SummaryQA", good = c(0, 1))

Arguments

DT

data.table of NDVI time series

ndvi

ndvi column name. default is 'NDVI'.

qa

QA column. default is 'SummaryQA'.

good

values which correspond to quality pixels. default is 0 and 1.

Value

filtered data.table with appended 'filtered' column of "quality" NDVI.

Details

See the details for the example data in ?sampled-ndvi-Landsat-LC08-T1-L2.csv and ?sampled-ndvi-MODIS-MOD13Q1.csv

For MODIS MOD13Q1, the SummaryQA band

For Landsat

See also

Examples

# Load data.table
library(data.table)

# Read example data
ndvi <- fread(system.file("extdata", "sampled-ndvi-MODIS-MOD13Q1.csv", package = "irg"))

filter_qa(ndvi, ndvi = 'NDVI', qa = 'SummaryQA', good = c(0, 1))
#>      id   NDVI SummaryQA DayOfYear   yr filtered
#>   1:  0 0.1864         3        11 2015       NA
#>   2:  1 0.0541         2         3 2015       NA
#>   3:  2 0.1781         3        11 2015       NA
#>   4:  3 0.1024         2         5 2015       NA
#>   5:  4 0.0898         2         3 2015       NA
#>  ---                                            
#> 801:  2 0.1179         2       364 2019       NA
#> 802:  3 0.0789         2       364 2019       NA
#> 803:  4 0.1572         2       364 2019       NA
#> 804:  5 0.0763         2       364 2019       NA
#> 805:  6 0.1197         2       362 2019       NA