From 3f99932b6e71d63e88470135a3c8f8ead9caa3b1 Mon Sep 17 00:00:00 2001 From: Antonia Frank <antonia.frank@epfl.ch> Date: Wed, 3 Apr 2024 11:18:39 +0200 Subject: [PATCH] Add check_nodes_filled call to ec_data with toray & cleanup empty outputs --- matlab/TCV/gdat_tcv.m | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m index 00788c9d..741c9726 100644 --- a/matlab/TCV/gdat_tcv.m +++ b/matlab/TCV/gdat_tcv.m @@ -1581,14 +1581,16 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') ec_inputs.pgyro.label = 'Power injected per launcher ; last index is total'; ec_inputs.pgyro.x = 1:numel(pgyro(1,:)); ec_inputs.pgyro.dim = {ec_inputs.pgyro.x, ec_inputs.pgyro.t}; - launchers_label = cellfun(@num2str, num2cell(1:size(pgyro,1)-1),'UniformOutput',false); + launchers_label = cellfun(@num2str, num2cell(1:size(pgyro,2)-1),'UniformOutput',false); launchers_label{end+1} = 'tot'; ec_inputs.pgyro.dimunits = {launchers_label, 's'}; - ec_inputs.launchers_active = zeros(numel(pgyro_ecrh),1); + ec_inputs.launchers_active.data = zeros(numel(pgyro_ecrh),1); for ii =1:numel(pgyro_ecrh) - if ~isempty(pgyro_ecrh{ii}.data); ec_inputs.launchers_active(ii) = 1; end + if ~isempty(pgyro_ecrh{ii}.data); ec_inputs.launchers_active.data(ii) = 1; end end + ec_inputs.launchers_active.label = 'Active launchers in the shot (1:active, 0:inactive)'; + ec_inputs.gyro2launcher.data = gyro2launcher; ec_inputs.gyro2launcher.label = 'Gyrotron connected to launcher'; @@ -1599,7 +1601,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') gdat_data.ec.ec_inputs = ec_inputs; % fill ec_data from TORAY via astra_tcv_exp outputs - if strcmp(lower(source_icd.ec),'toray') + if strcmp(lower(source_icd.ec),'toray') && check_nodes_filled(shot,'toray') if isempty(gdat_data.gdat_params.trialindx) % centralized function for toray nodes [pabs_gyro,icdtot,pow_dens,currentdrive_dens,rho_dep_pow,drho_pow,... @@ -1740,15 +1742,17 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') end else - disp(['source_icd.ec = ' source_icd.ec ' not yet implemented, ask O. Sauter']) + if strcmp(lower(source_icd.ec),'toray') + msg = 'Toray nodes were no filled, check hldsi(shot).'; warning(msg); + gdat_data.ec.help = msg; + else + disp(['source_icd.ec = ' source_icd.ec ' not yet implemented, ask O. Sauter']) + end ec_data.p_abs_plasma = []; - ec_data.p_abs_plasma(end+1,:) = []; ec_data.p_abs_plasma_label = []; ec_data.p_dens = []; - ec_data.p_dens(end+1,:) = []; ec_data.p_dens_label = []; ec_data.p_integrated = []; - ec_data.p_integrated(end+1,:) = []; ec_data.p_integrated_label = []; ec_data.max_pow_dens = []; ec_data.max_pow_dens_label = []; @@ -1758,13 +1762,10 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') ec_data.width_pow_dens_label = []; % current drive deposition related: ec_data.cd_tot = []; - ec_data.cd_tot(end+1,:) = []; ec_data.cd_tot_label = []; ec_data.cd_dens = []; - ec_data.cd_dens(:,end+1,:) = []; ec_data.cd_dens_label = []; ec_data.cd_integrated = []; - ec_data.cd_integrated(:,end+1,:) = []; ec_data.cd_integrated_label = []; ec_data.max_cd_dens = []; ec_data.max_cd_dens_label = []; @@ -1775,13 +1776,12 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') ec_data.cd_dens_doublewidth = []; ec_data.cd_dens_doublewidth_label = []; ec_data.rho_tor_norm = []; - ec_data.t = []; - ec_data.launchers = []; gdat_data.ec.ec_data = ec_data; return end gdat_data.ec.ec_data = ec_data; - if isempty(icdtot.data) || isempty(icdtot.tgrid) || ischar(icdtot.data) + + if isempty(ec_data.cd_tot.data) || isempty(ec_data.cd_tot.tgrid) || ischar(icdtot.data) if (gdat_params.nverbose>=1) warning(['problems loading data for ' source_icd.ec ... ' for data_request= ' data_request_eff]); -- GitLab