iluke_equilcorr

PURPOSE ^

SYNOPSIS ^

function equil = iluke_equilcorr(equil)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function equil = iluke_equilcorr(equil)
0002 %
0003 if ~isfield(equil,'tokamak') || ~isfield(equil,'shotnum') || ~isfield(equil,'shotime')
0004     %
0005     % default parameters
0006     %
0007     equil.tokamak = 'UNKNOWN';
0008     equil.shotnum = '0';
0009     equil.shotime = 0;
0010     %
0011     isep = [0,find(equil.id == '_'),length(equil.id)+1];
0012     nstrs = length(isep) - 1;
0013     strs = cell(1,nstrs);
0014     %
0015     for iisep = 1:nstrs,
0016         strs{iisep} = equil.id(isep(iisep)+1:isep(iisep+1)-1);
0017     end
0018     %
0019     inum = find(~isnan(str2double(strs)));
0020     nnum = length(inum);% number of numerical ids
0021     %
0022     if nnum > 0,
0023         %
0024         equil.shotnum = strs{inum(1)};% shotnum
0025         %
0026         if inum(1) > 1,
0027             equil.tokamak = strs{1};
0028             for iisep = 2:inum(1)-1,
0029                 equil.tokamak = [equil.tokamak,'_',strs{iisep}];% equil
0030             end
0031         end
0032         %
0033     end
0034     %
0035     if nnum > 1,
0036         %
0037         equil.shotime = str2double(strs{inum(2)});% shotnum
0038         %
0039     end
0040 elseif ischar(equil.shotime),
0041     equil.shotime = str2double(equil.shotime);
0042 end
0043 %
0044 if ~isfield(equil,'ip'),
0045     equil.ip = NaN;
0046 end

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.