From 30a15f65a279fbe88ff4fe929a75448ab32ba6f5 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Fri, 1 Mar 2002 16:47:02 +0000
Subject: [PATCH] empty data if not OK, and add TION/P in geteqdsk

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@1862 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 JET/geteqdskJET.m |  1 +
 JET/loadJETdata.m |  8 ++++----
 JET/rda_eff.m     | 11 +++++++++++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/JET/geteqdskJET.m b/JET/geteqdskJET.m
index fa5398aa..33244a10 100644
--- a/JET/geteqdskJET.m
+++ b/JET/geteqdskJET.m
@@ -118,6 +118,7 @@ if iread==1
   efitdata.sspi=gdat(shot,['ppf/' efitlab '/sspi' s_extra{iexefit}],0,'JET');
   % add for profiles
   efitdata.ti=gdat(shot,['ppf/TION/TI' s_extra{iexchain2}],0,'JET');
+  efitdata.p_tion=gdat(shot,['ppf/TION/p' s_extra{iexchain2}],0,'JET');
   efitdata.pi=gdat(shot,['ppf/NION/DD' s_extra{iexchain2}],0,'JET');
   efitdata.zef=gdat(shot,['ppf/NION/ZEF' s_extra{iexchain2}],0,'JET');
   % add for calculating NTM parameters
diff --git a/JET/loadJETdata.m b/JET/loadJETdata.m
index 4fa043bd..354b10d9 100644
--- a/JET/loadJETdata.m
+++ b/JET/loadJETdata.m
@@ -298,8 +298,8 @@ switch JETkeywrdcase{index}
     [a,x,t,d,e]=rda_eff(shot,ppftype,tracename);
     switch tracename
       case {'efit/btpd','efit/btpd?uid=jetppf+seq=0'}
-        if isstr(t);
-          disp('t is a string, assumes means btpd not defined');
+        if isempty(a) | isempty(t);
+          disp('data or t empty, assumes means btpd not defined');
           [xip,x,t,d,e]=rda_eff(shot,'ppf','efit/xip');
           shot_mg3_list=[47274 47275 47276 47280 47281 47282 47283 47284 47285 47286 47287 47290 47295 47296 47301];
           if isempty(find(shot_mg3_list==shot))
@@ -312,8 +312,8 @@ switch JETkeywrdcase{index}
           a=2.122e6 .* wdia ./xip.^2 ./ rgeo;
         end
       case {'efit/btnd','efit/btnd?uid=jetppf+seq=0'}
-        if isstr(t);
-          disp('t is a string, assumes means btnd not defined');
+        if isempty(a) | isempty(t);
+          disp('data or t empty, assumes means btnd not defined');
           [xip,x,t,d,e]=rda_eff(shot,'ppf','efit/xip');
           shot_mg3_list=[47274 47275 47276 47280 47281 47282 47283 47284 47285 47286 47287 47290 47295 47296 47301];
           if isempty(find(shot_mg3_list==shot))
diff --git a/JET/rda_eff.m b/JET/rda_eff.m
index ec67e55f..bbb3fa16 100644
--- a/JET/rda_eff.m
+++ b/JET/rda_eff.m
@@ -142,3 +142,14 @@ else
     data=a';
   end
 end
+
+% to prevent problems when trace empty and time become string
+if ischar(time)
+  time=[];
+end
+if ischar(x)
+  x=[];
+end
+if isempty(x) & ~isempty(data) & data==0
+  data=[];
+end
-- 
GitLab