From 105af40beb1a8a8f40ba1ab5a9b404490abc0e36 Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Thu, 27 Aug 2015 08:38:15 +0000 Subject: [PATCH] use nverbose=1 to reduce displays, changed interpos as well git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4926 d63d8f72-b253-0410-a779-e742ad2e26cf --- crpptbx_new/TCV/gdat_tcv.m | 8 +- crpptbx_new/demos/gdat_tutorial.m | 12 ++- crpptbx_new/demos/html/gdat_tutorial.html | 126 +++++++++++++++------- 3 files changed, 102 insertions(+), 44 deletions(-) diff --git a/crpptbx_new/TCV/gdat_tcv.m b/crpptbx_new/TCV/gdat_tcv.m index 56916d66..201b04d8 100644 --- a/crpptbx_new/TCV/gdat_tcv.m +++ b/crpptbx_new/TCV/gdat_tcv.m @@ -506,10 +506,10 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') end gdat_data.gdat_params.zshift = zshift; for itime=1:length(time) - time_eff = time(itime) + time_eff = time(itime); % use read_results updated to effectively obtain an eqdsk with sign correct with COCOS=2 - [fnames_readresults]=read_results_for_chease(shot,time_eff,liuqe_version,3,[],[],[],zshift,0); - eqdskval=read_eqdsk(fnames_readresults{4},7); % LIUQE is 17 but read_results divided psi by 2pi thus 7 + [fnames_readresults]=read_results_for_chease(shot,time_eff,liuqe_version,3,[],[],[],zshift,0,1); + eqdskval=read_eqdsk(fnames_readresults{4},7,0,[],[],1); % LIUQE is 17 but read_results divided psi by 2pi thus 7 for i=1:length(fnames_readresults) unix(['rm ' fnames_readresults{i}]); end @@ -518,7 +518,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') [eqdsk_cocos_in, eqdsk_cocosout_IpB0pos,cocos_inout]=eqdsk_cocos_transform(eqdskval,[7 cocos_in]); fnamefull = fullfile(['/tmp/' getenv('USER')],['EQDSK_' num2str(shot) 't' num2str(time_eff,'%.4f')]); % We still write COCOS=2 case, since closer to standard (in /tmp) - write_eqdsk(fnamefull,eqdsk_cocos_in,cocos_in); + write_eqdsk(fnamefull,eqdsk_cocos_in,cocos_in,[],[],[],1); % Now gdat_tcv should return the convention from LIUQE which is COCOS=17, except if specified in option % create standard filename name from shot, time_eff (cocos will be added by write_eqdsk) cocos_out = 17; diff --git a/crpptbx_new/demos/gdat_tutorial.m b/crpptbx_new/demos/gdat_tutorial.m index 5314ddf1..1a78023e 100644 --- a/crpptbx_new/demos/gdat_tutorial.m +++ b/crpptbx_new/demos/gdat_tutorial.m @@ -8,7 +8,7 @@ % But sub-cases are also valid and explained below % % At this stage, you need to do the following to test it: -addpath ~sauter/matlab/gdat_develop/crpptbx_new +addpath ~sauter/matlab/gdat/crpptbx_new %% getting the list of available predefined data_request names % gdat_data = gdat; @@ -55,7 +55,7 @@ gdat_data % %% Explanation of basic parameters fields of gdat_params gdat_data = gdat(48836,'te'); -gdat_data.gdat_params % at this stage contains few elements, will depend on specific data_request +disp(' ');disp('after "te"');disp(' gdat_data.gdat_params:');disp(gdat_data.gdat_params) % at this stage contains few elements, will depend on specific data_request % % gdat_params should contain all the information necessary to recall gdat % and get the same information, except the shot number, thus @@ -66,4 +66,10 @@ for ishot=1:length(shotlist) gdat_data_te{ishot} = gdat(shotlist(ishot),gdat_data.gdat_params); end gdat_plot(gdat_data_te{3}); - +% +% In some cases we can see the various options after a first call, where +% defaults are set: +gdat_data = gdat(48836,'eqdsk'); +disp(' ');disp('after "eqdsk"');disp(' gdat_data.gdat_params:');disp(gdat_data.gdat_params) +% shows that 'time' should be given (can be an array) and 'zshift' (to shift vertically to zaxis=0 if 'zshift',1 is provided +% \ No newline at end of file diff --git a/crpptbx_new/demos/html/gdat_tutorial.html b/crpptbx_new/demos/html/gdat_tutorial.html index 719f952a..dfdd8d7f 100644 --- a/crpptbx_new/demos/html/gdat_tutorial.html +++ b/crpptbx_new/demos/html/gdat_tutorial.html @@ -6,7 +6,7 @@ <!-- This HTML was auto-generated from MATLAB code. To make changes, update the MATLAB code and republish this document. - --><title>gdat_tutorial</title><meta name="generator" content="MATLAB 8.3"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2015-08-21"><meta name="DC.source" content="gdat_tutorial.m"><style type="text/css"> + --><title>gdat_tutorial</title><meta name="generator" content="MATLAB 8.3"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2015-08-27"><meta name="DC.source" content="gdat_tutorial.m"><style type="text/css"> html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0} html { min-height:100%; margin-bottom:1px; } @@ -66,7 +66,7 @@ table td { padding:7px 5px; text-align:left; vertical-align:top; border:1px soli - </style></head><body><div class="content"><h2>Contents</h2><div><ul><li><a href="#1">gdat tutorial: some basic calls and functionalities</a></li><li><a href="#2">getting the list of available predefined data_request names</a></li><li><a href="#3">list of data_request names for a specific machine</a></li><li><a href="#4">a simple example: get plasma current</a></li><li><a href="#5">a 2D example with Te profiles</a></li><li><a href="#6">Explaination of main fields</a></li><li><a href="#7">Explanation of basic parameters fields of gdat_params</a></li></ul></div><h2>gdat tutorial: some basic calls and functionalities<a name="1"></a></h2><p>gdat calls in fact the main function MACHINE/gdat_machine.m within the gdat folder gdat can be call with one of the available "data_request" keyword or with a full trace_name</p><p>The basic call is: data_out_struct = gdat(shot,data_request,'option1',option1_val,...);</p><p>But sub-cases are also valid and explained below</p><p>At this stage, you need to do the following to test it:</p><pre class="codeinput">addpath <span class="string">~sauter/matlab/gdat_develop/crpptbx_new</span> + </style></head><body><div class="content"><h2>Contents</h2><div><ul><li><a href="#1">gdat tutorial: some basic calls and functionalities</a></li><li><a href="#2">getting the list of available predefined data_request names</a></li><li><a href="#3">list of data_request names for a specific machine</a></li><li><a href="#4">a simple example: get plasma current</a></li><li><a href="#5">a 2D example with Te profiles</a></li><li><a href="#6">Explaination of main fields</a></li><li><a href="#7">Explanation of basic parameters fields of gdat_params</a></li></ul></div><h2>gdat tutorial: some basic calls and functionalities<a name="1"></a></h2><p>gdat calls in fact the main function MACHINE/gdat_machine.m within the gdat folder gdat can be call with one of the available "data_request" keyword or with a full trace_name</p><p>The basic call is: data_out_struct = gdat(shot,data_request,'option1',option1_val,...);</p><p>But sub-cases are also valid and explained below</p><p>At this stage, you need to do the following to test it:</p><pre class="codeinput">addpath <span class="string">~sauter/matlab/gdat/crpptbx_new</span> </pre><h2>getting the list of available predefined data_request names<a name="2"></a></h2><pre class="codeinput">gdat_data = gdat; <span class="comment">%</span> <span class="comment">% This is the simplest call and returns 3 useful information:</span> @@ -79,12 +79,14 @@ gdat_data.gdat_call <span class="comment">% always contains the string so that t </pre><pre class="codeoutput"> ans = + 'a_minor' 'b0' + 'beta' 'betan' 'betap' 'cxrs' 'delta' - 'delta_bot' + 'delta_bottom' 'delta_top' 'ece' 'eqdsk' @@ -96,24 +98,27 @@ ans = 'ne' 'neint' 'nel' - 'nerho' - 'neterho' + 'ne_rho' + 'nete_rho' 'ni' 'powers' 'q0' 'q95' 'qedge' - 'qrho' + 'q_rho' 'rgeom' + 'rhotor_edge' + 'rhotor' 'rhovol' 'rmag' 'sxr' 'te' - 'terho' + 'te_rho' 'ti' 'transp' 'vloop' - 'vol' + 'volume' + 'volume_rho' 'zeff' 'zgeom' 'zmag' @@ -124,6 +129,7 @@ ans = data_request: '' machine: 'tcv' doplot: 0 + liuqe: 1 ans = @@ -140,12 +146,14 @@ gdat_data.gdat_request </pre><pre class="codeoutput"> ans = + 'a_minor' 'b0' + 'beta' 'betan' 'betap' 'cxrs' 'delta' - 'delta_bot' + 'delta_bottom' 'delta_top' 'ece' 'eqdsk' @@ -157,24 +165,27 @@ ans = 'ne' 'neint' 'nel' - 'nerho' - 'neterho' + 'ne_rho' + 'nete_rho' 'ni' 'powers' 'q0' 'q95' 'qedge' - 'qrho' + 'q_rho' 'rgeom' + 'rhotor_edge' + 'rhotor' 'rhovol' 'rmag' 'sxr' 'te' - 'terho' + 'te_rho' 'ti' 'transp' 'vloop' - 'vol' + 'volume' + 'volume_rho' 'zeff' 'zgeom' 'zmag' @@ -215,23 +226,24 @@ gdat_data </pre><pre class="codeoutput"> gdat_data = - data: [23x49 double] - units: 'eV' - dim: {2x1 cell} - dimunits: {2x1 cell} - t: [49x1 double] - x: [23x1 double] - shot: 48836 - gdat_request: 'te' - gdat_params: [1x1 struct] - data_fullpath: '\results::thomson:te' - label: 'Te' - error_bar: [23x49 double] - mapping_for_tcv: [1x1 struct] - gdat_call: 'gdat(48836,'te'); % nargout = 1' + data: [23x49 double] + units: 'eV' + dim: {2x1 cell} + dimunits: {2x1 cell} + t: [49x1 double] + x: [23x1 double] + shot: 48836 + gdat_request: 'te' + gdat_params: [1x1 struct] + data_fullpath: '\results::thomson:te' + request_description: 'Electron temperature' + label: 'Te' + error_bar: [23x49 double] + mapping_for: [1x1 struct] + gdat_call: 'gdat(48836,'te'); % nargout = 1' </pre><h2>Explanation of basic parameters fields of gdat_params<a name="7"></a></h2><pre class="codeinput">gdat_data = gdat(48836,<span class="string">'te'</span>); -gdat_data.gdat_params <span class="comment">% at this stage contains few elements, will depend on specific data_request</span> +disp(<span class="string">' '</span>);disp(<span class="string">'after "te"'</span>);disp(<span class="string">' gdat_data.gdat_params:'</span>);disp(gdat_data.gdat_params) <span class="comment">% at this stage contains few elements, will depend on specific data_request</span> <span class="comment">%</span> <span class="comment">% gdat_params should contain all the information necessary to recall gdat</span> <span class="comment">% and get the same information, except the shot number, thus</span> @@ -242,14 +254,49 @@ shotlist=[48836, 48837, 48839]; gdat_data_te{ishot} = gdat(shotlist(ishot),gdat_data.gdat_params); <span class="keyword">end</span> gdat_plot(gdat_data_te{3}); -</pre><pre class="codeoutput"> -ans = - +<span class="comment">%</span> +<span class="comment">% In some cases we can see the various options after a first call, where</span> +<span class="comment">% defaults are set:</span> +gdat_data = gdat(48836,<span class="string">'eqdsk'</span>); +disp(<span class="string">' '</span>);disp(<span class="string">'after "eqdsk"'</span>);disp(<span class="string">' gdat_data.gdat_params:'</span>);disp(gdat_data.gdat_params) +<span class="comment">% shows that 'time' should be given (can be an array) and 'zshift' (to shift vertically to zaxis=0 if 'zshift',1 is provided</span> +<span class="comment">%</span> +</pre><pre class="codeoutput"> +after "te" + gdat_data.gdat_params: data_request: 'te' machine: 'tcv' doplot: 0 + liuqe: 1 + +"time" is expected as an option, choose default time = 1 + +time_eff = + + 1 + + read_results_for_chease for shot with LIUQE values for shot = 48836 +wrote /tmp/sauter/EXPEQ_48836t1.0000 +wrote /tmp/sauter/EXPEQ_PP48836t1.0000 +wrote /tmp/sauter/eqdsk.48836t1.0000 +wrote /tmp/sauter/eqdsksigns.48836t1.0000 +wrote /tmp/sauter/EXPEQsigns_48836t1.0000 +do not calculate BR, BZ, Bphi, etc +Wrote /tmp/sauter/EQDSK_48836t1.0000_COCOS02 +Wrote /tmp/sauter/EQDSK_48836t1.0000_COCOS02_IpB0positive +Wrote /tmp/sauter/EQDSK_48836t1.0000_COCOS17 +Wrote /tmp/sauter/EQDSK_48836t1.0000_COCOS17_IpB0positive + +after "eqdsk" + gdat_data.gdat_params: + data_request: 'eqdsk' + machine: 'tcv' + doplot: 0 + liuqe: 1 + time: 1 + zshift: 0 -</pre><img vspace="5" hspace="5" src="gdat_tutorial_03.png" alt=""> <p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB® R2014a</a><br></p></div><!-- +</pre><p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB® R2014a</a><br></p></div><!-- ##### SOURCE BEGIN ##### %% gdat tutorial: some basic calls and functionalities % gdat calls in fact the main function MACHINE/gdat_machine.m within the gdat folder @@ -261,7 +308,7 @@ ans = % But sub-cases are also valid and explained below % % At this stage, you need to do the following to test it: -addpath ~sauter/matlab/gdat_develop/crpptbx_new +addpath ~sauter/matlab/gdat/crpptbx_new %% getting the list of available predefined data_request names % gdat_data = gdat; @@ -308,7 +355,7 @@ gdat_data % %% Explanation of basic parameters fields of gdat_params gdat_data = gdat(48836,'te'); -gdat_data.gdat_params % at this stage contains few elements, will depend on specific data_request +disp(' ');disp('after "te"');disp(' gdat_data.gdat_params:');disp(gdat_data.gdat_params) % at this stage contains few elements, will depend on specific data_request % % gdat_params should contain all the information necessary to recall gdat % and get the same information, except the shot number, thus @@ -319,7 +366,12 @@ for ishot=1:length(shotlist) gdat_data_te{ishot} = gdat(shotlist(ishot),gdat_data.gdat_params); end gdat_plot(gdat_data_te{3}); - - +% +% In some cases we can see the various options after a first call, where +% defaults are set: +gdat_data = gdat(48836,'eqdsk'); +disp(' ');disp('after "eqdsk"');disp(' gdat_data.gdat_params:');disp(gdat_data.gdat_params) +% shows that 'time' should be given (can be an array) and 'zshift' (to shift vertically to zaxis=0 if 'zshift',1 is provided +% ##### SOURCE END ##### --></body></html> \ No newline at end of file -- GitLab