create a mask based on NDVI, Green reflectance and NIR reflectance NDVI (min) threshold eliminates non vegetated pixels Blue (max) threshold eliminates Clouds NIR (min) threshold eliminates shadows ! only valid if Optical data!!

create_mask_from_threshold(
  ImPath,
  MaskPath,
  MaskPath_Update,
  NDVI_Thresh,
  Blue_Thresh,
  NIR_Thresh,
  Blue = 480,
  Red = 690,
  NIR = 835
)

Arguments

ImPath

character. Full path of a raster file

MaskPath

character. Full path of the mask to be used with the raster file

MaskPath_Update

character. Full path of the updated mask to be used with the raster file

NDVI_Thresh

numeric. NDVI threshold applied to produce a mask (select pixels with NDVI>NDVI_Thresh)

Blue_Thresh

numeric. Blue threshold applied to produce a mask (select pixels with Blue refl < Blue_Thresh –> filter clouds) refl expected between 0 and 10000

NIR_Thresh

numeric. NIR threshold applied to produce a mask (select pixels with NIR refl < NIR_Thresh) refl expected between 0 and 10000

Blue

numeric. spectral band corresponding to the blue channel (in nanometers)

Red

numeric. spectral band corresponding to the red channel (in nanometers)

NIR

numeric. spectral band corresponding to the NIR channel (in nanometers)

Value

MaskPath path for the updated shademask produced