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

se2 t-sens

parent 6b771a68
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,9 @@ se2.calTsensKorr <- function(ccc){
msg <- "calculated by se2.calTsensKorr"
a <- abbrevList( ccc )
maxT <- 24
minT <- 22
if(a$dataAvailable){
baseName <- "keithley_ch"
baseName <- "keithleych"
chVec <- c("101",
"102",
"103",
......@@ -25,10 +23,6 @@ se2.calTsensKorr <- function(ccc){
normName <- "f250"
nVal <- getConstVal(a$cmv,normName)
nout <- which(is.na(nVal) | (nVal < minT) | (nVal > maxT))
nVal <- nVal[-nout]
for(idx in 1:length(chVec)){
......@@ -36,38 +30,38 @@ se2.calTsensKorr <- function(ccc){
cmplName <- paste(baseName, chVec[idx], sep="")
iVal <- getConstVal(a$cmv,cmplName)
iout <- which((is.na(nVal) | (iVal < minT) | (iVal > maxT)))
iVal <- iVal[-c(nout,iout)]
if(length(iVal) > length(nVal)){
kVal <- nVal - iVal[1:length(nVal)]
}else{
kVal <- nVal[1:length(iVal)] - iVal
}
kVal <- nVal - iVal
k <- mean(kVal, na.rm = TRUE)
sdK <- sd(kVal, na.rm = TRUE)
ccc$Calibration$Result$Values$Temperature <-
setCcl(ccc$Calibration$Result$Values$Temperature,
ccc$Calibration$Analysis$Values$Temperature <-
setCcl(ccc$Calibration$Analysis$Values$Temperature,
paste("keithley_corr_ch",chVec[idx],sep=""),
"K",
k,
paste(msg,"mean(T_ptb_j - T_chi_j) mit T_chi:",cmplName ))
ccc$Calibration$Result$Values$Temperature <-
setCcl(ccc$Calibration$Result$Values$Temperature,
ccc$Calibration$Analysis$Values$Temperature <-
setCcl(ccc$Calibration$Analysis$Values$Temperature,
paste("keithley_sd_corr_ch",chVec[idx],sep=""),
"K",
sdK,
paste(msg,"sd(T_ptb_j - T_chi_j) mit T_chi:",cmplName ))
}
ccc$Calibration$Analysis$Values$Temperature <-
setCcl(ccc$Calibration$Analysis$Values$Temperature,
paste("keithley_N_corr_ch",chVec[idx],sep=""),
"1",
length(kVal),
paste(msg,"length(T_ptb_j - T_chi_j) mit T_chi:",cmplName ))
ccc$Calibration$Result$Values$Temperature <-
setCcl(ccc$Calibration$Result$Values$Temperature,
paste("keithley_corr_ch",chVec[idx],sep=""),
"K",
k)
}
}
return(ccc)
}
......@@ -8,47 +8,34 @@ library(RCurl, quietly =TRUE)
library(R4CouchDB,quietly =TRUE)
cdb <- cdbIni()
loadSrc <- TRUE
cdb$DBName <- "vaclab_db" ## DBName
saveNoProxy <- Sys.getenv("no_proxy")
Sys.setenv("no_proxy" = "*")
cdb$DBName <- "mp_db" ## DBName
if(loadSrc){
infList <- list()
infList$srcPath <- "/usr/local/lib/r4vl"
cdb$id <- paste("_design/rproc",sep="")
srcDoc <- cdbGetDoc(cdb)$res
files <- names(srcDoc$'_attachments')
setwd(infList$srcPath)
baseSrcUrl <- paste(cdb$baseUrl(cdb),
cdb$DBName,"/",
cdb$id,"/",
sep="")
source("load.R")
for(file in files){
fn <- grep("^R/.*\\.R$",file)
if(length(fn) > 0){
srcUrl <- paste(baseSrcUrl,
file,
sep="")
source(srcUrl)
}
}
}
## devel/tests/calculations from here -----------------
cdb$id <- "21012467f60b4e4e3f218da6ff06c7e0"
doc <- cdbGetDoc(cdb)$res
doc <- se2.calTsensKorr(doc)
cdb$dataList <- doc
Result <- cdbUpdateDoc(cdb)$res
cdb$id <- "857e0081cf4eae72c575e90aa924c98d" # T sens 2015
doc <- cdbGetDoc(cdb)$res
if(TRUE){
doc <- refreshResult(cdb,doc)
doc <- refreshAnalysis(cdb,doc)
doc <- se2.calTsensKorr(doc)
}
## cdb$DBName <- "vaclab_db" ## DBName
## cdb$dataList <- doc
## res <- cdbUpdateDoc(cdb)$res
## ----------------------------------------------------
Sys.setenv("no_proxy" = saveNoProxy)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment