View source: R/water_RSfunctions.R
| cfmask | R Documentation |
Masks clouds, cloud shadows and fill pixels of an image using its quality band. Use it after loading the image (e.g. with loadImageSR()) and before METRIC.EB(), so that cloudy pixels are not used as anchor pixels. All layers of the image are masked, including the surface temperature (Band_10).
cfmask(path = getwd(), image, cfmask, keep, buffer = 60)
path |
folder where the quality band is searched when cfmask is
missing: a Collection 2 |
image |
SpatRaster to mask, e.g. from loadImageSR() or loadImage() |
cfmask |
SpatRaster with the quality band. If missing, it is read from path |
keep |
For older quality bands only: values to keep (all other pixels are masked). Use 0 for cfmask files, 2720 for Landsat 8 Collection 1 BQA files and 672 for Landsat 7 Collection 1 BQA files. If missing, a Collection 2 QA_PIXEL band is decoded by bits: pixels flagged as fill, dilated cloud, cirrus, cloud or cloud shadow (bits 0 to 4) are masked. |
buffer |
distance (in map units, usually meters) around clouds and cloud shadows that is also masked. Use 0 for no buffer |
The image (SpatRaster) with the masked pixels set to NA.
Guillermo Federico Olmedo
Other remote sensing support functions:
calcRadiance(),
calcSR(),
calcTOAr(),
loadImage(),
loadImageSR()
scene <- system.file("extdata", "L8_C2", package = "water")
image.SR <- loadImageSR(scene)
image.SR <- cfmask(path = scene, image = image.SR)
plot(image.SR[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.