Commit 99e36d42 authored by jbferet's avatar jbferet
Browse files

- correction for check_data

parent 0ae3f0a7
......@@ -193,6 +193,12 @@ check_data <- function(Raster_Path, Mask = FALSE) {
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")
......@@ -203,18 +209,18 @@ check_data <- function(Raster_Path, Mask = FALSE) {
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("*********************************************************")
message(" Format of mask 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("*********************************************************")
message(" Format of mask raster OK for processing ")
message("*********************************************************")
} else if (Mask == TRUE & HDR$bands > 1) {
message("*********************************************************")
message(" Mask raster should contain only one layer ")
message(" Please produce a binary mask with a unique layer ")
message("*********************************************************")
stop()
message("*********************************************************")
message(" Mask raster should contain only one layer ")
message(" Please produce a binary mask with a unique layer ")
message("*********************************************************")
stop()
}
}
} else {
message("*********************************************************")
message("The following HDR file was expected, but could not be found:")
......
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