From 802d7bac1aeffe533d1596d36453cd6974018253 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Thu, 26 Sep 2024 08:17:17 +0200
Subject: [PATCH] correct times since each can be different

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

diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m
index e770af0e..e6931714 100644
--- a/matlab/TCV/gdat_tcv.m
+++ b/matlab/TCV/gdat_tcv.m
@@ -1374,8 +1374,8 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
              end
              params_eff.data_request = sprintf('\\atlas::top.system.gas.valve_0%.2d:flow',i);
              gasrequest = gdat_tcv(gdat_data.shot,params_eff); gasrequest.units = 'V';
-             gdat_data_data{i} = gasrequest.data;
-             if ~isempty(gasrequest.t)
+             gdat_data_data{i} = gasrequest;
+             if ~isempty(gasrequest.t) && isempty(gdat_data.t) % copy 1st non-empty
                gdat_data.units = gasrequest.units;
                gdat_data.t = gasrequest.t;
                gdat_data.data_fullpath = gasrequest.data_fullpath;
-- 
GitLab