diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m index 970032a52303c1f229b8d756cf4d33460b31728d..dbf30a0ba97eaeee6b377fc57b81a69a4523c165 100644 --- a/matlab/TCV/gdat_tcv.m +++ b/matlab/TCV/gdat_tcv.m @@ -2356,7 +2356,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') case {'powers'} % note: same time array for all main, ec, ohm, nbi, ... % At this stage fill just ech, later add nbi - sources_avail = {'ohm','ec','nbi1','nbi2','rad'}; % note should allow ech, nbh, ohmic in parameter sources + sources_avail = {'ohm','ec','nbi1','nbi2','dnbi','rad'}; % note should allow ech, nbh, ohmic in parameter sources % create empty structures for all, so in return one always have same substructres for i=1:length(sources_avail) gdat_data.(sources_avail{i}).data = []; @@ -2542,6 +2542,34 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') gdat_data.label{end+1}=gdat_data.nbi.label; end end + if any(strmatch('dnbi',gdat_data.gdat_params.source)) + % NB2 + nodenameeff = '\RESULTS::DNBI:POWR_TCV'; + nb2_data_tdi = tdi(nodenameeff); + if ~isempty(nb2_data_tdi.data) && ~ischar(nb2_data_tdi.data) && ~isempty(nb2_data_tdi.dim) + nbi_neutral_power_tot = nb2_data_tdi.data.*1e6; % in W + ij = nbi_neutral_power_tot<100; + nbi_neutral_power_tot(ij) = 0.; + gdat_data.nbi.data = nbi_neutral_power_tot; % at this stage p_gyro is in kW' + gdat_data.nbi.units = 'W'; + gdat_data.nbi.dim{1}=nb2_data_tdi.dim{1}; + gdat_data.nbi.dimunits{1}=nb2_data_tdi.dimunits{1}; + gdat_data.nbi.t=gdat_data.nbi.dim{1}; + gdat_data.nbi.x=[]; + gdat_data.nbi.data_fullpath=[nodenameeff]; + gdat_data.nbi.label='P_{dnbi}'; + gdat_data.nbi.help = nb2_data_tdi.help; + nodenameeff2 = '\RESULTS::DNBI:ENERGY'; + gdat_data.nbi.data_fullpath=[nodenameeff ' *1e6 for W; and ' nodenameeff2 ' *1e3 for eV']; + nbh_energy_data_tdi = tdi(nodenameeff2); + gdat_data.nbi.energy = nbh_energy_data_tdi.data*1e3; % for eV + % add to main with linear interpolation and 0 for extrapolated values + ij=[isfinite(gdat_data.nbi.data)]; + gdat_data.data(:,end+1) = interpos(-21,gdat_data.nbi.t(ij),gdat_data.nbi.data(ij),gdat_data.t); + gdat_data.x(end+1) = size(gdat_data.data,2); + gdat_data.label{end+1}=gdat_data.nbi.label; + end + end % add all to last index of .data(:,i) ij = setdiff([1:size(gdat_data.data,2)],index_rad); gdat_data.data(:,end+1) = sum(gdat_data.data(:,ij),2);