5 ene 2022

Importing LUCAS database from R into WinISI


Once we have the spectra we want from the LUCAS database (ESDAC*) in R, we can export it to a "txt" file with:


write.table(spec2nm, file="lucas_spain.txt",
            row.names=TRUE,
            col.names=FALSE)


This way we have the samples IDs, but we don´t need the column name (wavelengths), because Win ISI will create them when importing the spectra.


Once we have the txt file, we convert it to a ".nir" file which is the spectra format for Win ISI with the Win ISI tool "Convert", selecting the configuration from TXT to Win ISI.

After filling  the options Win ISI ask, we wait for the conversion succeeded message and we have the ".nir" file ready to view:



Now we do the same with the parameters (constituents) we are interested in:

write.table(lucas_spain[ ,c(1, 5:16)],                                           file="lucas_spain_constituents.txt", 
            row.names=TRUE, col.names=TRUE)

We export the samples IDs as well, to link them with the spectra. Finally we import the parameters to the spectra to get the ".cal" file and ready to work with the spanish LUCAS database in Win ISI.

*European Soil Data Centre (ESDAC), esdac.jrc.ec.europa.eu, European Commission, Joint Research Centre

No hay comentarios:

Publicar un comentario