diff --git a/JET/loadJETdata.m b/JET/loadJETdata.m index 4730cf48ae24e1a7b2cbed1d0e476b3ad141de3b..a1e5660ea0f66e16518468d5968b0753e0c81864 100644 --- a/JET/loadJETdata.m +++ b/JET/loadJETdata.m @@ -16,7 +16,10 @@ function [trace,error,varargout]=loadJETdata(shot,data_type,varargin) % 'sxR' = soft x-ray emission with varargout{1} option (requires varargin{5}!) % % Special case compatible with old gdat.m allows (JET related): -% gdat(51994,'ppf','efit/xip',...) +% gdat(51994,'ppf','efit/xip',...) % omitting the 'JET' input as assumes JET if 3rd argument is a string +% +% for simplicity also allows: +% gdat(51994,'ppf/efit/xip',1,'JET',....) % % INPUT: % shot: shot number @@ -61,12 +64,18 @@ function [trace,error,varargout]=loadJETdata(shot,data_type,varargin) % [zmag,error]=loadJETdata(shot,'zmag'); % -varargout=cell(1,1); +varargout={cell(1,1)}; error=1; % To allow multiple ways of writing a specific keyword, use data_type_eff within this routine - data_type_eff=data_type; +if size(data_type_eff,1)==1 + i=findstr('/',data_type_eff); + if length(i)>1 + % assumes given a la 'ppf/efit/xip' + data_type_eff=[{data_type_eff(1:i(1)-1)} ; {data_type_eff(i(1)+1:end)}]; + end +end i_efitm=0; i_ext=length(data_type_eff)+1; @@ -167,6 +176,7 @@ trace.x=[]; trace.t=[]; trace.dim=[]; trace.dimunits=[]; +trace.name=[]; % find index of signal called upon if size(data_type_eff,1)==2 @@ -227,7 +237,7 @@ switch JETkeywrdcase{index} error=e; if length(size(trace.data))==1 | (length(size(trace.data))==2 & size(trace.data,2)==1) trace.dim=[{trace.t}]; - trace.dimunits(1)={'time [s]'}; + trace.dimunits={'time [s]'}; elseif length(size(trace.data))==2 trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'R [m] or rho=sqrt(psi_norm)'} ; {'time [s]'}]; @@ -237,7 +247,8 @@ switch JETkeywrdcase{index} trace.dimunits=[{'R [m] or rho=sqrt(psi_norm)'} ; {'time [s]'} ; {'d'}]; trace.d=d; end - + trace.name=[ppftype '/' num2str(shot) '/' tracename]; + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& case JETkeywrdall{JETsig.iqrho} % q profile on sqrt(psi_norm) @@ -253,6 +264,7 @@ switch JETkeywrdcase{index} trace.t=t; trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'sqrt(\psi)'} ; {'time [s]'}]; + trace.name=[ppftype '/' num2str(shot) '/' tracename]; error=e; %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -271,6 +283,7 @@ switch JETkeywrdcase{index} trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'R [m]'} ; {'time [s]'}]; trace.std=[]; + trace.name=[ppftype '/' num2str(shot) '/' tracename]; error=e; %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -289,6 +302,7 @@ switch JETkeywrdcase{index} trace.dim=[{trace.x} ; {trace.t}]; trace.dimunits=[{'rho=sqrt(psi)'} ; {'time [s]'}]; trace.std=[]; + trace.name=[ppftype '/' num2str(shot) '/' tracename]; error=e; %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@ -319,7 +333,7 @@ switch JETkeywrdcase{index} % Status=1 => Not Read Yet % vertical SXR chords ppftype='jpf'; - tracename=['db/j3-sxr<v' num2str(i) '''''/1' name_ext]; + tracename=['db/j3-sxr<v' num2str(i) '''''/1' name_ext] [a,x,t,d,e]=rda_eff(shot,ppftype,tracename); % Convert from raw sxr data to W/m^2 trace.data(i,:) = a * vconvert(i); @@ -329,6 +343,7 @@ switch JETkeywrdcase{index} end trace.dim=[{[starti:endi]'} ; {trace.t}]; trace.dimunits=[{'channels'} ; {'time [s]'}]; + trace.name=[ppftype '/' num2str(shot) '/' tracename]; end % calculating intersection of the view lines with magnetics axis if strcmp(data_type_eff_noext,'sxR') @@ -366,24 +381,28 @@ switch JETkeywrdcase{index} % Status=1 => Not Read Yet ppftype='ppf'; tracename=['kk3/te' num2str(i,'%2.2d') name_ext]; + disp(tracename) [a,x,t,d,e]=rda_eff(shot,ppftype,tracename); trace.data(i,:)=a; trace.t=t; - trace.x(i,:)=x; + if ~isempty(x); trace.x(i,:)=x'; end; error=e; - ppftype='ppf'; - tracename=['kk3/rc' num2str(i,'%2.2d') name_ext]; - [a,x,t,d,e]=rda_eff(shot,ppftype,tracename); + ppftypeR='ppf'; + tracenameR=['kk3/rc' num2str(i,'%2.2d') name_ext]; + [a,x,t,d,e]=rda_eff(shot,ppftypeR,tracenameR); radius.data(i,:)=a; radius.t=t; - radius.x(i,:)=x; + radius.x=x; end end trace.dim=[{[starti:endi]'} ; {trace.t}]; trace.dimunits=[{'channels'} ; {'time [s]'}]; + trace.name=[ppftype '/' num2str(shot) '/' tracename]; varargout={{radius}}; - trace.R=radius.data; - + for i=starti:endi + trace.R(i,:)=interp1(radius.t,radius.data(i,:),trace.t); + end +keyboard otherwise disp('case not yet defined') diff --git a/JET/rda_eff.m b/JET/rda_eff.m index f8bcd14d9c756d95ba220a4c5ad5beadaa84f9f7..b9ab0e7081dcc4376667ac5ff20935faac83a81a 100644 --- a/JET/rda_eff.m +++ b/JET/rda_eff.m @@ -20,7 +20,7 @@ function [data,x,time,hsig,error]=rda_eff(shot,pftype,tracename,varargin); % global usemdsplus -if ~exist('usemdsplus'); usemdsplus=1; end +if isempty(usemdsplus); usemdsplus=1; end time_int=[]; if nargin>=4 & ~isempty(varargin{1}) @@ -33,7 +33,7 @@ if usemdsplus if ~unix('test -d /home/duval/mdsplus') addpath('/home/duval/mdsplus') end - mdsconnect('mdsplus.jet.efda.org') + mdsconnect('mdsplus.jet.efda.org'); % defines trace to fetch % after '?' specific details @@ -123,7 +123,7 @@ if usemdsplus end - mdsdisconnect + mdsdisconnect; else % use RDA