rough_cal_3d.Rd
This function is used to estimate scale factors and offsets for measurements from a triaxial field sensor. This function estimates the scale factor needed to make the magnitude of X close to the expected field strength. It then calls fix_offset_3d to correct any offset errors in X. This function does not try to optimize the results. See spherical_cal for a more powerful data-driven calibration method.
rough_cal_3d(X, fstr)
X | A sensor structure or matrix containing measurements from a triaxial field sensor such as an accelerometer or magnetometer. X can be in any units and frame. |
---|---|
fstr | The expected field strength at the measurement location in the same units as X |
A list with 2 elements:
X: A sensor structure or matrix containing the adjusted triaxial sensor measurements. It is the same size and has the same sampling rate and units as the input data. If the input is a sensor structure, the output will be also.
G: A calibration structure containing one field: G.poly. The first column of G.poly is the three scale factors applied to the columns of X. The second column of G.poly is the offset added to each column of X after scaling.
This function requires a lot of data as it is looking for extreme values in each axis. A minimum data size of 1000 samples should be used. This function is only usable for field sensors. It will not work for gyroscope data.
if (FALSE) { BW <- beaked_whale plot(x = c(1:length(BW$M$data)), y = BW$M$data) # see what the data looks like first rcal <- rough_cal_3d(BW$M$data, fstr = 38.2) # fstr matches records for field strength in # El Hierro when the tag was used cal <- list(x = c(1:length(rcal$X)), y = rcal$X) plot(cal) }