iluke_import

PURPOSE ^

script iluke_import

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 script iluke_import

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %
0002 % script iluke_import
0003 %
0004 if isfield(import,'equil') && ~isempty(import.equil)
0005     %
0006     % clear current simulation
0007     %
0008     action = 'newshot';iluke_callbacks;
0009     %
0010     % new equil
0011     %
0012     equil = iluke_equilcorr(import.equil);
0013     %
0014     tokamak = equil.tokamak;
0015     shotnum = equil.shotnum;
0016     %
0017     curtime = 1;
0018     %
0019     equils{curtime} = equil;
0020     status.equil(curtime) = 3;
0021     shotimes(curtime) = equil.shotime;
0022     %
0023     status.data = 2;
0024     lukeobj.lukeid.string = '';
0025     %
0026     action = 'equildisp';iluke_callbacks;
0027     %
0028     if isfield(import,'dkeparam') && ~isempty(import.dkeparam),
0029         dkeparam = import.dkeparam;
0030         lukeobj.param.text.string = dkeparam.id;
0031     end
0032     %
0033     if isfield(import,'dkedisplay') && ~isempty(import.dkedisplay),
0034         dkedisplay = import.dkedisplay;
0035         %lukeobj.display.text.string = dkedisplay.id;
0036     end
0037     %
0038     if isfield(import,'ohm') && ~isempty(import.ohm),
0039         ohms{curtime} = import.ohm;
0040         status.ohm(curtime) = 1;
0041         %
0042         action = 'ohmdisp';iluke_callbacks;
0043     else
0044         status.ohm(curtime) = 0;                    
0045     end
0046     %
0047     if isfield(import,'transpfaste') && ~isempty(import.transpfaste),
0048         transpfastes{curtime} = import.transpfaste;
0049         status.transpfaste(curtime) = 1;
0050         %
0051         action = 'transpdisp';iluke_callbacks;
0052     else
0053         status.transpfaste(curtime) = 0;                    
0054     end
0055     %
0056     if isfield(import,'ripple') && ~isempty(import.ripple),
0057         ripples{curtime} = import.ripple;
0058         status.ripple(curtime) = 1;
0059         %
0060         action = 'rippledisp';iluke_callbacks;
0061     else
0062         status.ripple(curtime) = 0;
0063     end
0064     %
0065     if isfield(import,'waves') && ~isempty(import.waves),
0066         wavess{curtime} = import.waves;
0067         status.waves(curtime) = 1;
0068         %
0069         action = 'wavedisp';iluke_callbacks;
0070     elseif isfield(import,'output') && isfield(import.output,'dke_out') && isfield(import.output.dke_out,'waves') && ~isempty(import.output.dke_out.waves),
0071         wavess{curtime} = import.output.dke_out.waves;
0072         status.waves(curtime) = 1;
0073         %
0074         action = 'wavedisp';iluke_callbacks;
0075     else
0076         status.waves(curtime) = 0;
0077     end
0078     %
0079     if isfield(import,'wavestructs') && ~isempty(import.wavestructs),
0080         for iw = 1:length(import.wavestructs),
0081             if isfield(import.wavestructs{iw},'fitequilparam'),
0082                 import.wavestructs{iw}.fitparam = import.wavestructs{iw}.fitequilparam;
0083                 import.wavestructs{iw} = rmfield(import.wavestructs{iw},'fitequilparam');
0084             end
0085             if isfield(import.wavestructs{iw},'raydisplay'),
0086                 import.wavestructs{iw}.C3POdisplay = import.wavestructs{iw}.raydisplay;
0087                 import.wavestructs{iw} = rmfield(import.wavestructs{iw},'raydisplay');
0088             end
0089         end
0090         wavestructss{curtime} = import.wavestructs;
0091         lukeobj.wavestruct.select.value = length(wavestructss{curtime});
0092     end                
0093     if isfield(import,'output') && ~isempty(import.output),
0094         outputs{curtime} = import.output;
0095         status.output(curtime) = 1;
0096         %
0097         action = 'lukedisp';iluke_callbacks;
0098     else
0099         status.output = 0;
0100     end
0101     %
0102     status.data = 1;
0103     lukeobj.simulfile.string = filename;%[pathname,filename];
0104 end

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