From f480ab7e67c9c49dab79fb07032aa985c12d4f0c Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Tue, 11 Jul 2017 14:11:51 +0000
Subject: [PATCH] add area_edge

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@7871 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/TCV/gdat_tcv.m             |  6 ++++--
 crpptbx/TCV/tcv_requests_mapping.m | 13 +++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/crpptbx/TCV/gdat_tcv.m b/crpptbx/TCV/gdat_tcv.m
index 4e812e38..3c91924b 100644
--- a/crpptbx/TCV/gdat_tcv.m
+++ b/crpptbx/TCV/gdat_tcv.m
@@ -615,13 +615,15 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
         gdat_data.x = gdat_data.dim{1};
         gdat_data.data_fullpath=[nodenameeff ' and ' nodenameeff2];
       else
-        gdat_data.data = aatmp.data;
-        gdat_data.dim = aatmp.dim(end); % while there is a problem with \tcv_shot::top.results.equil... dim nodes
+        gdat_data.data = aatmp.data(end,:)';
+        gdat_data.dim = aatmp.dim(2); 
+        aatmp.dimunits = aatmp.dimunits(2); 
         gdat_data.data_fullpath=[nodenameeff];
       end
       gdat_data.t = gdat_data.dim{mapping_for_tcv.timedim};
       gdat_data.units = aatmp.units(end);
       gdat_data.dimunits = aatmp.dimunits;
+keyboard
     end
     
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/crpptbx/TCV/tcv_requests_mapping.m b/crpptbx/TCV/tcv_requests_mapping.m
index ae6fcc1f..b16c9dc7 100644
--- a/crpptbx/TCV/tcv_requests_mapping.m
+++ b/crpptbx/TCV/tcv_requests_mapping.m
@@ -48,6 +48,11 @@ switch lower(data_request)
   mapping.label = 'area';
   mapping.method = 'tdiliuqe';
   mapping.expression = 'tcv_eq(''''area'''',''''LIUQE.M'''')';
+ case 'area_edge'
+  mapping.timedim = 1;
+  mapping.label = 'area\_lcfs';
+  mapping.method = 'tdiliuqe';
+  mapping.expression = 'tcv_eq(''''area_edge'''',''''LIUQE.M'''')';
  case 'b0'
   mapping.timedim = 1;
   mapping.label = 'B_0';
@@ -276,6 +281,10 @@ switch lower(data_request)
   mapping.expression = '\results::r_contour';
   mapping.expression = '\tcv_shot::top.results.equil_1.results:r_surf'; % LCFS R coordinates (r,t)
   mapping.expression = 'tcv_eq(''''r_edge'''',''''LIUQE.M'''')';
+% $$$   mapping.method = 'expression';
+% $$$   mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=''tcv_eq(''''''''r_edge'''''''',''''''''LIUQE.M'''''''')''; ' ...
+% $$$                     'gdat_tmp=gdat_tcv(shot,params_eff);gdat_tmp.data=gdat_tmp.data(:,:,end);' ...
+% $$$                     'gdat_tmp.dim=gdat_tmp.dim(1:2);gdat_tmp.dimunits=gdat_tmp.dimunits(1:2);'];
  case {'rgeom', 'r_geom'}
   mapping.timedim = 1;
   mapping.label = 'Rgeom';
@@ -369,6 +378,10 @@ switch lower(data_request)
   mapping.expression = '\results::z_contour';
   mapping.expression = '\tcv_shot::top.results.equil_1.results:z_surf'; % LCFS Z coordinates (r,t)
   mapping.expression = 'tcv_eq(''''z_edge'''',''''LIUQE.M'''')';
+% $$$   mapping.method = 'expression';
+% $$$   mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=''tcv_eq(''''''''z_edge'''''''',''''''''LIUQE.M'''''''')''; ' ...
+% $$$                     'gdat_tmp=gdat_tcv(shot,params_eff);gdat_tmp.data=gdat_tmp.data(:,:,end);' ...
+% $$$                     'gdat_tmp.dim=gdat_tmp.dim(1:2);gdat_tmp.dimunits=gdat_tmp.dimunits(1:2);'];
  case 'zeff'
   mapping.timedim = 1;
   mapping.label = 'zeff from Ip-Ibs';
-- 
GitLab