4 jun 2016

Working with the Shootout 2016 data with R (Part 1)



wavelengths_A<-seq(from=730,to=1100,by=0.5)
wavelengths_B<-seq(from=570,to=1100,by=0.5)
wavelengths_C<-seq(from=850,to=1048,by=2)
######  WORKING WITH "MANUFACTURER A" DATA #########################

### A1 Instrument
CalSetA1_spec<-as.matrix(CalSetA1[,3:743])              #Defining the spectra range
    matplot(wavelengths_A,t(CalSetA1_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,6),col="red")
colsC<-seq(from=1,to=637,by=4)               #to convert from 0.5 to 2.0 nm
CalSetA1_2nm_spec<-CalSetA1_spec[,colsC]     # A1 with 2nm interval
CalSetA1_tC_spec<-CalSetA1_2nm_spec[,61:160] # A1 trimmed to C
    matplot(wavelengths_C,t(CalSetA1_tC_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,4),col="blue")
   
### A2 Instrument
CalSetA2_spec<-as.matrix(CalSetA2[,3:743])
    matplot(wavelengths_A,t(CalSetA2_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,6),col="red")
CalSetA2_2nm_spec<-CalSetA2_spec[,colsC]     # A2 with 2nm interval
CalSetA2_tC_spec<-CalSetA2_2nm_spec[,61:160] # A2 trimmed to C
    matplot(wavelengths_C,t(CalSetA2_tC_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,4),col="blue")



### A3 Instrument
CalSetA3_spec<-as.matrix(CalSetA3[,3:743])
    matplot(wavelengths_A,t(CalSetA3_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,6),col="red")
CalSetA3_2nm_spec<-CalSetA3_spec[,colsC]     # A3 with 2nm interval
CalSetA3_tC_spec<-CalSetA3_2nm_spec[,61:160] # A3 trimmed to C
    matplot(wavelengths_C,t(CalSetA3_tC_spec),lty=1,type="l",
        pch=NULL,xlab="nm",ylab="abs",ylim=c(-0.5,4),col="blue")

 This is the plot of the spectra in the calibration set for Manufacturer A scanned on the instruments A1, A2 and A3.


 This is the plot of the spectra in the calibration set for Manufacturer A scanned on the instruments A1, A2 and A3 timmed to the range of C (instrument with the lower range) .
 

No hay comentarios:

Publicar un comentario