Skip to content
Snippets Groups Projects
Commit bfe14779 authored by wactbprot's avatar wactbprot
Browse files

eop

parent e102196d
No related branches found
No related tags found
No related merge requests found
path <- "data/"
diagpath <- "diagr/"
baseN <- "spectr-"
sufix <- ".dat"
N <- 250
par(mfrow=c(1,1))
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
library(R4CouchDB)
plt0 <- function(){
png(paste(diagpath,"specFrom-",fns[1],".png", sep=""))
plot(res0$freque, res0$spectr,
type="l",
xlab="f in Hz",
ylab="F(v(t))"
)
grid(col=1)
points(res$freque,res$spectr,
type="l",
col=2,
xlab="f in Hz",
ylab="F(v(t))"
)
legend(min(res0$freque),
max(res0$spectr),
c(what0,what),
col=c(1,2),
lty=c(1,1))
dev.off()
}
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
mvAndPlot <- function(path, baseN, sufix, N, fns ){
amplArr <- matrix(ncol=length(fns), nrow=N)
freqArr <- matrix(ncol=length(fns), nrow=N)
for( i in 1:length(fns)){
a <- read.table(paste(path,baseN, fns[i],sufix,sep=""), dec=",")
cdb <- cdbIni()
cdb$serverName <- "e73462.berlin.ptb.de"
cdb$DBName <- "vaclab_db"
cdb$id <- "356019709104488b7bb420891904a06f"
doc <- cdbGetDoc(cdb)$res
freqArr[,i] <- as.vector(a$V1)
amplArr[,i] <- as.vector(a$V2)
}
spectr <- rowMeans(amplArr)
freque <- rowMeans(freqArr)
res <- list(spectr=spectr,freque=freque)
return(res)
}
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
fns <- c(1,2,3,4,5,6,12,15,20, 29,30,31,33)
what0 <- "alles aus (alle VP, alle TMP Klimaanlage)"
res0 <- mvAndPlot(path, baseN, sufix, N, fns)
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 48:51
what <- "alles an (bis auf Klimaanlage)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 7:11
what <- "nur V4 VP (lks)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 13:14
what <- "nur 20l VP (re)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 16:19
what <- "nur Gaseinl. VP"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 21:26
what <- "GE VP & V4 VP"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 39:41
what <- "V4 TMP & VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 44:47
what <- "GE TMP+VP an V4 TMP*VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 48:51
what <- "GE TMP+VP an, V4 TMP*VP an, 20l TMP+VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
tms <- as.numeric(unlist(doc$Calibration$Measurement$Values$Time[[1]]$Value))
th <- (tms - tms[1])/1000/3600
rd <- unlist(doc$Calibration$Measurement$Values$Pressure[[1]]$Value)
plot(th,
rd,
main="Finger 23UM am Kessel SE1",
xlab="t in h",
ylab="dcr")
grid(col=1)
This diff is collapsed.
diagr/rd-23UM_2012-02-21.png

18.8 KiB

path <- "data/"
diagpath <- "diagr/"
baseN <- "spectr-"
sufix <- ".dat"
N <- 250
par(mfrow=c(1,1))
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
plt0 <- function(){
png(paste(diagpath,"specFrom-",fns[1],".png", sep=""))
plot(res0$freque, res0$spectr,
type="l",
xlab="f in Hz",
ylab="F(v(t))"
)
grid(col=1)
points(res$freque,res$spectr,
type="l",
col=2,
xlab="f in Hz",
ylab="F(v(t))"
)
legend(min(res0$freque),
max(res0$spectr),
c(what0,what),
col=c(1,2),
lty=c(1,1))
dev.off()
}
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
mvAndPlot <- function(path, baseN, sufix, N, fns ){
amplArr <- matrix(ncol=length(fns), nrow=N)
freqArr <- matrix(ncol=length(fns), nrow=N)
for( i in 1:length(fns)){
a <- read.table(paste(path,baseN, fns[i],sufix,sep=""), dec=",")
freqArr[,i] <- as.vector(a$V1)
amplArr[,i] <- as.vector(a$V2)
}
spectr <- rowMeans(amplArr)
freque <- rowMeans(freqArr)
res <- list(spectr=spectr,freque=freque)
return(res)
}
##'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
fns <- c(1,2,3,4,5,6,12,15,20, 29,30,31,33)
what0 <- "alles aus (alle VP, alle TMP Klimaanlage)"
res0 <- mvAndPlot(path, baseN, sufix, N, fns)
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 48:51
what <- "alles an (bis auf Klimaanlage)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 7:11
what <- "nur V4 VP (lks)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 13:14
what <- "nur 20l VP (re)"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 16:19
what <- "nur Gaseinl. VP"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 21:26
what <- "GE VP & V4 VP"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 39:41
what <- "V4 TMP & VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 44:47
what <- "GE TMP+VP an V4 TMP*VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fns <- 48:51
what <- "GE TMP+VP an, V4 TMP*VP an, 20l TMP+VP an"
res <- mvAndPlot(path, baseN, sufix, N, fns)
plt0()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment