Commit 6b1601fc authored by jbferet's avatar jbferet
Browse files

- final update check functions

parent 99e36d42
......@@ -179,36 +179,37 @@ check_data <- function(Raster_Path, Mask = FALSE) {
message("*********************************************************")
stop()
} else if (Mask == FALSE & ((HDR$interleave == "bil") | (HDR$interleave == "BIL"))) {
if (HDR$`wavelength units` == "Unknown") {
message("*********************************************************")
message("IF MULTI / HYPERSPECTRAL DATA: ")
message("Please make sure the wavelengths are in nanometers")
message("if not, stop processing and convert wavelengths in nanometers in HDR file")
message("*********************************************************")
}
if ((!HDR$`wavelength units` == "Nanometers") & (!HDR$`wavelength units` == "nanometers")) {
message("*********************************************************")
message("IF MULTI / HYPERSPECTRAL DATA: ")
message("Please make sure the wavelengths are in nanometers")
message("if not, stop processing and convert wavelengths in nanometers in HDR file")
message("*********************************************************")
}
if (is.null(HDR$`wavelength units`)) {
message("*********************************************************")
message("Image to process is not multispectral/hyperspectral image ")
message("Format is OK, but make sure Continuum_Removal is set to FALSE")
message("*********************************************************")
}
if (HDR$`wavelength units` == "micrometers") {
message("*********************************************************")
message("Please convert wavelengths in nanometers in HDR file")
message("*********************************************************")
stop()
}
if ((HDR$`wavelength units` == "nanometers") | (HDR$`wavelength units` == "Nanometers")) {
message("*********************************************************")
message(" Format of main raster OK for processing ")
message("*********************************************************")
} else {
if (HDR$`wavelength units` == "Unknown") {
message("*********************************************************")
message("IF MULTI / HYPERSPECTRAL DATA: ")
message("Please make sure the wavelengths are in nanometers")
message("if not, stop processing and convert wavelengths in nanometers in HDR file")
message("*********************************************************")
}
if ((!HDR$`wavelength units` == "Nanometers") & (!HDR$`wavelength units` == "nanometers")) {
message("*********************************************************")
message("IF MULTI / HYPERSPECTRAL DATA: ")
message("Please make sure the wavelengths are in nanometers")
message("if not, stop processing and convert wavelengths in nanometers in HDR file")
message("*********************************************************")
}
if (HDR$`wavelength units` == "micrometers") {
message("*********************************************************")
message("Please convert wavelengths in nanometers in HDR file")
message("*********************************************************")
stop()
}
if ((HDR$`wavelength units` == "nanometers") | (HDR$`wavelength units` == "Nanometers")) {
message("*********************************************************")
message(" Format of main raster OK for processing ")
message("*********************************************************")
}
}
} else if (Mask == TRUE & HDR$bands == 1 & ((HDR$interleave == "bil") | (HDR$interleave == "BIL") | (HDR$interleave == "bsq") | (HDR$interleave == "BSQ"))) {
message("*********************************************************")
......
......@@ -28,7 +28,7 @@ perform_radiometric_filtering <- function(Image_Path, Mask_Path, Output_Dir, Typ
# check if format of raster data is as expected
check_data(Image_Path)
if (!Mask_Path==FALSE){
check_data(Mask_Path)
check_data(Mask_Path,Mask = TRUE)
}
# define full output directory
Output_Dir_Full <- define_output_directory(Output_Dir, Image_Path, TypePCA)
......
......@@ -28,7 +28,7 @@ perform_PCA <- function(ImPath, MaskPath, Output_Dir, Continuum_Removal = TRUE,
# check if format of raster data is as expected
check_data(ImPath)
if (!MaskPath==FALSE){
check_data(MaskPath)
check_data(MaskPath,Mask = TRUE)
}
# define the path corresponding to image, mask and output directory
ImNames <- list()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment