Description Usage Arguments Value Author(s) References Examples
Convert a Raster* object representing QFLAG bit values to a Raster* with two categories representing flagged and non-flagged pixels
1 | convert_qf_copernicus(r,qf,cl = NULL, filename=rasterTmpFile(),...)
|
r |
A |
qf |
Quality Flag to be extracted. Can be more than one of these: 'sea','snow','suspect','aero_status_mixed','aero_source_climato','input_invalid','lai_invalid','fapar_invalid','fcover_invalid','b2_saturation','b3_saturation','filtered','gap_filled','ndvi_invalid' |
cl |
cluster object for parallel processing. Default is |
filename |
Character vector giving the name of the output raster to save.
Default is created through |
... |
arguments passed to |
A Raster-class
object with two values (1,0), representing respectively pixels that are flagged by at least one of the give qf
,
and pixels that are not flagged in any of the given qf
Antoine Stevens
Baret et al. 2010. BioPar Product User Manual. Geoland2: Towards an Operational GMES Land Monitoring Core Service, p. 27
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
# Don't forget to provide in copernicus_options() your user and password details
# for COPERNICUS data portal before running this
# First, get data: NDVI_1kmV1, for JAN 2009
fn <- get_copernicus(product = 'NDVI_1kmV1', begin = '2009-01-01', end = '2009-31-01',
tileH = 19, tileV = 4)
fn # downloaded file names
# extract layers 3 (QFLAG) of the downladed file. Store images in the 'H19V4' folder
f <- extract_copernicus(fnames = fn,job = 'H19V4',layers = 3)
# f is the h5 file name(s)
# for each layer, the function append its name to the saved file name
# so we can change the name of the file(s) accordingly
f <- sub('\\.h5','_NDVI-QFLAG.tif',f)
# Create a rasterStack with QF bit values
library(raster)
QF <- stack(f)
# Find pixels flagged as being covered by snow
snow <- convert_qf_copernicus(QF,'snow')
plot(snow)
# Find pixels flagged as 'sea'
sea <- convert_qf_copernicus(QF,'sea')
plot(sea)
# flags can be combined
# Find pixels flagged as being suspect and with aerosol status mixed
bad <- convert_qf_copernicus(QF,c('suspect','aero_status_mixed'))
plot(bad)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.