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).

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

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

Examples

# Default weights
scl_weights()
#>                  no_data   saturated_or_defective         dark_area_pixels 
#>                     0.00                     0.00                     0.33 
#>            cloud_shadows               vegetation            not_vegetated 
#>                     0.17                     1.00                     1.00 
#>                    water             unclassified cloud_medium_probability 
#>                     1.00                     0.33                     0.00 
#>   cloud_high_probability              thin_cirrus                     snow 
#>                     0.00                     0.33                     1.00 

# Custom weights changing two classes
scl_weights(unclassified = 0.25, snow = 0)
#>                  no_data   saturated_or_defective         dark_area_pixels 
#>                     0.00                     0.00                     0.33 
#>            cloud_shadows               vegetation            not_vegetated 
#>                     0.17                     1.00                     1.00 
#>                    water             unclassified cloud_medium_probability 
#>                     1.00                     0.25                     0.00 
#>   cloud_high_probability              thin_cirrus                     snow 
#>                     0.00                     0.33                     0.00