Description Usage Arguments Value Author(s) See Also Examples
Uses MODIS quality layer to perform cleaning over a single data layer. Quality band can be encoded bitewise or in numerics. This function needs rgdal to be configured with HDF4 driver in order to work.
1 | cleanMODIS(x, data_SDS, QC_SDS, bit = FALSE, QC_val, fill = NULL, ...)
|
x |
Character. Filename (full path) of a hdf dataset containing data and QC layers |
data_SDS |
Numeric. Index of the SDS containing the data in the hdf infrastructure |
QC_SDS |
Numeric. Index of the SDS containing the Quality control in the hdf infrastructure |
bit |
Logical. Is QC information provided bitwise? |
QC_val |
Numeric or vector of numerics. Quality control values to keep in the data. If |
fill |
(vector of) Numeric or NULL. Fill values in the data layer to be filtered out. (important to do before reprojection with resampling method other than Nearest Neighbours) |
... |
Arguments to be passed to |
A rasterLayer
Loic Dutrieux
processMODISbatch
for batcher
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
library(raster)
dir <- file.path(tmpDir(), 'MODIStest'); dir.create(path = dir)
fileDL <- 'http://e4ftl01.cr.usgs.gov/MOLT/MOD17A2.055/2003.07.12/MOD17A2.A2003193.h19v07.055.2011269202445.hdf'
modis <- file.path(dir, basename(fileDL)); download.file(url = fileDL, destfile = modis)
# Now We've just downloaded a MODIS file that is stored in a subdirectory of the raster tmp directory
sprintf('These data have been acquired around %s', getMODISinfo(modis)$date)
# Clean dataset and replace fill values by NAs
# Product details at https://lpdaac.usgs.gov/products/modis_products_table/mod17a2
MODISclean <- cleanMODIS(x=modis, data_SDS=1, QC_SDS=3, bit=TRUE, QC_val=0x19, fill = (32761:32767))
plot(MODISclean)
# In that case we did not write the result back to disk, but note that this is possible
# For that use the filename= argument, and the datatype= argument (recommended)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.