# > getwd()
# [1] "/media/alobo/DecepNTFS2/Garrotxa/EspCrater_20230622/REspCrater_20230622"
#require(asdreader)
#
library(prospectr)
require(ggplot2)
require(reshape2)
require(plotly)
library(RColorBrewer)
dirdat <- "../FS3/HyperOlot20230622"
We use package prospectr to read FS3 and splice-correct *.dat files.
f <- list.files(dirdat, patt=glob2rx("*.asd"))
sites <- rep(c(1:4, 8,9,0,10, 13, 7, 14, 15, 11, 12 ,5,6), rep(5,16))
sites <- c(rep("w",10), sites)
repl <- rep(1:5, 18)
df <- NULL
for (i in 1:length(f)){
a <- readASD(file.path(dirdat, f[i]),out_format="list")
w <- a[[1]]$wavelength
sori <- a[[1]]$reflectance
scor <- spliceCorrection(sori, wav=w, splice=c(1000,1800))
df <- rbind(df, data.frame(File=f[i], site=sites[i], replicate=repl[i], side=0,
Wavelength=w,
Reflectanceori=sori,
Reflectance=scor))
}
df2 <- df[df$site!="w" & df$site != "0",]
EspCrat_InSituProbe.lf <- df2
save(EspCrat_InSituProbe.lf, file="EspCrat_InSituProbe.lf.rda")
g1 <- ggplot(data=df2, aes(label=site, label2=replicate, label3=side)) +
geom_line(aes(x=Wavelength, y=Reflectance, color=as.character(site), group=File)) +
ggtitle("Espai Crater: in-situ Reflectance spectra")
#scale_color_brewer(palette="Set1")
ggplotly(g1 + facet_wrap(~site))