diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m index ea03b834bd5a143a663b8f2760fafcfc74702265..c71ca08e4ad91653c79c06c2da6c48a37770e678 100644 --- a/matlab/TCV/gdat_tcv.m +++ b/matlab/TCV/gdat_tcv.m @@ -2463,48 +2463,30 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') end % if any(strmatch('nb',gdat_data.gdat_params.source)) - NBH_in_TCV = 0; - if shot >= 51641 - % NBI - moderemote = mdsdata('data(\VSYSTEM::TCV_NBHDB_B["NBI:MODEREMOTE_FB"])'); - lcs_mode = mdsdata('data(\VSYSTEM::TCV_NBHDB_I["NBI:LCS_MODE"])'); - % NBH in TCV equiv moderemote='ON' AND lcs_mode = 9 - NBH_in_TCV = strcmpi(strtrim(moderemote),'ON') && lcs_mode == 9; - else - % Nodes used in previous block only exist outside of Vista for shots after 51641 - if any(shot == [51458 51459 51460 51461 51463 51465 51470 51472 ... % 29.JAN.2016 - 51628 51629 51631 51632 51633 ... % 09.FEB.2016 - 51639 51640 ... 51641 % 10.FEB.2016 - ]) - NBH_in_TCV = 1; - end - end - if NBH_in_TCV - nodenameeff = '\results::NBH:POWR_TCV'; - nbh_data_tdi = tdi(nodenameeff); - if ~isempty(nbh_data_tdi.data) && ~ischar(nbh_data_tdi.data) && ~isempty(nbh_data_tdi.dim) - nbi_neutral_power_tot = nbh_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}=nbh_data_tdi.dim{1}; - gdat_data.nbi.dimunits{1}=nbh_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_{nbi}'; - gdat_data.nbi.help = nbh_data_tdi.help; - nodenameeff2 = '\results::nbh: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 + nodenameeff = '\results::NBH:POWR_TCV'; + nbh_data_tdi = tdi(nodenameeff); + if ~isempty(nbh_data_tdi.data) && ~ischar(nbh_data_tdi.data) && ~isempty(nbh_data_tdi.dim) + nbi_neutral_power_tot = nbh_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}=nbh_data_tdi.dim{1}; + gdat_data.nbi.dimunits{1}=nbh_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_{nbi}'; + gdat_data.nbi.help = nbh_data_tdi.help; + nodenameeff2 = '\results::nbh: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 % @@ -2531,7 +2513,6 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') gdat_data.label{end+1}=gdat_data.rad.label; end end - % if any(strmatch('nb2',gdat_data.gdat_params.source)) % NB2