calc_autocalparams: Calculate Auto-calibration Parameters

View source: R/MPI_calibrate.R

calc_autocalparamsR Documentation

Calculate Auto-calibration Parameters

Description

Function to calculate auto-calibration parameters from known still points from a bin file that create a unitary sphere.

Usage

calc_autocalparams(
  binfile,
  binfile_path,
  output_folder,
  sphere_points,
  use_temp = TRUE,
  spherecrit = 0.3,
  maxiter = 500,
  tol = 1e-13
)

Arguments

binfile

Text lines read from an open connection to a bin file.

binfile_path

Path to the bin file to be processed.

output_folder

Path to the folder containing GENEAcore run outputs and Measurement Period Information (MPI) files.

sphere_points

List of points that populate a unitary sphere and their associated temperature in the form (x,y,z,temp).

use_temp

Allows auto-calibration to be run with and without temperature compensation.

spherecrit

The minimum required acceleration value for each axis in both directions for auto-calibration to be reliable.

maxiter

The maximum number of sphere fit iterations attempted during auto-calibration.

tol

The limit of incremental sphere fit improvements before auto-calibration is considered complete.

Value

List of auto-calibration parameters within the measurement period information (MPI).

Examples

binfile_path <- system.file("inst/extdata/10Hz_calibration_file.bin", package = "GENEAcore")
output_folder <- "."
con <- file(binfile_path, "r")
binfile <- readLines(con, skipNul = TRUE)
close(con)
MPI <- create_MPI(binfile, binfile_path, output_folder)
nonmovement_list <- detect_nonmovement(binfile, binfile_path, output_folder)
MPI <- calc_autocalparams(binfile, binfile_path, output_folder, nonmovement_list$sphere_points)

GENEAcore documentation built on April 11, 2025, 5:43 p.m.