From 9efa1d10a9c9cb2ba7904f2e0e80180c4004c2dc Mon Sep 17 00:00:00 2001 From: nwickel Date: Wed, 18 Oct 2023 12:56:43 +0200 Subject: [PATCH] Got additional information from PM and added it --- code/read_trans_matrix.R | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 code/read_trans_matrix.R diff --git a/code/read_trans_matrix.R b/code/read_trans_matrix.R new file mode 100644 index 0000000..fa09b83 --- /dev/null +++ b/code/read_trans_matrix.R @@ -0,0 +1,37 @@ +# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/code") + +dat <- as.data.frame(do.call(rbind, XML::xmlToList("../data/haum/trans.xml"))) + +dat$a <- as.numeric(dat$a) +dat$b <- as.numeric(dat$b) +dat$c <- as.numeric(dat$c) +dat$d <- as.numeric(dat$d) +dat$tx <- as.numeric(dat$tx) +dat$ty <- as.numeric(dat$ty) +dat$idx <- sprintf("%03d", as.numeric(dat$idx)) + +# --> artwork names are different from names in data set ??? + +plot(ty ~ tx, dat, xlim = c(0, 3840), ylim = c(0, 2160)) + + +# read log data +datlogs <- read.table("../data/haum/event_logfiles_metadata_2023-09-23_01-31-30.csv", + sep = ";", header = TRUE) +datlogs$date <- as.Date(datlogs$date) +datlogs$date.start <- as.POSIXct(datlogs$date.start) +datlogs$date.stop <- as.POSIXct(datlogs$date.stop) +datlogs$artwork <- sprintf("%03d", datlogs$artwork) + +datmove <- aggregate(cbind(duration, scaleSize, rotationDegree, x.start, + y.start, x.stop, y.stop) ~ artwork, datlogs, + mean) + +plot(y.start ~ x.start, datmove, xlab = "x", ylab = "y", + xlim = c(0, 3840), ylim = c(0, 2160)) +points(y.stop ~ x.stop, datmove, xlim = c(0, 3840), ylim = c(0, 2160), col = "blue") +points(ty ~ tx, dat, xlim = c(0, 3840), ylim = c(0, 2160), col = "red") +legend("topleft", c("start", "stop", "trans"), col = c("black", "blue", "red"), pch = 21) + +# --> does not seem to be a good way to compare if trans values ae valid +