1
0
Fork 0
mirror of https://github.com/noerw/sentinel_fire synced 2025-07-13 03:00:22 +02:00
sentinel2_pipeline/changeDetection/deleteWater.R
rkans02 e3f6845d1e added water Detection
added water detection and water will be deleted in dNBR and BAIS2 scripts
also changed bands to correct ones -> needs testing
2019-01-23 17:50:55 +01:00

27 lines
572 B
R

#rm(list=ls())
# ------------------------ Libraries ------------------------
library(raster)
# ------------------------ Function definition ------------------------
deleteWater <- function(Image,water){
# ------------------------ Loading Bands ------------------------
##
burnedArea <- Image
water <- water
# Bands
water <- reclassify(water, c( -Inf , 0, 0,
0 , Inf , 1 ))
output <- burnedArea
output[water == 1] <- NA
# ------------------------ Output ------------------------ #
return(output)
}