return sensor offset from calib_info [usage] [offset] = vb_calibinfo_get_sensor_offset(calib_info) [input] calib_info : <required> <<struct>> calibration information : temporary struct for pre-process : (new format 2011) : .sensitivity <<struct array>> [1 x n_ch] : .offset : .gain : .fll <struct array>> [1 x n_fll] : .gain : .ad : .bit : .analog_range : : .sensor_label {n_ch x 1} [output] offset : sensor offset [note] [history] 2007-06-28 (Sako) initial version 2011-06-28 (Sako) modified to use the new YOKOGAWA library Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [offset] = vb_calibinfo_get_sensor_offset(calib_info) 0002 % return sensor offset from calib_info 0003 % 0004 % [usage] 0005 % [offset] = vb_calibinfo_get_sensor_offset(calib_info) 0006 % 0007 % [input] 0008 % calib_info : <required> <<struct>> calibration information 0009 % : temporary struct for pre-process 0010 % : (new format 2011) 0011 % : .sensitivity <<struct array>> [1 x n_ch] 0012 % : .offset 0013 % : .gain 0014 % : .fll <struct array>> [1 x n_fll] 0015 % : .gain 0016 % : .ad 0017 % : .bit 0018 % : .analog_range 0019 % : 0020 % : .sensor_label {n_ch x 1} 0021 % 0022 % [output] 0023 % offset : sensor offset 0024 % 0025 % [note] 0026 % 0027 % [history] 0028 % 2007-06-28 (Sako) initial version 0029 % 2011-06-28 (Sako) modified to use the new YOKOGAWA library 0030 % 0031 % Copyright (C) 2011, ATR All Rights Reserved. 0032 % License : New BSD License(see VBMEG_LICENSE.txt) 0033 0034 % --- CHECK ARGUMENTS --- % 0035 if ~exist('calib_info', 'var'), calib_info = []; end 0036 [calib_info] = inner_check_arguments(calib_info); 0037 0038 0039 % --- MAIN PROCEDURE --------------------------------------------------------- % 0040 % 0041 offset = [calib_info.sensitivity(:).offset]'; 0042 return; 0043 % 0044 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0045 0046 0047 % --- INNER FUNCTIONS -------------------------------------------------------- % 0048 % 0049 % --- inner_check_arguments() 0050 % 0051 function [calib_info] = inner_check_arguments(calib_info) 0052 0053 func_ = mfilename; 0054 0055 if isempty(calib_info) 0056 error('(%s) calib_info is a required parameter', func_); 0057 end 0058 0059 if ~isfield(calib_info, 'sensitivity') 0060 error('(%s) sensitivity is a required field', func_); 0061 end 0062 0063 if ~isfield(calib_info.sensitivity, 'offset') 0064 error('(%s) sensitivity.offset is a required field', func_); 0065 end 0066 return; 0067 % 0068 % --- end of inner_check_arguments() 0069 % 0070 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0071 0072 % --- END OF FILE --- %