From 11e6eb0c61661b55135ad8219f8100330a8c4974 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Tue, 8 Apr 2014 15:50:51 +0000
Subject: [PATCH] add polariser angles and other stuff

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4388 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/AUG/loadAUGdata.m | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/crpptbx/AUG/loadAUGdata.m b/crpptbx/AUG/loadAUGdata.m
index fef2947c..4749692c 100644
--- a/crpptbx/AUG/loadAUGdata.m
+++ b/crpptbx/AUG/loadAUGdata.m
@@ -91,8 +91,25 @@ shotfile_exp = 'AUGD';
 
 % To allow multiple ways of writing a specific keyword, use data_type_eff within this routine
 data_type_eff=data_type;
-if size(data_type_eff,1)==1
-  i=findstr('/',data_type);
+if size(data_type,1)==1
+  % there might be "/" in the name, add backslash to protect it, thus remove in the name afterwards:
+  inotok=findstr('\/',data_type);
+  iok=regexp(data_type,'[^\\]/');
+  iok=iok+1;
+  if ~isempty(inotok)
+    % remove \/ and construct index of real separators "/"
+    for ij=1:length(inotok)
+      ijk=find(iok>inotok(ij));
+      if ~isempty(ijk)
+	iok(ijk) = iok(ijk) - 1;
+      end
+    end
+  end
+  inobackslash=regexp(data_type,'[^\\]');
+  data_type=data_type(inobackslash);
+  index_slash = iok;
+  % i=findstr('/',data_type);
+  i = index_slash;
   if length(i)==1
     % assumes given a la 'MAG/Ipi'
     data_type_eff=[{data_type(1:i(1)-1)} ; {data_type(i(1)+1:end)}];
@@ -377,6 +394,7 @@ else
 end
 disp(['case ' AUGkeywrdcase{index}])
 disp(' ')
+
 switch AUGkeywrdcase{index}
 
   %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
@@ -983,6 +1001,16 @@ switch AUGkeywrdcase{index}
       else
 	trace_all.gtor_ecn(i+4) = a;
       end
+      [a,e]=rdaAUG_eff(shot,'ECN',['G' num2str(i) 'PO4'],shotfile_exp_eff);
+      if isempty(a) || e~=0
+      else
+	trace_all.gpo4_ecn(i+4) = a;
+      end
+      [a,e]=rdaAUG_eff(shot,'ECN',['G' num2str(i) 'PO8'],shotfile_exp_eff);
+      if isempty(a) || e~=0
+      else
+	trace_all.gpo8_ecn(i+4) = a;
+      end
     end
     if ~isempty(trace_all)
       trace_all.dim=[{trace_all.t} {[1:9]}];
-- 
GitLab