# Differences

This shows you the differences between two versions of the page.

 — tagwiki:tools:calibration:rough_cal_3d [2017/08/04 13:54] (current)das39 created 2017/08/04 13:54 das39 created 2017/08/04 13:54 das39 created Line 1: Line 1: + ====== rough_cal_3d ====== + Estimate scale factors and offsets for measurements from a triaxial field sensor. + ----- + ===== Syntax ===== + === Matlab & Octave === + <​code>​ + [X,G] = rough_cal_3d(X,​fstr) + ​ + === R === + <​code>​ + list <- rough_cal_3d(X,​ fstr) + ​ + + ===== Description ===== + 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. + + ===== Inputs ===== + ^ Input var ^ Description ^ Units ^ + | X | is a sensor structure/​list or matrix containing measurements from a triaxial field sensor such as an accelerometer or magnetometer. X can be in any units and frame.|N/A| + |fstr| is the expected field strength at the measurement location in the same units as X.|nT| + + ===== Outputs ===== + ^ Output var ^ Description ^ Units^ + |X| is a sensor structure/​list 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/​list,​ the output will be also.|N/A| + |G| is a calibration structure/​list containing one field: G.polyG$poly. The first column of G.polyG$poly is the three scale factors applied to the columns of X. The second column of G.polyG$poly is the offset added to each column of X after scaling.|N/​A| + + ===== Notes & assumptions ===== + -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. + + ===== Example ===== + + ==== Matlab & Octave ==== + <​code>​ + BW <- load_nc('​testset1.nc'​) + rcal <- rough_cal_3d(BW.M.data,​ fstr = 38.2) %fstr matches records for field strength in El Hierro when the tag was used + plott(rcal.X,​ BW.sampling_rate) + ​ + + ==== R ==== + <​code>​ + BW <- beaked_whale + 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(rcal = rcal$X) + plott(cal, BW\$sampling_rate) + ​ + + ===== About ===== + [[bugs@animaltags.org]] + Last modified: 4 August 2017
• tagwiki/tools/calibration/rough_cal_3d.txt