From 6d4c1c0c9d024d61c9bf40015efcb9c54f5ed059 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <Olivier.Sauter@epfl.ch>
Date: Mon, 9 Aug 2021 09:46:17 +0200
Subject: [PATCH] minor fixes

---
 matlab/TCV/gdat_tcv.m     | 12 +++++++++---
 matlab/TCV_IMAS/tcv2ids.m |  4 ++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m
index 4bff44dd..d721f86c 100644
--- a/matlab/TCV/gdat_tcv.m
+++ b/matlab/TCV/gdat_tcv.m
@@ -966,7 +966,9 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
     gdat_data.gdat_params.source = source;
     if isfield(params_eff,'cxrs_time_interval') && ~isempty(params_eff.cxrs_time_interval) && length(params_eff.cxrs_time_interval)>=2
       cxrs_time_interval = params_eff.cxrs_time_interval;
-      cxrs_plot=1;
+      if ~isfield(params_eff,'cxrs_plot')
+        cxrs_plot=1;
+      end
     else
       cxrs_time_interval = [];
     end
@@ -3562,8 +3564,12 @@ gdat_data.x = gdat_data.dim{1};
 gdat_data.t = time;
 gdat_data.system=vertcat(data_tmp.system);
 if status_any,gdat_data.units = data_tmp(isys_ref).units;end
-r_thomson = arrayfun(@(x) x.r_thomson, data_tmp, 'UniformOutput', false);
-gdat_data.r_thomson = vertcat(r_thomson{:});
+if isfield(data_tmp,'r_thomson')
+  r_thomson = arrayfun(@(x) x.r_thomson, data_tmp, 'UniformOutput', false);
+  gdat_data.r_thomson = vertcat(r_thomson{:});
+else
+  gdat_data.r_thomson = [];
+end
 
 % add fir if ne requested
 if strcmp(data_request_eff(1:2),'ne')
diff --git a/matlab/TCV_IMAS/tcv2ids.m b/matlab/TCV_IMAS/tcv2ids.m
index 5e5f717d..312cb4bc 100644
--- a/matlab/TCV_IMAS/tcv2ids.m
+++ b/matlab/TCV_IMAS/tcv2ids.m
@@ -1,6 +1,6 @@
 function [ids_from_tcv,varargout] = tcv2ids(shot,varargin);
 %
-%   [ids_from_tcv,varargout] = tcv2ids(shot,varargin);
+%   [ids_from_tcv,ids_aos] = tcv2ids(shot,varargin);
 %
 % Assumes you have done:
 % >> addpath ~g2osaute/public/matlab9_11_2016 (on the gateway)
@@ -131,4 +131,4 @@ if nargout>=2
     varargout{1} = [];
     disp('problems to fill in varargout')
   end
-end
\ No newline at end of file
+end
-- 
GitLab