diff --git a/JET/loadJETdata.m b/JET/loadJETdata.m index a1e5660ea0f66e16518468d5968b0753e0c81864..652f68e42d4168d14bc4f5c65d2bce1bb34dde81 100644 --- a/JET/loadJETdata.m +++ b/JET/loadJETdata.m @@ -4,7 +4,15 @@ function [trace,error,varargout]=loadJETdata(shot,data_type,varargin) % 'Ip' = current % 'zmag' = vertical position of the center of the plasma (magnetic axis) % 'rmag' = radial position of the center of the plasma +% 'rcont' = R of plama boundary vs time +% 'zcont' = Z of plama boundary vs time +% 'vol' = volume of flux surfaces vs rho=sqrt(psi) % 'qrho' = q profile on rho mesh +% 'q95' = q95 vs time +% 'kappa', 'elon' = edge elongation vs time +% 'delta', 'triang' = edge averaged triangularity vs time +% 'deltatop', 'triangtop' = edge upper (top) triangularity vs time +% 'deltabot', 'triangbot' = edge lower (bottom) triangularity vs time % 'neint' = line-integrated electron density [m/m^3] % 'ne'= ne raw profile on (R,t). ADD error bars in .std % 'te'= Te raw profile on (R,t). ADD error bars in .std @@ -110,12 +118,36 @@ if size(data_type_eff,1)==1 if ~isempty(strmatch(data_type_eff_noext,[{'ECE'}],'exact')) data_type_eff_noext='ece'; end + if ~isempty(strmatch(data_type_eff_noext,[{'VOL'} {'volume'}],'exact')) + data_type_eff_noext='vol'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'q_95'} {'Q95'}],'exact')) + data_type_eff_noext='q95'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'elongation'} {'elon'}],'exact')) + data_type_eff_noext='kappa'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'triangularity'} {'triang'}],'exact')) + data_type_eff_noext='delta'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'deltaup'} {'deltau'} {'triangtop'} {'triangu'} {'triangup'}],'exact')) + data_type_eff_noext='deltatop'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'deltalow'} {'deltal'} {'triangbot'} {'triangl'} {'trianglow'}],'exact')) + data_type_eff_noext='deltabot'; + end if ~isempty(strmatch(data_type_eff_noext,[{'Rmag'}],'exact')) data_type_eff_noext='rmag'; end if ~isempty(strmatch(data_type_eff_noext,[{'Zmag'}],'exact')) data_type_eff_noext='zmag'; end + if ~isempty(strmatch(data_type_eff_noext,[{'Rcont'}],'exact')) + data_type_eff_noext='rcont'; + end + if ~isempty(strmatch(data_type_eff_noext,[{'Zcont'}],'exact')) + data_type_eff_noext='zcont'; + end else i_ext=length(data_type_eff{2})+1; name_ext=''; @@ -128,13 +160,22 @@ else end % all keywords and corresponding case to run below -JETkeywrdall=[{'Ip'} {'zmag'} {'rmag'} {'qrho'} {'neint'} ... +JETkeywrdall=[{'Ip'} {'zmag'} {'rmag'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'q95'} {'kappa'} ... + {'delta'} {'deltatop'} {'deltabot'} {'neint'} ... {'ne'} {'te'} {'nerho'} {'terho'} ... {'sxr'} {'sxR'} {'ece'}]; JETsig.iip=strmatch('Ip',JETkeywrdall,'exact'); JETsig.izmag=strmatch('zmag',JETkeywrdall,'exact'); JETsig.irmag=strmatch('rmag',JETkeywrdall,'exact'); +JETsig.ircont=strmatch('rcont',JETkeywrdall,'exact'); +JETsig.izcont=strmatch('zcont',JETkeywrdall,'exact'); +JETsig.ivol=strmatch('vol',JETkeywrdall,'exact'); JETsig.iqrho=strmatch('qrho',JETkeywrdall,'exact'); +JETsig.iq95=strmatch('q95',JETkeywrdall,'exact'); +JETsig.ikappa=strmatch('kappa',JETkeywrdall,'exact'); +JETsig.idelta=strmatch('delta',JETkeywrdall,'exact'); +JETsig.ideltatop=strmatch('deltatop',JETkeywrdall,'exact'); +JETsig.ideltabot=strmatch('deltabot',JETkeywrdall,'exact'); JETsig.ineint=strmatch('neint',JETkeywrdall,'exact'); JETsig.ine=strmatch('ne',JETkeywrdall,'exact'); JETsig.ite=strmatch('te',JETkeywrdall,'exact'); @@ -149,6 +190,7 @@ JETsig.iece=strmatch('ece',JETkeywrdall,'exact'); JETkeywrdcase=cell(size(JETkeywrdall)); JETkeywrdcase(:)={'simplereaddata'}; JETkeywrdcase(JETsig.iqrho)=JETkeywrdall(JETsig.iqrho); % special as efit q on psi +JETkeywrdcase(JETsig.idelta)=JETkeywrdall(JETsig.idelta); % special as average of triu and tril JETkeywrdcase(JETsig.ine)=JETkeywrdall(JETsig.ine); % special as adds error bars JETkeywrdcase(JETsig.ite)=JETkeywrdall(JETsig.ite); % idem JETkeywrdcase(JETsig.inerho)=JETkeywrdall(JETsig.inerho); % idem @@ -168,6 +210,13 @@ JETsiglocation(:)={''}; JETsiglocation(:,JETsig.iip)={'ppf'; 'efit/xip'}; JETsiglocation(:,JETsig.izmag)={'ppf'; 'efit/zmag'}; JETsiglocation(:,JETsig.irmag)={'ppf'; 'efit/rmag'}; +JETsiglocation(:,JETsig.ircont)={'ppf' ; 'efit/rbnd'}; JETsigtimeindx(JETsig.ircont)=2; +JETsiglocation(:,JETsig.izcont)={'ppf' ; 'efit/zbnd'}; JETsigtimeindx(JETsig.izcont)=2; +JETsiglocation(:,JETsig.ivol)={'ppf'; 'equi/vol'}; +JETsiglocation(:,JETsig.iq95)={'ppf'; 'efit/q95'}; +JETsiglocation(:,JETsig.ikappa)={'ppf'; 'efit/elon'}; +JETsiglocation(:,JETsig.ideltatop)={'ppf'; 'efit/triu'}; +JETsiglocation(:,JETsig.ideltabot)={'ppf'; 'efit/tril'}; JETsiglocation(:,JETsig.ineint)={'ppf'; 'kg1v/lid3'}; % initialize order of substructures and allows just a "return" if data empty @@ -206,7 +255,7 @@ else if isempty(index) disp(' ') disp('********************') - disp(['no such keyword: ' data_type_eff(1:end-i_23)]) + disp(['no such keyword: ' data_type_eff]) disp(' ') disp('Available keywords:') JETkeywrdall(:) @@ -215,7 +264,7 @@ else end end disp(' ') -disp(['loading' ' ' char(data_type_eff(end)) ' from JET shot #' num2str(shot)]); +disp(['loading' ' ' char(data_type_eff) ' from JET shot #' num2str(shot)]); disp(['case ' JETkeywrdcase{index}]) disp(' ') switch JETkeywrdcase{index} @@ -267,6 +316,22 @@ switch JETkeywrdcase{index} trace.name=[ppftype '/' num2str(shot) '/' tracename]; error=e; + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& + case JETkeywrdall{JETsig.idelta} + % average of delatop and deltabot + ppftype='ppf'; + tracename1=['efit/triu' name_ext]; + tracename2=['efit/tril' name_ext]; + [a1,x,t,d,e]=rda_eff(shot,ppftype,tracename1); + [a2,x,t,d,e]=rda_eff(shot,ppftype,tracename2); + trace.data=0.5.*(a1+a2); + trace.x=x; + trace.t=t; + trace.dim=[{trace.t}]; + trace.dimunits=[{'time [s]'}]; + trace.name=[ppftype '/' num2str(shot) '/efit/0.5(triu+tril)']; + error=e; + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& case {JETkeywrdall{JETsig.ine} , JETkeywrdall{JETsig.ite}} % ne, te raw data from LIDR vs R,t. Add error bars diff --git a/JET/rda_eff.m b/JET/rda_eff.m index b9ab0e7081dcc4376667ac5ff20935faac83a81a..ec67e55fcc92d1e72c75aa5ed3518d0228ab30e0 100644 --- a/JET/rda_eff.m +++ b/JET/rda_eff.m @@ -124,6 +124,9 @@ if usemdsplus end mdsdisconnect; + if ~unix('test -d /home/duval/mdsplus') + rmpath('/home/duval/mdsplus') + end else % use RDA diff --git a/TCV/loadTCVdata.m b/TCV/loadTCVdata.m index 39903542fa77611272233438fea7a350dd7f9556..57951a402ee38670324c93588149cb527168fc1b 100644 --- a/TCV/loadTCVdata.m +++ b/TCV/loadTCVdata.m @@ -4,10 +4,15 @@ % 'Ip' = current % 'zmag' = vertical position of the center of the plasma (magnetic axis) % 'rmag' = radial position of the center of the plasma -% 'rcont' = R of plama flux surfaces -% 'zcont' = Z of plama flux surfaces +% 'rcont' = R of plama boundary vs time +% 'zcont' = Z of plama boundary vs time % 'vol' = volume of flux surfaces % 'qrho' = q profile on rho mesh +% 'q95' = q95 vs time +% 'kappa', 'elon' = edge elongation vs time +% 'delta', 'triang' = edge averaged triangularity vs time +% 'deltatop', 'triangtop' = edge upper (top) triangularity vs time +% 'deltabot', 'triangbot' = edge lower (bottom) triangularity vs time % 'neint' = line-integrated electron density [m/m^3] % 'ne'= ne raw profile on (z,t). ADD error bars in .std % 'te'= Te raw profile on (z,t). ADD error bars in .std @@ -102,6 +107,21 @@ end if ~isempty(strmatch(data_type_eff_noext,[{'VOL'} {'volume'}],'exact')) data_type_eff_noext='vol'; end +if ~isempty(strmatch(data_type_eff_noext,[{'q_95'} {'Q95'}],'exact')) + data_type_eff_noext='q95'; +end +if ~isempty(strmatch(data_type_eff_noext,[{'elongation'} {'elon'}],'exact')) + data_type_eff_noext='kappa'; +end +if ~isempty(strmatch(data_type_eff_noext,[{'triangularity'} {'triang'}],'exact')) + data_type_eff_noext='delta'; +end +if ~isempty(strmatch(data_type_eff_noext,[{'deltaup'} {'deltau'}{'triangtop'} {'triangu'} {'triangup'}],'exact')) + data_type_eff_noext='deltatop'; +end +if ~isempty(strmatch(data_type_eff_noext,[{'deltalow'} {'deltal'}{'triangbot'} {'triangl'} {'trianglow'}],'exact')) + data_type_eff_noext='deltabot'; +end if ~isempty(strmatch(data_type_eff_noext,[{'Rmag'}],'exact')) data_type_eff_noext='rmag'; end @@ -118,7 +138,8 @@ liuqe23=[{'\results::i_p'} {'\results::z_axis'} {'\results::r_axis'} {'\results: {'\results::thomson:psiscatvol'} {'\results::thomson:psi_max'} {'\results::psitbx:vol'}]; % all keywords and corresponding case to run below -TCVkeywrdall=[{'Ip'} {'zmag'} {'rmag'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'neint'} ... +TCVkeywrdall=[{'Ip'} {'zmag'} {'rmag'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'q95'} {'kappa'} ... + {'delta'} {'deltatop'} {'deltabot'} {'neint'} ... {'ne'} {'te'} {'nerho'} {'terho'} {'profnerho'} {'profterho'} ... {'neft'} {'teft'} {'neftav'} {'teftav'} ... {'sxr'} {'sxR'} {'ece'}]; @@ -129,6 +150,11 @@ TCVsig.ircont=strmatch('rcont',TCVkeywrdall,'exact'); TCVsig.izcont=strmatch('zcont',TCVkeywrdall,'exact'); TCVsig.ivol=strmatch('vol',TCVkeywrdall,'exact'); TCVsig.iqrho=strmatch('qrho',TCVkeywrdall,'exact'); +TCVsig.iq95=strmatch('q95',TCVkeywrdall,'exact'); +TCVsig.ikappa=strmatch('kappa',TCVkeywrdall,'exact'); +TCVsig.idelta=strmatch('delta',TCVkeywrdall,'exact'); +TCVsig.ideltatop=strmatch('deltatop',TCVkeywrdall,'exact'); +TCVsig.ideltabot=strmatch('deltabot',TCVkeywrdall,'exact'); TCVsig.ineint=strmatch('neint',TCVkeywrdall,'exact'); TCVsig.ine=strmatch('ne',TCVkeywrdall,'exact'); TCVsig.ite=strmatch('te',TCVkeywrdall,'exact'); @@ -171,6 +197,11 @@ TCVsiglocation(TCVsig.irmag)={'\results::r_axis'}; TCVsiglocation(TCVsig.ircont)={'\results::r_contour'}; TCVsigtimeindx(TCVsig.ircont)=2; TCVsiglocation(TCVsig.izcont)={'\results::z_contour'}; TCVsigtimeindx(TCVsig.izcont)=2; TCVsiglocation(TCVsig.ivol)={'\results::psitbx:vol'}; TCVsigtimeindx(TCVsig.ivol)=2; +TCVsiglocation(TCVsig.iq95)={'\results::q_95'}; +TCVsiglocation(TCVsig.ikappa)={'\results::kappa_edge'}; +TCVsiglocation(TCVsig.idelta)={'\results::delta_edge'}; +TCVsiglocation(TCVsig.ideltatop)={'\results::delta_ed_top'}; +TCVsiglocation(TCVsig.ideltabot)={'\results::delta_ed_bot'}; TCVsiglocation(TCVsig.ineint)={'\results::fir:lin_int_dens'}; TCVsiglocation(TCVsig.iprofnerho)={'\results::th_prof_ne'}; TCVsiglocation(TCVsig.iprofterho)={'\results::th_prof_te'}; @@ -267,14 +298,14 @@ switch TCVkeywrdcase{index} return end tracetdi=tdi(nodenameeff); - mdsclose(shot) + mdsclose if isempty(tracetdi.data) | isnan(tracetdi.data) disp(['node ' nodenameeff ' is empty for shot = ' num2str(shot)]) return end trace.data=tracetdi.data; - if TCVsigtimeindx(index)>0 - trace.t=tracetdi.dim{TCVsigtimeindx(index)}; + if TCVsigtimeindx(index)>0 | length(tracetdi.dim)==1 + trace.t=tracetdi.dim{max(1,TCVsigtimeindx(index))}; ix=3-TCVsigtimeindx(index); % works only for 2D arrays else trace.t=tracetdi.dim{1}; @@ -311,6 +342,7 @@ switch TCVkeywrdcase{index} trace.dim=tracetdi.dim; trace.dimunits=tracetdi.dimunits; end + trace.name=[num2str(shot) ';' nodenameeff]; error=0; %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -318,14 +350,17 @@ switch TCVkeywrdcase{index} % ne or Te from Thomson data on raw z mesh vs (z,t) mdsopen(shot); if strcmp(TCVkeywrdcase{index},'ne') - tracetdi=tdi('\results::thomson:ne'); + nodenameeff='\results::thomson:ne'; + tracetdi=tdi(nodenameeff); tracestd=tdi('\results::thomson:ne:error_bar'); else - tracetdi=tdi('\results::thomson:te'); + nodenameeff='\results::thomson:te'; + tracetdi=tdi(nodenameeff); tracestd=tdi('\results::thomson:te:error_bar'); end trace.data=tracetdi.data'; % Thomson data as (t,z) trace.std=tracestd.data'; + trace.name=[num2str(shot) ';' nodenameeff]; % add correct dimensions time=mdsdata('\results::thomson:times'); z=mdsdata('\diagz::thomson_set_up:vertical_pos'); @@ -340,14 +375,17 @@ switch TCVkeywrdcase{index} % ne or Te from Thomson data on rho=sqrt(psi_normalised) mesh: (rho,t) mdsopen(shot); if strcmp(TCVkeywrdcase{index},'nerho') - tracetdi=tdi('\results::thomson:ne'); + nodenameeff='\results::thomson:ne'; + tracetdi=tdi(nodenameeff); tracestd=tdi('\results::thomson:ne:error_bar'); else - tracetdi=tdi('\results::thomson:te'); + nodenameeff='\results::thomson:te'; + tracetdi=tdi(nodenameeff); tracestd=tdi('\results::thomson:te:error_bar'); end trace.data=tracetdi.data'; % Thomson data as (t,z) trace.std=tracestd.data'; + trace.name=[num2str(shot) ';' nodenameeff]; % add correct dimensions time=mdsdata('\results::thomson:times'); % construct rho mesh @@ -366,12 +404,14 @@ switch TCVkeywrdcase{index} case {'qrho'} % q profile on psi from liuqe mdsopen(shot); - tracetdi=tdi(['\results::q_psi' liuqe_ext]); + nodenameeff=['\results::q_psi' liuqe_ext]; + tracetdi=tdi(nodenameeff); trace.data=tracetdi.data; trace.x=sqrt(tracetdi.dim{1}/10); trace.t=tracetdi.dim{2}; trace.dim=[{trace.x};{trace.t}]; trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}]; + trace.name=[num2str(shot) ';' nodenameeff]; mdsclose %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -408,6 +448,7 @@ switch TCVkeywrdcase{index} trace.t=t'; trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'channel #'} ; {'time [s]'}]; + trace.name=[num2str(shot) ';' 'get_xtomo_data']; error=0; %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -435,6 +476,7 @@ switch TCVkeywrdcase{index} trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'channel #'} ; {'time [s]'}]; trace.R=R(a:b,:)'; + trace.name=[num2str(shot) ';' '\results::ece...']; radius.data=trace.R; radius.t=trace.t; varargout{1}={radius}; @@ -452,7 +494,7 @@ switch TCVkeywrdcase{index} if ~isempty(find(status == 1)) mdsopen(shot); signal=get_mds_mio('MPX',[t_1 t_2]); - mdsclose(shot) + mdsclose trace.data=signal.data; for i=1:size(signal.dim{2},2) trace.t(:,i)=signal.dim{1}; @@ -460,6 +502,7 @@ switch TCVkeywrdcase{index} end trace.dim{1}={trace.t}; trace.dimunits={'time [s]'}; + trace.name=[num2str(shot) ';' 'get_mds_mio(MPX)']; [xchord,ychord]=mpx_geometry; varargout{1}={VsxrTCVradius(zmag.data,xchord,ychord)}; error=0; diff --git a/gdat.m b/gdat.m index e6aa6c644a83eb4ea94da4d8942d54ceeec87894..230e0084d72720208f0e8c5290541bc01a4a8ad2 100644 --- a/gdat.m +++ b/gdat.m @@ -6,21 +6,27 @@ function [trace,error,varargout] = gdat(shot,data_type,varargin) % 'Ip' = current % 'zmag' = vertical position of the center of the plasma (magnetic axis) % 'rmag' = radial position of the center of the plasma +% 'rcont' = R of plama boundary vs time +% 'zcont' = Z of plama boundary vs time +% 'vol' = volume of flux surfaces vs rho=sqrt(psi) +% 'qrho' = q profile on rho mesh +% 'q95' = q95 vs time +% 'kappa', 'elon' = edge elongation vs time +% 'delta', 'triang' = edge averaged triangularity vs time +% 'deltatop', 'triangtop' = edge upper (top) triangularity vs time +% 'deltabot', 'triangbot' = edge lower (bottom) triangularity vs time +% 'neint' = line-integrated electron density [m/m^3] +% 'ne'= ne raw profile on (z,t). ADD error bars in .std +% 'te'= Te raw profile on (z,t). ADD error bars in .std +% 'nerho'= ne profile on (rho=sqrt(psi),time) mesh.Note rho is a 2D array as depends on time. ADD error bars in .std +% 'terho'= Te profile on (rho=sqrt(psi),time) mesh.Note rho is a 2D array as depends on time. ADD error bars in .std % 'ece' = electron cyclotron emission % 'sxr' = soft x-ray emission % 'sxR' = soft x-ray emission with varargout{1} option (requires varargin{5}!) % % specific to TCV (see help loadTCVdata for more information) % 'xx_2 or xx_3' for Liuqe2 or 3: same as above for xx related to equilibrium -% 'rcont' = R of plama flux surfaces -% 'zcont' = Z of plama flux surfaces % 'vol' = volume of flux surfaces -% 'qrho' = q profile on rho mesh -% 'neint' = line-integrated electron density [m/m^3] -% 'ne'= ne raw profile on (z,t). ADD error bars in .std -% 'te'= Te raw profile on (z,t). ADD error bars in .std -% 'nerho'= ne profile on (rho=sqrt(psi),time) mesh.Note rho is a 2D array as depends on time. ADD error bars in .std -% 'terho'= Te profile on (rho=sqrt(psi),time) mesh.Note rho is a 2D array as depends on time. ADD error bars in .std % 'profnerho' = ne smoothed or fitted , vs (rho,t) (from Thomson fit) % 'profterho' = te smoothed or fitted , vs (rho,t) (from Thomson fit) % 'neft' = ne fitted from data on rho mesh (from proffit.local_time:neft)