Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jbferet committed Apr 8, 2020
2 parents 8b6bb25 + 6d5ea09 commit 637a5b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/Lib_FilterData.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,8 @@ create_mask_from_threshold <- function(ImPath, MaskPath, MaskPath.Update, NDVI_T
Mask[SelPixels] <- 1
# update initial shade mask
MaskPath <- update_shademask(MaskPath, Header, Mask, MaskPath.Update)
list2Remove <- ls()
rm(list=list2Remove[-which(list2Remove=='MaskPath')])
gc()
return(MaskPath)
}
8 changes: 7 additions & 1 deletion R/Lib_ImageProcess.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,20 @@ ENVI_type2bytes <- function(HDR) {
# @return bands corresponding to atmospheric water absorption domain
exclude_spectral_domains <- function(ImPath, Excluded_WL = FALSE) {
# definition of water vapor absorption
if (length(Excluded_WL) == 1) {
if (is.null(Excluded_WL)){
Excluded_WL <- c(0, 0)
} else if (length(Excluded_WL) == 1) {
if (Excluded_WL == FALSE) {
Excluded_WL <- c(0, 400)
Excluded_WL <- rbind(Excluded_WL, c(895, 1005))
Excluded_WL <- rbind(Excluded_WL, c(1180, 1480))
Excluded_WL <- rbind(Excluded_WL, c(1780, 2040))
}
}
# in case a unique specrtal domain is provided as excluded domain
if (length(Excluded_WL)==2){
Excluded_WL = matrix(Excluded_WL,ncol = 2)
}
# get image header data
ImPathHDR <- get_HDR_name(ImPath)
HDR <- read_ENVI_header(ImPathHDR)
Expand Down

0 comments on commit 637a5b3

Please sign in to comment.