set calibration information into meg_info [usage] [meg_info] = vb_ykgwfile_load_calibinfo(ykgwfile, meg_info) [input] ykgwfile : <required> <<file>> yokogawa file path meg_info : <optional> <<struct>> base of information : if this is not specified or is empty, meg_info will be created : newly [output] meg_info : <<struct>> updated meg_info : .sensor_gain [n_channel x 1] : .sensor_offset [n_channel x 1] : .FLL_gain [n_fll x 1] : .device_info.acq_info.data_bit_len [1 x 1 double] : .calib_info [1 x 1 struct] [note] See also getYkgwHdrCalib [history] 2007-06-28 (Sako) initial version 2011-07-20 (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 [meg_info] = vb_ykgwfile_load_calibinfo(ykgwfile, meg_info) 0002 % set calibration information into meg_info 0003 % 0004 % [usage] 0005 % [meg_info] = vb_ykgwfile_load_calibinfo(ykgwfile, meg_info) 0006 % 0007 % [input] 0008 % ykgwfile : <required> <<file>> yokogawa file path 0009 % meg_info : <optional> <<struct>> base of information 0010 % : if this is not specified or is empty, meg_info will be created 0011 % : newly 0012 % 0013 % [output] 0014 % meg_info : <<struct>> updated meg_info 0015 % : .sensor_gain [n_channel x 1] 0016 % : .sensor_offset [n_channel x 1] 0017 % : .FLL_gain [n_fll x 1] 0018 % : .device_info.acq_info.data_bit_len [1 x 1 double] 0019 % : .calib_info [1 x 1 struct] 0020 % 0021 % [note] 0022 % See also 0023 % getYkgwHdrCalib 0024 % 0025 % [history] 0026 % 2007-06-28 (Sako) initial version 0027 % 2011-07-20 (Sako) modified to use the new YOKOGAWA library 0028 % 0029 % Copyright (C) 2011, ATR All Rights Reserved. 0030 % License : New BSD License(see VBMEG_LICENSE.txt) 0031 0032 % --- CHECK ARGUMENTS --- % 0033 if ~exist('ykgwfile', 'var'), ykgwfile = ''; end 0034 if ~exist('meg_info', 'var'), meg_info = []; end 0035 [ykgwfile, meg_info] = inner_check_arguments(ykgwfile, meg_info); 0036 0037 % --- MAIN PROCEDURE --------------------------------------------------------- % 0038 % 0039 calib_info = getYkgwHdrCalib(ykgwfile); 0040 0041 % --- <calib_info> 0042 % .sensitivity <<struct array>> 0043 % .gain 0044 % .offset 0045 % 0046 % .fll <<struct array>> 0047 % .gain 0048 % 0049 % .ad <<struct>> 0050 % .bit 0051 % .analog_range [Volt] 0052 0053 % --- main information for calibration 0054 meg_info.sensor_gain = vb_calibinfo_get_sensor_gain(calib_info); 0055 meg_info.sensor_offset = vb_calibinfo_get_sensor_offset(calib_info); 0056 meg_info.FLL_gain = vb_calibinfo_get_fll_gain(calib_info); 0057 0058 % --- bit lenght of data 0059 meg_info = vb_meginfo_set_data_bit_len(meg_info, ... 0060 vb_calibinfo_get_data_bit_len(calib_info)); 0061 0062 % --- sensor label - set default 0063 calib_info = vb_calibinfo_set_sensor_label(calib_info); 0064 0065 % --- new format of yokogawa 0066 meg_info.calib_info = calib_info; 0067 0068 return; 0069 % 0070 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0071 0072 % --- INNER FUNCTIONS -------------------------------------------------------- % 0073 % 0074 % --- inner_check_arguments() 0075 % 0076 function [ykgwfile, meg_info] = inner_check_arguments(ykgwfile, meg_info) 0077 func_ = mfilename; 0078 0079 if isempty(ykgwfile) 0080 error('(%s)ykgwfile is a required parameter', func_); 0081 end 0082 0083 if isempty(meg_info) 0084 % error('(%s)meg_info is a required parameter', func_); 0085 end 0086 0087 if exist(ykgwfile, 'file') ~= 2 0088 error('(%s)cannot find yokogawa file : %s', func_, ykgwfile); 0089 end 0090 0091 return; 0092 % 0093 % --- end of inner_check_arguments() 0094 % 0095 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0096 0097 % --- END OF FILE --- %