From 5b62e11f1b41de487f0b0bf4645fbbc23089a3c0 Mon Sep 17 00:00:00 2001 From: RobertGawron Date: Mon, 19 Aug 2019 17:57:17 +0100 Subject: [PATCH] boxplot to analyze results between samples --- software/DataAcquisition/boxplot.py | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 software/DataAcquisition/boxplot.py diff --git a/software/DataAcquisition/boxplot.py b/software/DataAcquisition/boxplot.py new file mode 100644 index 0000000..438cc0d --- /dev/null +++ b/software/DataAcquisition/boxplot.py @@ -0,0 +1,44 @@ +inputFileName ="DataNoSample.csv" +fileNoSample <- read.delim(inputFileName, , sep=",") + +inputFileName ="DataAmSample1.csv" +fileAmSample1 <- read.delim(inputFileName, , sep=",") + +inputFileName ="DataRaSample2.csv" +fileAmSample2 <- read.delim(inputFileName, , sep=",") + + +backgroundLevel = fileNoSample$Counter +AmIsotope = fileAmSample1$Counter +RaIsotope = fileAmSample2$Counter + + +# date column should be type of date, not string, so parse it +png(filename = paste0("results-", format(Sys.time(), "%d_%b_%Y_%H_%M"), ".png"), width = 800, height = 900, bg = "white") + + + +verticalLabels <- c("background level\nradiation", "Am isotope\n(somke detector)", "Ra isotope\n(old compass)") + +boxplot(backgroundLevel, AmIsotope, RaIsotope, +col="grey", +names=verticalLabels, +horizontal = FALSE, +main = "Radioactivity of different samples meassured using Ionization Chamber", +xlab = "Measurement", +ylab = "Sensor voltage", +boxwex=0.2) + +# no X grid, Y grid grid aligns with the tick marks +grid(NA, NULL) + + +boxplot(backgroundLevel, AmIsotope, RaIsotope, +col="grey", +names=verticalLabels, +horizontal = FALSE, +main = "Radioactivity of different samples meassured using Ionization Chamber", +xlab = "Measurement", +ylab = "Sensor voltage", +boxwex=0.2, +add=T)