Skip to content
Snippets Groups Projects
Commit f719f292 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

add rms_error

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@1897 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 8dee8b0e
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@
% trace.x: space of reference
% trace.dim: cell array of grids, trace.dim{1}, {2}, ...
% trace.dimunits: units of dimensions
% trace.units: units of data
%
% Additional Output arguments depending on data_type
%
......@@ -149,9 +150,9 @@ end
% nodes which have _2 and _3 equivalence, related to simpletdi case
liuqe23=[{'\results::i_p'} {'\results::z_axis'} {'\results::r_axis'} {'\results::q_psi'} ...
{'\results::beta_tor'} {'\results::q_95'} {'\results::l_i'} {'\results::delta_95'} ...
{'\results::beta_tor'} {'\results::beta_pol'} {'\results::q_95'} {'\results::l_i'} {'\results::delta_95'} ...
{'\results::kappa_95'} {'\results::r_contour'} {'\results::z_contour'} {'\results::psi_axis'} ...
{'\results::thomson:psiscatvol'} {'\results::thomson:psi_max'}];
{'\results::thomson:psiscatvol'} {'\results::thomson:psi_max'} {'\results::rms_error'}];
% all keywords and corresponding case to run below
TCVkeywrdall=[{'Ip'} {'zmag'} {'rmag'} {'rcont'} {'zcont'} {'vol'} {'rhovol'} {'qrho'} {'q95'} {'kappa'} ...
......@@ -240,17 +241,20 @@ trace.x=[];
trace.t=[];
trace.dim=[];
trace.dimunits=[];
trace.units=[];
irpintwarn=0;
% find index of signal called upon
if strcmp(data_type_eff(1:1),'\')
% in case full node name was given
index=strmatch(data_type_eff(1:end-i_23),TCVsiglocation,'exact');
if isempty(index)
if irpintwarn & isempty(index)
disp('********************')
disp('trace not yet registered.')
disp('If standard data, ask andrea.scarabosio@epfl.ch or olivier.sauter@epfl.ch to create a keyqord entry for this data')
% eval(['!mail -s ''' data_type_eff ' ' num2str(shot) ' ' getenv('USER') ' TCV'' olivier.sauter@epfl.ch < /dev/null'])
disp('********************')
elseif isempty(index)
% temporarily add entry in arrays, so can work below
index=length(TCVkeywrdall)+1;
TCVkeywrdall(end+1)={'new'};
......@@ -275,8 +279,10 @@ else
return
end
end
disp(['loading' ' ' data_type_eff_noext ' from TCV shot #' num2str(shot)]);
disp(['case ' TCVkeywrdcase{index}])
if irpintwarn
disp(['loading' ' ' data_type_eff_noext ' from TCV shot #' num2str(shot)]);
disp(['case ' TCVkeywrdcase{index}])
end
if i_23==2 & isempty(strmatch(TCVsiglocation(index),liuqe23,'exact')) & strcmp(TCVkeywrdcase{index},'simpletdi')
disp('********')
disp('Warning asks for liuqe 2 or 3 of a signal, but not in liuqe23 list in loadTCVdata')
......@@ -315,7 +321,11 @@ switch TCVkeywrdcase{index}
end
trace.data=tracetdi.data;
if TCVsigtimeindx(index)>0 | length(tracetdi.dim)==1
if length(tracetdi.dim)==0
% scalar
trace.x=[];
trace.t=[];
elseif 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
......@@ -358,6 +368,10 @@ switch TCVkeywrdcase{index}
trace.dim=tracetdi.dim;
trace.dimunits=tracetdi.dimunits;
end
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) ';' nodenameeff];
error=0;
......@@ -385,6 +399,9 @@ switch TCVkeywrdcase{index}
trace.dimunits=[{'Z [m]'} ; {'time [s]'}];
trace.x=z;
trace.t=time;
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
mdsclose('mdsip')
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
......@@ -416,6 +433,9 @@ switch TCVkeywrdcase{index}
trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}];
trace.x=rho;
trace.t=time;
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
mdsclose
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
......@@ -429,6 +449,9 @@ switch TCVkeywrdcase{index}
trace.t=tracetdi.dim{2};
trace.dim=[{trace.x};{trace.t}];
trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}];
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) ';' nodenameeff];
mdsclose
......@@ -448,10 +471,19 @@ switch TCVkeywrdcase{index}
tracetdi.dim{2}=fsg.vol.grid.t';
end
trace.data=tracetdi.data;
trace.x=tracetdi.dim{1};
trace.t=tracetdi.dim{2};
trace.dim=[{trace.x};{trace.t}];
if isempty(tracetdi.data)
trace.x=tracetdi.dim;
trace.t=tracetdi.dim;
trace.dim=tracetdi.dim;
else
trace.x=tracetdi.dim{1};
trace.t=tracetdi.dim{2};
trace.dim=[{trace.x};{trace.t}];
end
trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}];
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) ';' nodenameeff liuqe_ext];
mdsclose
......@@ -478,6 +510,9 @@ switch TCVkeywrdcase{index}
trace.t=tracetdi.dim{2};
trace.dim=[{trace.x};{trace.t}];
trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}];
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) '; sqrt(V/Va) from ' nodenameeff liuqe_ext];
mdsclose
......@@ -510,8 +545,7 @@ switch TCVkeywrdcase{index}
end
t_1=zmag.t(1);
t_2=zmag.t(end);
[xtomo_signal,t]=get_xtomo_data(shot,t_1,t_2,13e-6*16, ...
icamera,angfact);
[xtomo_signal,t]=get_xtomo_data(shot,t_1,t_2,13e-6*16,icamera,angfact);
data=interp1(zmag.t,zmag.data,t');
radius.data=VsxrTCVradius(data,xchord,ychord)';
radius.t=t';
......@@ -562,6 +596,9 @@ switch TCVkeywrdcase{index}
radius.t=trace.t;
varargout{1}={radius};
error=0;
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
mdsclose
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
......@@ -601,6 +638,9 @@ switch TCVkeywrdcase{index}
trace.t=tracetdi.dim{1};
trace.dim=tracetdi.dim;
trace.dimunits={'time [s]'};
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) ';' nodenameeff{1} ',' nodenameeff{2}];
mdsclose
error=0;
......@@ -616,6 +656,9 @@ switch TCVkeywrdcase{index}
trace.t=tracetdi.dim{1};
trace.dim=tracetdi.dim;
trace.dimunits={'time [s]'};
if isfield(tracetdi,'units');
trace.units=tracetdi.units;
end
trace.name=[num2str(shot) ';' nodenameeff{1} ',' nodenameeff{2}];
mdsclose
error=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment