From cdf5fe118df28b43764af34327ea7f63a9a72a17 Mon Sep 17 00:00:00 2001
From: Antonia Frank <antonia.frank@epfl.ch>
Date: Tue, 26 Mar 2024 12:24:16 +0100
Subject: [PATCH] Make launcher num labels for both ec_data and ec_inputs

---
 matlab/TCV/gdat_tcv.m | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m
index 8aea44db..db1a668f 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};
-      ec_inputs.pgyro.dimunits = {'launcher #1-9/11, total', 's'};
+      launchers_label = cellfun(@num2str, num2cell(1:size(pgyro,1)-1),'UniformOutput',false);
+      launchers_label{end+1} = 'tot';
+      ec_inputs.pgyro.dimunits = {launchers_label, 's'};
 
       ec_inputs.launchers_active = zeros(numel(pgyro_ecrh),1);
       for ii =1:numel(pgyro_ecrh)
         if ~isempty(pgyro_ecrh{ii}.data); ec_inputs.launchers_active(ii) = 1; end       
       end
       ec_inputs.gyro2launcher.data = gyro2launcher;
-      ec_inputs.gyro2launcher.label = 'gyrotron connected to launcher';
+      ec_inputs.gyro2launcher.label = 'Gyrotron connected to launcher';
       
       ec_inputs.freq2launcher.data = freq2launcher;
       ec_inputs.freq2launcher.label = 'Frequency in launcher';
@@ -1618,11 +1620,9 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
         end
         ec_help = 'from toray icdint with extracting of effective Icd for given launcher depending on nb rays used';
         % All EC related quantities, each substructure should have at least fields data,x,t,units,dim,dimunits,label to be copied onto gdat_data
-        if size(pabs_gyro.data,1)>9
-          launchers_label = {'1','2','3','4','5','6','7','8','9','10','11','tot'};
-        else
-          launchers_label = {'1','2','3','4','5','6','7','8','9','tot'};
-        end
+        
+        launchers_label = cellfun(@num2str, num2cell(1:size(pabs_gyro.data,1)),'UniformOutput',false);
+        launchers_label{end+1} = 'tot';
         launchers_grid = [1:size(pabs_gyro.data,1)+1]';
         
         % power deposition related:
-- 
GitLab