load_externaldata_ITM

PURPOSE ^

SYNOPSIS ^

function external = load_externaldata_ITM(workdir,shotnum,runnum,shotime,time_interp,opt_gui,select)

DESCRIPTION ^

 This function loads data from ITM MDS+ database (one time slice)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function external = load_externaldata_ITM(workdir,shotnum,runnum,shotime,time_interp,opt_gui,select)
0002 %
0003 % This function loads data from ITM MDS+ database (one time slice)
0004 %
0005 if nargin < 7,
0006     select = struct;
0007 elseif ~isstruct(select) && isempty(select),% no user prompt - default options
0008     %
0009 end
0010 %
0011 external = '';
0012 basestr = 'ITM';
0013 %
0014 if ~isfield(select,'m_opt'),
0015     select.m_opt = input_dke_yp('Do you want to: (0) load data from database, (1) load data from files',0,[0,1],'',[1,1]);
0016 end
0017 %
0018 data_path = [workdir,'/'];
0019 %
0020 data_str = ['data_',basestr,'_',shotnum,'_',num2str(t1),'_',num2str(t2)];
0021 %
0022 if select.m_opt == 0,
0023     %
0024     data_path = [workdir,'/'];
0025     %data_file = [data_str,launstr,'.mat'];
0026     %
0027     [machine,username,ver] = which_MDSdatabase;%test if the ITM database is correct
0028     %
0029     external.mdsdatabase.machine = machine;
0030     external.mdsdatabase.username = username;
0031     external.mdsdatabase.ver = ver;
0032     %
0033     if  ~isempty(machine) && ~isempty(user) && ~isempty(ver)
0034         %
0035 %        info_dke_yp(4,['ITM database well connected -> machine: ',machine,', user: ',user,', datastructure version: ',ver]);
0036         %
0037         [external.equil.status,external.equil.equil_euitm,external.equil.coreprof_euitm] = read_equil_ITM(numshot,numrun_in,timeslice_equil,time_interp,{'equilibrium','coreprof'},display_mode,save_mode);%Create magnetic equilibrium structure
0038         %
0039     else
0040         external.equil = [];
0041     end
0042     %
0043     
0044     
0045     
0046     
0047     
0048     %
0049 else
0050 
0051 end
0052 %
0053 % return structure
0054 %
0055 external.id = ['ITM_',shotnum,'_',runnum,'_',shotime,'_',time_interp];
0056 %
0057 if select.m_opt == 0,
0058     %
0059     if ~isfield(select,'s_opt'),
0060         select.s_opt = input_dke_yp('Do you want to generate an equivalent make_external_ITM script? [y/n]','n',{'y','n'},'',[1,1]);
0061     end
0062     %
0063     if select.s_opt == 'y',
0064         %
0065         %imake_makeexternal_ITM_jd(workdir,external,opt_gui);
0066         %
0067     end
0068 end    
0069 %
0070 if isnan_jd(external,0),
0071     disp('Warning : NaNs were found in the structure ''external'' : ')
0072     isnan_jd(external,1),
0073 end
0074 %
0075 
0076

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