This function uses a list as input so that the object can have vastly different resolutions.

clamp_raster_sigmas(
  raster_list,
  n_sigma = 3,
  band_id = 1,
  lower = TRUE,
  upper = TRUE,
  lower_clamp = -Inf,
  upper_clamp = Inf,
  use_values = FALSE
)

Arguments

raster_list

a list of stars objects

n_sigma

numeric, number of standard deviations to consider to calculate the percentile corresponding to values to filter, default to 3

band_id

numeric, identifier of the band of the stars object

lower

logical, if TRUE a lower clamp value is computed using the specified number of standard deviations

upper

logical, if TRUE an upper clamp value is computed using the specified number of standard deviations

lower_clamp

numeric, a value for the lower clamp, default to -Inf

upper_clamp

numeric, a value for the upper clamp, default to Inf

use_values

logical. If FALSE values outside the clamping range become NA, if TRUE, they get the extreme values, default to TRUE

Value

a named list of with the clamped stars objects and the clamped values of all the rasters (from ploting purposes)