scl_weights: Build SCL weights

View source: R/scl_weights.R

scl_weightsR Documentation

Build SCL weights

Description

Build a vector with relative weights for each SCL class. Class weights can be defined using function arguments (all of them are optional; default weights are used for each non-provided class).

Usage

scl_weights(
  no_data = 0,
  saturated_or_defective = 0,
  dark_area_pixels = 0.33,
  cloud_shadows = 0.17,
  vegetation = 1,
  not_vegetated = 1,
  water = 1,
  unclassified = 0.33,
  cloud_medium_probability = 0,
  cloud_high_probability = 0,
  thin_cirrus = 0.33,
  snow = 1
)

Arguments

no_data

(optional) Relative weight (0-1) for SCL class "no_data".

saturated_or_defective

(optional) Relative weight (0-1) for SCL class "saturated_or_defective".

dark_area_pixels

(optional) Relative weight (0-1) for SCL class "dark_area_pixels".

cloud_shadows

(optional) Relative weight (0-1) for SCL class "cloud_shadows".

vegetation

(optional) Relative weight (0-1) for SCL class "vegetation".

not_vegetated

(optional) Relative weight (0-1) for SCL class "not_vegetated".

water

(optional) Relative weight (0-1) for SCL class "water".

unclassified

(optional) Relative weight (0-1) for SCL class "unclassified".

cloud_medium_probability

(optional) Relative weight (0-1) for SCL class "cloud_medium_probability".

cloud_high_probability

(optional) Relative weight (0-1) for SCL class "cloud_high_probability".

thin_cirrus

(optional) Relative weight (0-1) for SCL class "thin_cirrus".

snow

(optional) Relative weight (0-1) for SCL class "snow".

Value

A named vector of length 12, containing 0-1 relative weights for each SCL class.

Author(s)

Luigi Ranghetti, PhD (2020) luigi@ranghetti.info

Examples

# Default weights
scl_weights()

# Custom weights changing two classes
scl_weights(unclassified = 0.25, snow = 0)

ranghetti/sen2rts documentation built on March 31, 2024, 1:18 a.m.