Make omega file which extension is '.omega.mat'. The omega file is one of head_files which is added Omega [usage] omega_file = vb_util_make_omega_file(head_file, Omega, Sout) [input] head_file : [required] base file which will be added 'Omega' and 'Sout' Omega : [required] Omega data of vb_solid_angle_grk() Sout : [required] Sout data of vb_solid_angle_grk() [output] omega_file : new file name [note] @see vb_util_get_file_body(), vb_save() [history] 2006-12-11 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function omega_file = vb_util_make_omega_file(head_file, Omega, Sout) 0002 % Make omega file which extension is '.omega.mat'. The omega file is one of head_files which is added Omega 0003 % [usage] 0004 % omega_file = vb_util_make_omega_file(head_file, Omega, Sout) 0005 % [input] 0006 % head_file : [required] base file which will be added 'Omega' and 'Sout' 0007 % Omega : [required] Omega data of vb_solid_angle_grk() 0008 % Sout : [required] Sout data of vb_solid_angle_grk() 0009 % [output] 0010 % omega_file : new file name 0011 % [note] 0012 % @see vb_util_get_file_body(), vb_save() 0013 % [history] 0014 % 2006-12-11 (Sako) initial version 0015 % 0016 % Copyright (C) 2011, ATR All Rights Reserved. 0017 % License : New BSD License(see VBMEG_LICENSE.txt) 0018 0019 % check arguments 0020 if ~exist('head_file', 'var') || isempty(head_file) 0021 error('head_file is a required parameter'); 0022 end 0023 0024 if exist(head_file, 'file') ~= 2 0025 error('cannot find head_file : %s', head_file); 0026 end 0027 0028 if ~exist('Omega', 'var') || isempty(Omega) 0029 error('Omega is a required parameter'); 0030 end 0031 0032 if ~exist('Sout', 'var') || isempty(Sout) 0033 error('Sout is a required parameter'); 0034 end 0035 0036 % make file path 0037 OMEGA_EXT = '.omega.mat'; 0038 fdir = fileparts(head_file); 0039 omega_file = [fdir filesep vb_util_get_file_body(head_file) OMEGA_EXT]; 0040 0041 % store 0042 copyfile(head_file, omega_file); 0043 vb_save([omega_file],'Omega','Sout'); 0044 0045 %%% END OF FILE %%%