From 53a395ba20e1d6e898c5f17e642d21050b5d9fd9 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Fri, 12 Apr 2019 08:01:21 +0000
Subject: [PATCH] add CUZ and COZ

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@11736 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/AUG/gdat_aug.m | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/crpptbx/AUG/gdat_aug.m b/crpptbx/AUG/gdat_aug.m
index 988cfecc..ddc2416c 100644
--- a/crpptbx/AUG/gdat_aug.m
+++ b/crpptbx/AUG/gdat_aug.m
@@ -476,6 +476,14 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
       gdat_data.gdat_params.source = 'CMZ';
       r_node = 'R';
       z_node = 'z';
+    elseif strcmp(upper(gdat_data.gdat_params.source),'CUZ')
+      gdat_data.gdat_params.source = 'CUZ';
+      r_node = 'R_time';
+      z_node = 'z_time';
+    elseif strcmp(upper(gdat_data.gdat_params.source),'COZ')
+      gdat_data.gdat_params.source = 'COZ';
+      r_node = 'R_time';
+      z_node = 'z_time';
     else
       warning(['source = ' gdat_data.gdat_params.source ' not expected with data_request= ' data_request_eff]);
       return
@@ -488,7 +496,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
     % R, Z positions of measurements
     try
       % eval(['[r_time]=sf2ab(diag_name,shot,r_node,''-exp'',exp_name_eff' extra_arg_sf2sig_eff_string ');']);
-      % both for CEZ and CMZ Ti:1 is ok, otherwise introduce string above
+      % both for CEZ and CMZ, and.. Ti:1 is ok, otherwise introduce string above
       [r_time,err]=rdaAUG_eff(shot,diag_name,r_node,exp_name_eff,[],extra_arg_sf2sig_eff_string,'area-base:Ti:1');
     catch ME_R_time
       % assume no shotfile
@@ -579,18 +587,18 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
         psirz_in = equil.psi2D(:,:,itequil);
         it_cxrs_inequil = find(gdat_data.t>time_equil(itequil) & gdat_data.t<=time_equil(itequil+1));
         if ~isempty(it_cxrs_inequil)
-          if strcmp(upper(gdat_data.gdat_params.source),'CEZ')
-            rout=gdat_data.r(iok,it_cxrs_inequil);
-            zout=gdat_data.z(iok,it_cxrs_inequil);
-          else
+          if ~strcmp(upper(gdat_data.gdat_params.source),'CMZ')
             rout=gdat_data.r(iok);
             zout=gdat_data.z(iok);
+          else
+            rout=gdat_data.r(iok,it_cxrs_inequil);
+            zout=gdat_data.z(iok,it_cxrs_inequil);
           end
           psi_at_routzout = interpos2Dcartesian(rr,zz,psirz_in,rout,zout);
-          if strcmp(upper(gdat_data.gdat_params.source),'CEZ')
-            psi_out(iok,it_cxrs_inequil) = reshape(psi_at_routzout,length(iok),length(it_cxrs_inequil));
-          else
+          if ~strcmp(upper(gdat_data.gdat_params.source),'CMZ')
             psi_out(iok,it_cxrs_inequil) = repmat(psi_at_routzout,[1,length(it_cxrs_inequil)]);
+          else
+            psi_out(iok,it_cxrs_inequil) = reshape(psi_at_routzout,length(iok),length(it_cxrs_inequil));
           end
           rhopolnorm_out(iok,it_cxrs_inequil) = sqrt((psi_out(iok,it_cxrs_inequil)-equil.psi_axis(itequil))./(equil.psi_lcfs(itequil)-equil.psi_axis(itequil)));
           for it_cx=1:length(it_cxrs_inequil)
-- 
GitLab