Skip to content

Commit 4cf0403

Browse files
committed
minor simplification of code regarding calibration issue
1 parent ca85fde commit 4cf0403

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

R/ReadAndCalibrate.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,15 @@ ReadAndCalibrate = function(file, sf, blocksize, blocknumber, inspectfileobject,
8585
}
8686
# -------------------------------------------------------------------------
8787
# MODULE 3 - EXTRACT CALIBRATION COEFFICIENTS -----------------------------
88-
calCoefs = vm.error.st = vm.error.end = NULL
88+
calCoefs = list(offset = c(0,0,0), scale = c(1, 1, 1))
89+
vm.error.st = vm.error.end = NA
8990
if (do.calibration == TRUE & iteration == 1) {
9091
accCols = which(colnames(data) %in% c("x","y","z"))
91-
cal = try(calibrateRaw(data[, accCols], sf = sf, verbose = verbose),silent = T)
92-
92+
cal = try(calibrateRaw(data[, accCols], sf = sf, verbose = verbose),
93+
silent = T)
9394
if (is.list(cal)) {
9495
calCoefs = cal$calCoefs; vm.error.st = cal$vm.error.st;
9596
vm.error.end = cal$vm.error.end
96-
} else{
97-
calCoefs = list(offset = c(0,0,0), scale = c(1, 1, 1))
9897
}
9998
}
10099
# -------------------------------------------------------------------------

0 commit comments

Comments
 (0)