Home > vbmeg > functions > device > meg > yokogawa > vb_ykgwfile_load_data.m

vb_ykgwfile_load_data

PURPOSE ^

load measurement data, which is calibrated, from yokogawa file and store

SYNOPSIS ^

function [meg_info] = vb_ykgwfile_load_data(ykgwfile, meg_info, out_base)

DESCRIPTION ^

 load measurement data, which is calibrated, from yokogawa file and store
  the loaded data by binary format.

 [usage]
   [meg_info] = vb_ykgwfile_load_data(ykgwfile, meg_info, out_base)

 [input]
   ykgwfile : <required> <<file>> yokogawa file path
   meg_info : <required> <<struct>> MEG information
   out_base : <required> base directory of data directory
            :            normally, it is the path of new MEG-MAT file.

 [output]
   meg_info : <<struct>> which may be updated by adding bin_dir field

 [note]
   See also
     vb_meg_yokogawa_store_bin

 [history]
   2007-07-03 (Sako) initial version
   2011-02-17 (Sako) added new arguement 'out_base' and delete returned data
   2011-06-22 (Sako) modified to fit the new YOKOGAWA library

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [meg_info] = vb_ykgwfile_load_data(ykgwfile, meg_info, out_base)
0002 % load measurement data, which is calibrated, from yokogawa file and store
0003 %  the loaded data by binary format.
0004 %
0005 % [usage]
0006 %   [meg_info] = vb_ykgwfile_load_data(ykgwfile, meg_info, out_base)
0007 %
0008 % [input]
0009 %   ykgwfile : <required> <<file>> yokogawa file path
0010 %   meg_info : <required> <<struct>> MEG information
0011 %   out_base : <required> base directory of data directory
0012 %            :            normally, it is the path of new MEG-MAT file.
0013 %
0014 % [output]
0015 %   meg_info : <<struct>> which may be updated by adding bin_dir field
0016 %
0017 % [note]
0018 %   See also
0019 %     vb_meg_yokogawa_store_bin
0020 %
0021 % [history]
0022 %   2007-07-03 (Sako) initial version
0023 %   2011-02-17 (Sako) added new arguement 'out_base' and delete returned data
0024 %   2011-06-22 (Sako) modified to fit 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 if ~exist('out_base', 'var'), out_base = ''; end
0033 [meg_info, out_base, save_swt] = ...
0034   inner_check_arguments(ykgwfile, meg_info, out_base);
0035 
0036 % --- MAIN PROCEDURE --------------------------------------------------------- %
0037 %
0038 if save_swt == true
0039   vb_meg_yokogawa_store_bin(ykgwfile, meg_info, out_base);
0040 else
0041   warning('(%s) save_swt is false. Please check your saveman\n', mfilename);
0042 end
0043 return;
0044 %
0045 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0046 
0047 % --- INNER FUNCTIONS -------------------------------------------------------- %
0048 %
0049 % --- inner_check_arguments()
0050 %
0051 function [meg_info, out_base, save_swt] = ...
0052   inner_check_arguments(ykgwfile, meg_info, out_base)
0053 
0054 func_ = mfilename;
0055 
0056 if isempty(ykgwfile)
0057   error('(%s) ykgwfile is a required parameter', func_);
0058 end
0059 
0060 if isempty(meg_info)
0061   error('(%s) meg_info is a required parameter', func_);
0062 end
0063 
0064 if isempty(out_base)
0065   error('(%s) out_base is a required parameter', func_);
0066 end
0067 
0068 % check validity as a file
0069 if exist(ykgwfile, 'file') ~= 2
0070   error('(%s) cannot find yokogawa file : %s', func_, ykgwfile);
0071 end
0072 
0073 if isfield(meg_info, 'saveman')
0074   save_swt = vb_saveman_get_switch(meg_info.saveman);
0075 else
0076   save_swt = false;
0077 end
0078 
0079 return;
0080 %
0081 % --- end of inner_check_arguments()
0082 
0083 %
0084 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0085 
0086 % --- END OF FILE --- %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005