cuttails_rast: remove outliers from a raster image

Description Usage Arguments Details Value See Also Examples

View source: R/cuttails_rast.R

Description

the function allows to automatically set to NoData eventual outliers present in a raster single- or multi-band object (or file). For each band, quantiles of the distribution of pixel values are computed using raster::quantile, and the values falling outside the limits set with the tails argument are set to NoData in the output

Usage

1
2
cuttails_rast(in_rast, tails = c(0.02, 0.98), to_file = FALSE,
  verbose = TRUE)

Arguments

in_rast

*raster object (single layer or stack), or filename of a raster file

tails

numeric array (2) quantiles of the distribution of pixel values used for the cut. For example, setting tails = c(0.05, 0.95) will set to NoData all pixels below the 5th and above the 95th percentile, Default: c(0.02, 0.98)

to_file

DESCRIPTION

verbose

DESCRIPTION

Details

DETAILS

Value

OUTPUT_DESCRIPTION

See Also

quantile,getValues,setValues,brick

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
 # on single band
 in_rast <- raster::raster(ncol=100, nrow=100)
 in_rast <- raster::setValues(r, 1:10000)
 in_rast_cut <- cuttails_rast(in_rast)
 in_rast_cut

 # on multi band
 in_brick <- raster::stack(in_rast,in_rast,in_rast)
 in_brick
 in_brick_cut <- cuttails_rast(in_brick)
 in_brick_cut
 
## End(Not run)

IREA-CNR-MI/sprawl documentation built on May 27, 2019, 1:12 p.m.