0001 function img= inv_solve_abs_core(imdl,varargin);
0002
0003
0004 warning('EIDORS:deprecated','INV_SOLVE_ABS_CORE is deprecated in favour of INV_SOLVE_CORE as of 04-Feb-2016.');
0005 try imdl.inv_solve_core = imdl.inv_solve_abs_core; imdl=rmfield(imdl,'inv_solve_abs_core'); end
0006 imdl = deprecate_imdl_opt(imdl, 'parameters');
0007 imdl = deprecate_imdl_opt(imdl, 'inv_solve');
0008 imdl = deprecate_imdl_opt(imdl, 'inv_solve_core');
0009 img=inv_solve_core(imdl,varargin{:});
0010 try img.inv_solve_abs_core = img.inv_solve_core; img=rmfield(img,'inv_solve_core'); end
0011
0012 function imdl = deprecate_imdl_opt(imdl,opt)
0013 if ~isfield(imdl, opt)
0014 return;
0015 end
0016 if ~isstruct(imdl.(opt))
0017 error(['unexpected inv_model.' opt ' where ' opt ' is not a struct... i do not know what to do']);
0018 end
0019
0020
0021 Af = fieldnames(imdl.(opt));
0022 if ~strcmp(opt, 'inv_solve') || (length(Af(:)) ~= 1) || ~strcmp(Af(:),'calc_solution_error')
0023 disp(imdl)
0024 disp(imdl.(opt))
0025 warning('EIDORS:deprecatedParameters',['INV_SOLVE inv_model.' opt '.* are deprecated in favor of inv_model.inv_solve_core.* as of 30-Apr-2014.']);
0026 end
0027
0028 if ~isfield(imdl, 'inv_solve_core')
0029 imdl.inv_solve_core = imdl.(opt);
0030 else
0031
0032
0033 for i = fieldnames(imdl.(opt))'
0034 imdl.inv_solve_core.(i{1})=imdl.(opt).(i{1});
0035 end
0036 end
0037 imdl = rmfield(imdl, opt);