Commit a9d38180 authored by Jean-Baptiste Feret's avatar Jean-Baptiste Feret

- fixed bug in Lib_MapSpectralSpecies: remove constant bands from Subset$DataSubset if needed

parent 15434963
......@@ -63,6 +63,10 @@ map_spectral_species <- function(Input_Image_File,Output_Dir,PCA_Files,PCA_model
Subset$DataSubset <- apply_continuum_removal(Subset$DataSubset, SpectralFilter, nbCPU = nbCPU)
}
print("Apply PCA to subset prior to k-Means")
# remove constant bands if needed
if (!length(Spectral$BandsNoVar) == 0) {
Subset$DataSubset <- Subset$DataSubset[, -Spectral$BandsNoVar]
}
if (TypePCA == "PCA" | TypePCA == "SPCA") {
dataPCA <- t(t(PCA_model$eiV[, 1:PCA_model$Nb_PCs]) %*% t(center_reduce(Subset$DataSubset, PCA_model$mu, PCA_model$scale)))
}
......
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