From 777d59cce0a453d6f7a7f2f23b854084b9668213 Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Fri, 21 Mar 2014 12:49:19 +0000 Subject: [PATCH] add get rho values for CEZ in addition to vrot and Ti on AUG git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4340 d63d8f72-b253-0410-a779-e742ad2e26cf --- crpptbx/AUG/geteqdskAUG.m | 2 +- crpptbx/AUG/loadAUGdata.m | 108 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 105 insertions(+), 5 deletions(-) diff --git a/crpptbx/AUG/geteqdskAUG.m b/crpptbx/AUG/geteqdskAUG.m index 87b8f41a..c9b6eefc 100644 --- a/crpptbx/AUG/geteqdskAUG.m +++ b/crpptbx/AUG/geteqdskAUG.m @@ -31,7 +31,7 @@ equil=gdat(shot,'equil'); equil_all_t = equil; equil_t_index = it; -eqdsk.cocos=13; +eqdsk.cocos=17; eqdsk.nr = size(equil.Rmesh,1); eqdsk.nz = size(equil.Zmesh,1); eqdsk.rmesh = equil.Rmesh(:,it); diff --git a/crpptbx/AUG/loadAUGdata.m b/crpptbx/AUG/loadAUGdata.m index 90e6df14..74063e74 100644 --- a/crpptbx/AUG/loadAUGdata.m +++ b/crpptbx/AUG/loadAUGdata.m @@ -79,10 +79,10 @@ i_ext=length(data_type_eff)+1; name_ext=''; if size(data_type_eff,1)==1 data_type_eff_noext=data_type_eff(1:i_ext-1); - if ~isempty(strmatch(data_type_eff_noext,[{'ip'} {'i_p'} {'xip'}],'exact')) + if ~isempty(strmatch(data_type_eff_noext,[{'ip'} {'i_p'} {'IP'} {'iP'} {'xip'}],'exact')) data_type_eff_noext='Ip'; end - if ~isempty(strmatch(data_type_eff_noext,[{'b0'} {'B0'}],'exact')) + if ~isempty(strmatch(data_type_eff_noext,[{'B0'}],'exact')) data_type_eff_noext='b0'; end if ~isempty(strmatch(data_type_eff_noext,[{'Te'} {'t_e'} {'TE'} {'T_e'}],'exact')) @@ -94,6 +94,12 @@ if size(data_type_eff,1)==1 if ~isempty(strmatch(data_type_eff_noext,[{'Terho'}],'exact')) data_type_eff_noext='terho'; end + if ~isempty(strmatch(lower(data_type_eff_noext),[{'cxrs'} {'vrot'} {'ti'}],'exact')) + data_type_eff_noext='cxrs'; % load full CEZ structure + end + if ~isempty(strmatch(lower(data_type_eff_noext),[{'cxrs_rhos'} {'cxrsrho'} {'cxrsrhos'}],'exact')) + data_type_eff_noext='cxrs_rhos'; % load full CEZ structure + end if ~isempty(strmatch(data_type_eff_noext,[{'SXR'}],'exact')) data_type_eff_noext='sxr'; end @@ -109,6 +115,9 @@ if size(data_type_eff,1)==1 if ~isempty(strmatch(data_type_eff_noext,[{'VOL'} {'volume'}],'exact')) data_type_eff_noext='vol'; end + if ~isempty(strmatch(data_type_eff_noext,[{'q_0'} {'Q0'}],'exact')) + data_type_eff_noext='q0'; + end if ~isempty(strmatch(data_type_eff_noext,[{'q_95'} {'Q95'}],'exact')) data_type_eff_noext='q95'; end @@ -158,9 +167,9 @@ else end % all keywords and corresponding case to run below -AUGkeywrdall=[{'Ip'} {'b0'} {'zmag'} {'rmag'} {'rgeo'} {'zgeo'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'qrho_fpp'} {'q95'} {'kappa'} ... +AUGkeywrdall=[{'Ip'} {'b0'} {'zmag'} {'rmag'} {'rgeo'} {'zgeo'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'qrho_fpp'} {'q0'} {'q95'} {'kappa'} ... {'delta'} {'deltatop'} {'deltabot'} {'neint'} ... - {'ne'} {'te'} {'nerho'} {'terho'} {'equil'} {'equil_fpp'} ... + {'ne'} {'te'} {'nerho'} {'terho'} {'cxrs'} {'cxrs_rhos'} {'equil'} {'equil_fpp'} ... {'sxr'} {'sxR'} {'sxb'} {'ece'} {'eced'} {'Halpha'}]; AUGsig.iip=strmatch('Ip',AUGkeywrdall,'exact'); AUGsig.ib0=strmatch('b0',AUGkeywrdall,'exact'); @@ -175,6 +184,7 @@ AUGsig.iqrho=strmatch('qrho',AUGkeywrdall,'exact'); AUGsig.iqrho_fpp=strmatch('qrho_fpp',AUGkeywrdall,'exact'); AUGsig.iequil=strmatch('equil',AUGkeywrdall,'exact'); AUGsig.iequil_fpp=strmatch('equil_fpp',AUGkeywrdall,'exact'); +AUGsig.iq0=strmatch('q0',AUGkeywrdall,'exact'); AUGsig.iq95=strmatch('q95',AUGkeywrdall,'exact'); AUGsig.ikappa=strmatch('kappa',AUGkeywrdall,'exact'); AUGsig.idelta=strmatch('delta',AUGkeywrdall,'exact'); @@ -185,6 +195,8 @@ AUGsig.ine=strmatch('ne',AUGkeywrdall,'exact'); AUGsig.ite=strmatch('te',AUGkeywrdall,'exact'); AUGsig.inerho=strmatch('nerho',AUGkeywrdall,'exact'); AUGsig.iterho=strmatch('terho',AUGkeywrdall,'exact'); +AUGsig.icxrs=strmatch('cxrs',AUGkeywrdall,'exact'); +AUGsig.icxrs_rhos=strmatch('cxrs_rhos',AUGkeywrdall,'exact'); AUGsig.isxr=strmatch('sxr',AUGkeywrdall,'exact'); AUGsig.isxR=strmatch('sxR',AUGkeywrdall,'exact'); AUGsig.isxb=strmatch('sxb',AUGkeywrdall,'exact'); @@ -209,6 +221,8 @@ AUGkeywrdcase(AUGsig.isxr)=AUGkeywrdall(AUGsig.isxr); AUGkeywrdcase(AUGsig.isxR)=AUGkeywrdall(AUGsig.isxR); AUGkeywrdcase(AUGsig.isxb)=AUGkeywrdall(AUGsig.isxb); %AUGkeywrdcase(AUGsig.iece)=AUGkeywrdall(AUGsig.iece); +AUGkeywrdcase(AUGsig.icxrs)=AUGkeywrdall(AUGsig.icxrs); +AUGkeywrdcase(AUGsig.icxrs_rhos)=AUGkeywrdall(AUGsig.icxrs_rhos); % Information about which dimension has time, always return 2D data as (x,t) array % as most are 1D arrays with time as first index, fill in with ones and change only those needed @@ -227,6 +241,7 @@ AUGsiglocation(:,AUGsig.izgeo)={'FPG'; 'Zgeo'}; AUGsiglocation(:,AUGsig.ircont)={'' ; ''}; AUGsigtimeindx(AUGsig.ircont)=2; AUGsiglocation(:,AUGsig.izcont)={'' ; ''}; AUGsigtimeindx(AUGsig.izcont)=2; AUGsiglocation(:,AUGsig.ivol)={''; ''}; +AUGsiglocation(:,AUGsig.iq0)={'FPG'; 'q0'}; AUGsiglocation(:,AUGsig.iq95)={'FPG'; 'q95'}; AUGsiglocation(:,AUGsig.ikappa)={''; ''}; AUGsiglocation(:,AUGsig.ideltatop)={''; ''}; @@ -493,6 +508,91 @@ switch AUGkeywrdcase{index} trace.name=[num2str(shot) '/' ppftype '/' tracename]; end + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& + case {'cxrs', 'cxrs_rhos'} + % LOAD CEZ data + % + + shotfile_exp_eff = AUGexplocation{index}; + + trace.t=[]; + trace.x=[]; + ppftype='CEZ'; + [a,e]=rdaAUG_eff(shot,ppftype,'vrot',shotfile_exp_eff); + if isempty(a) || e~=0 + cxrs = struct([]); + else + cxrs.vrot = a; + rmfield(cxrs.vrot,'x'); rmfield(cxrs.vrot,'t'); rmfield(cxrs.vrot,'data'); + cxrs.x = a.x; + cxrs.data = a.data; + cxrs.t = a.t; + cxrs.x = a.x; + end + if ~isempty(cxrs) + cxrs.dim=[{cxrs.x} ; {cxrs.t}]; + cxrs.dimunits=[{'chord'} ; {'time [s]'}]; + cxrs.name=[num2str(shot) '/' ppftype '/vrot;Ti;Ti_c']; + [aerr,e]=rdaAUG_eff(shot,ppftype,'err_vrot',shotfile_exp_eff); + cxrs.vrot.error = aerr.value; + [r_time]=sf2ab(ppftype,shot,'R_time','-exp',shotfile_exp_eff); + cxrs.r_time = r_time.value{1}; + [z_time]=sf2ab(ppftype,shot,'z_time','-exp',shotfile_exp_eff); + cxrs.z_time = z_time.value{1}; + [a,e]=rdaAUG_eff(shot,ppftype,'Ti',shotfile_exp_eff); + [aerr,e]=rdaAUG_eff(shot,ppftype,'err_Ti',shotfile_exp_eff); + cxrs.ti = a; + cxrs.ti.error = aerr.value; + [a,e]=rdaAUG_eff(shot,ppftype,'Ti_c',shotfile_exp_eff); + [aerr,e]=rdaAUG_eff(shot,ppftype,'err_Ti_c',shotfile_exp_eff); + cxrs.ti_c = a; + cxrs.ti_c.error = aerr.value; + % + if strcmp(AUGkeywrdcase{index},'cxrs_rhos') + equil=gdat(shot,'equil',0); + inb_chord_cxrs=size(cxrs.r_time,1); + inb_time_cxrs=size(cxrs.r_time,2); + psi_out = NaN*ones(inb_chord_cxrs,inb_time_cxrs); + rhopsinorm_out = NaN*ones(inb_chord_cxrs,inb_time_cxrs); + rhotornorm_out = NaN*ones(inb_chord_cxrs,inb_time_cxrs); + rhovolnorm_out = NaN*ones(inb_chord_cxrs,inb_time_cxrs); + % constructs intervals within which a given equil is used: [time_equil(i),time_equil(i+1)] + time_equil=[1.5*equil.t(1)-0.5*equil.t(2) 0.5.*(equil.t(1:end-1)+equil.t(2:end)) 1.5*equil.t(end)-0.5*equil.t(end-1)]; + iok=find(cxrs.r_time(:,1)>0); + for itequil=1:length(time_equil)-1 + rr=equil.Rmesh(:,itequil); + zz=equil.Zmesh(:,itequil); + psirz_in = equil.psi2D(:,:,itequil); + it_cxrs_inequil = find(cxrs.t>=time_equil(itequil) & cxrs.t<=time_equil(itequil+1)); + if ~isempty(it_cxrs_inequil) + rout=cxrs.r_time(iok,it_cxrs_inequil); + zout=cxrs.z_time(iok,it_cxrs_inequil); + psi_at_routzout = interpos2Dcartesian(rr,zz,psirz_in,rout,zout); + psi_out(iok,it_cxrs_inequil) = reshape(psi_at_routzout,length(iok),length(it_cxrs_inequil)); + rhopsinorm_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) + rhotornorm_out(iok,it_cxrs_inequil(it_cx)) = interpos(equil.rhopolnorm(:,itequil),equil.rhotornorm(:,itequil),rhopsinorm_out(iok,it_cxrs_inequil(it_cx)),-3,[2 2],[0 1]); + rhovolnorm_out(iok,it_cxrs_inequil(it_cx)) = interpos(equil.rhopolnorm(:,itequil),equil.rhovolnorm(:,itequil),rhopsinorm_out(iok,it_cxrs_inequil(it_cx)),-3,[2 2],[0 1]); + end + end + end + cxrs.psi_on_rztime = psi_out; + cxrs.rhopsinorm_on_rztime = rhopsinorm_out; + cxrs.rhotornorm_on_rztime = rhotornorm_out; + cxrs.rhovolnorm_on_rztime = rhovolnorm_out; + end + + trace = cxrs; + else + trace.data = []; + trace.dim = []; + trace.dimunits = []; + trace.x = []; + trace.t = []; + trace.units = []; + trace.name=[num2str(shot) '/' ppftype '/' tracename]; + end + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& case {'te', 'ne'} -- GitLab