Convert raw acceleration values to physical units in an acc vector
Source: R/acc_calibrate.R
acc_calibrate.RdApplies calibration function(s) to bursts of raw acceleration ADC values
in an acc vector. Specify a set of calibration functions
with acc_calibration().
Arguments
- x
An
accvector.- calibration
An
acc_calibrationobject containing the calibration function(s) to apply to each burst inx. Seeacc_calibration()to specify calibration functions.
See also
acc_calibration() and as_acc_calibration() to
construct calibrations for use with acc_calibrate().
Examples
a <- acc_example()
acc_calibrate(a, acc_calibration("ornitela"))
#> <acceleration[2]>
#> [1] (0.01 0 0.01) [m/s^2] (0 -0.01 0.01) [m/s^2]
#> # frequency: 20 [Hz]
acc_calibrate(a, acc_calibration("eobs", tag_id = 1000))
#> <acceleration[2]>
#> [1] (-54.21 -54.23 -54.2) [m/s^2] (-54.22 -54.24 -54.2) [m/s^2]
#> # frequency: 20 [Hz]
acc_calibrate(a, acc_calibration(offset = 2048, slope = 0.001))
#> <acceleration[2]>
#> [1] (-20.08 -20.08 -20.07) [m/s^2] (-20.08 -20.09 -20.07) [m/s^2]
#> # frequency: 20 [Hz]
# Specify different calibration parameters for each burst.
# Calibrations will be mapped to the input `acc` object by index.
acc_calibrate(
a,
acc_calibration(offset = c(2048, 2046), slope = c(0.001, 0.002))
)
#> <acceleration[2]>
#> [1] (-20.08 -20.08 -20.07) [m/s^2] (-40.13 -40.14 -40.11) [m/s^2]
#> # frequency: 20 [Hz]