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