set calibration information into meg_info [usage] [meg_info] = vb_ykgwfile_determine_calib(ykgwfile, meg_info) [input] ykgwfile : <required> <<file>> data 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 [note] change sensor_gain size from only active_ch to all See also getYkgwHdrCalib [history] 2007-06-28 (Sako) initial version 2011-06-24 (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_determine_calib(ykgwfile, meg_info) 0002 % set calibration information into meg_info 0003 % 0004 % [usage] 0005 % [meg_info] = vb_ykgwfile_determine_calib(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 not specified or is empty, meg_info will be created 0011 % : newly 0012 % 0013 % [output] 0014 % meg_info : <<struct>> updated meg_info 0015 % 0016 % [note] 0017 % change sensor_gain size from only active_ch to all 0018 % 0019 % See also 0020 % getYkgwHdrCalib 0021 % 0022 % [history] 0023 % 2007-06-28 (Sako) initial version 0024 % 2011-06-24 (Sako) modified to use the new YOKOGAWA library 0025 % 0026 % Copyright (C) 2011, ATR All Rights Reserved. 0027 % License : New BSD License(see VBMEG_LICENSE.txt) 0028 0029 % --- CHECK ARGUMENTS --- % 0030 if ~exist('ykgwfile', 'var'), ykgwfile = ''; end 0031 if ~exist('meg_info', 'var'), meg_info = []; end 0032 % [meg_info, fid] = inner_check_arguments(ykgwfile, meg_info); 0033 [ykgwfile, meg_info] = inner_check_arguments(ykgwfile, meg_info); 0034 0035 % --- MAIN PROCEDURE --------------------------------------------------------- % 0036 % 0037 % 0038 % -- Calibration information 0039 % 0040 calib_info = getYkgwHdrCalib(ykgwfile); 0041 meg_info.sensor_gain = [calib_info.sensitivity(:).gain]'; 0042 meg_info.sensor_offset = [calib_info.sensitivity(:).offset]'; 0043 meg_info.FLL_gain = [calib_info.fll(:).gain]'; 0044 0045 % --- <calib_info> 0046 % .sensitivity <<struct array>> 0047 % .gain 0048 % .offset 0049 % 0050 % .fll <<struct array>> 0051 % .gain 0052 % 0053 % .ad <<struct>> 0054 % .bit 0055 % .analog_range [Volt] 0056 0057 return; 0058 % 0059 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0060 0061 % --- INNER FUNCTIONS -------------------------------------------------------- % 0062 % 0063 % function [meg_info, fid] = inner_check_arguments(ykgwfile, meg_info) 0064 function [ykgwfile, meg_info] = inner_check_arguments(ykgwfile, meg_info) 0065 func_ = mfilename; 0066 0067 if isempty(ykgwfile) 0068 error('(%s)ykgwfile is a required parameter', func_); 0069 end 0070 0071 if isempty(meg_info) 0072 % error('(%s)meg_info is a required parameter', func_); 0073 end 0074 0075 % check validity as a file 0076 if exist(ykgwfile, 'file') ~= 2 0077 error('(%s)cannot find yokogawa file : %s', func_, ykgwfile); 0078 end 0079 0080 return; 0081 % 0082 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0083 0084 % --- END OF FILE --- %