#$ targen -d2 test #$ printtarg test #$ chartread -D5 -H test ## calibration, 60sec pause, then 10sec measurement on calibration tile ## output saved as chartread-D5_on_whiteref.txt ## raw data of dark calibration saved as darkcal106.dump ## raw data of strip reading saved as 1890readings.dump #$ xxd -r -p darkcal106.dump darkcal106.bin #$ xxd -r -p 1890readings.dump 1890readings.bin rawfile <-file("/Users/klaus/Documents/Farbe/argyll/i1_IR-calibration/darkcal106.bin","rb") r1<-readBin(rawfile,integer(),128,size=2, endian="big", signed=FALSE) r1<-ifelse(r1 >= 64000, r1-65536, r1) darkcal <- data.frame(t(r1)) for (i in 2:106) { r1<-readBin(rawfile,integer(),128,size=2, endian="big", signed=FALSE) r1<-ifelse(r1 >= 64000, r1-65536, r1) darkcal <- rbind(darkcal, data.frame(t(r1))) } close(rawfile) rm(r1) rawfile <-file("/Users/klaus/Documents/Farbe/argyll/i1_IR-calibration/1890readings.bin","rb") r1<-readBin(rawfile,integer(),128,size=2, endian="big", signed=FALSE) r1<-ifelse(r1 >= 64000, r1-65536, r1) readings <- data.frame(t(r1)) for (i in 2:1890) { r1<-readBin(rawfile,integer(),128,size=2, endian="big", signed=FALSE) r1<-ifelse(r1 >= 64000, r1-65536, r1) readings <- rbind(readings, data.frame(t(r1))) } close(rawfile) rm(r1) plot(c(0,1890),c(min(min(readings)),max(max(readings))), type="n") lines(1:1890, readings[1:1890,70], col="black") lines(1:1890, readings[1:1890,77], col="red") lines(1:1890, readings[1:1890,97], col="green") lines(1:1890, readings[1:1890,107], col="blue") # saved as some_bands offset1<-apply(darkcal,2,median) offset2<-apply(readings[213:233,],2,median) plot(offset2[-128], col="red", xlab="band", ylab="median of dark current") points(offset1[-128], pch="x", col="black") legend("topright",legend=c("initial calibration", "strip calibration"), pch=c("x","o"), col=c("black","red")) # saved as offsets boxplot(darkcal[-128], main="initial dark calibration") # saved as boxplot_initial_dark_cal boxplot(readings[213:233,-128]) # saved as boxplot_strip_dark_cal summary(readings[213:233,1:20]) summary(darkcal[1:20]) # saved as summary_offset.txt readings2 <- readings[234:1890,1:127] plot(c(1,nrow(readings2)), c(min(min(readings2)), max(max(readings2))), type="n") bands<-round(seq(from=1, to=127, length.out=10)) for(i in bands) lines(1:nrow(readings2), readings2[,i], col=rainbow(ncol(readings2), end=0.7)[i]) legend("topright",legend=paste("band", bands), lwd=2, col=rainbow(ncol(readings2), end=0.7)[bands], cex=0.65) # saved as 10_bands