0001 function [flag] = write_waves_ITM(remote_mode,numshot,numrun,LUKE_waves,iter,occurrence)
0002
0003
0004
0005
0006
0007
0008 if nargin < 4,error('Not enough input arguments in write_waves_ITM.m');end
0009
0010 if nargin == 4,
0011 iter = 1;
0012 occurrence = 0;
0013 end
0014
0015 if nargin == 5,
0016 occurrence = 0;
0017 end
0018
0019 if remote_mode,
0020 import_ual;
0021 end
0022
0023 CPO = 'waves';
0024
0025 expIdx = euitm_create('euitm',numshot,numrun);
0026 euitm_close(expIdx,'euitm',numshot,numrun);
0027
0028 expIdx = euitm_open('euitm',numshot,numrun);
0029
0030 nslices = length(LUKE_waves);
0031
0032 try
0033 if nslices > 1,
0034
0035 ITM_waves = CPO_gen(CPO,length(LUKE_waves));
0036
0037 ITM_waves = LUKE_waves;
0038
0039 euitm_put(expIdx,CPO,ITM_waves);
0040
0041 else
0042 expIdx = euitm_open('euitm',numshot,numrun);
0043
0044 ITM_waves = CPO_gen(CPO,1);
0045
0046 ITM_waves = LUKE_waves;
0047
0048 if ~isempty(occurrence),
0049 if occurrence ~= 0,
0050 CPO = [CPO,'/',num2str(occurrence)];
0051 end
0052 end
0053
0054 if iter == 1,
0055 euitm_put_non_timed(expIdx,CPO,ITM_waves);
0056 euitm_put_slice(expIdx,CPO,ITM_waves);
0057 else
0058 euitm_put_slice(expIdx,CPO,ITM_waves);
0059 end
0060
0061 end
0062
0063 flag = 'Data structures for ''waves'' CPO successfully writen from the ITM-MDS+ database';
0064
0065 catch
0066 flag = 'Problem while writing into the ITM-MDS+ database';
0067 end
0068
0069 euitm_close(expIdx,'euitm',numshot,numrun);
0070