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

add VTA thomson neterho otion, checked with cview

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4341 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 777d59cc
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,9 @@ 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),[{'neterho'}],'exact'))
data_type_eff_noext='neterho';
end
if ~isempty(strmatch(lower(data_type_eff_noext),[{'cxrs'} {'vrot'} {'ti'}],'exact'))
data_type_eff_noext='cxrs'; % load full CEZ structure
end
......@@ -169,7 +172,7 @@ end
% all keywords and corresponding case to run below
AUGkeywrdall=[{'Ip'} {'b0'} {'zmag'} {'rmag'} {'rgeo'} {'zgeo'} {'rcont'} {'zcont'} {'vol'} {'qrho'} {'qrho_fpp'} {'q0'} {'q95'} {'kappa'} ...
{'delta'} {'deltatop'} {'deltabot'} {'neint'} ...
{'ne'} {'te'} {'nerho'} {'terho'} {'cxrs'} {'cxrs_rhos'} {'equil'} {'equil_fpp'} ...
{'ne'} {'te'} {'nerho'} {'neterho'} {'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');
......@@ -195,6 +198,7 @@ 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.ineterho=strmatch('neterho',AUGkeywrdall,'exact');
AUGsig.icxrs=strmatch('cxrs',AUGkeywrdall,'exact');
AUGsig.icxrs_rhos=strmatch('cxrs_rhos',AUGkeywrdall,'exact');
AUGsig.isxr=strmatch('sxr',AUGkeywrdall,'exact');
......@@ -215,8 +219,9 @@ AUGkeywrdcase(AUGsig.iequil_fpp)=AUGkeywrdall(AUGsig.iequil_fpp); % special as e
%AUGkeywrdcase(AUGsig.idelta)=AUGkeywrdall(AUGsig.idelta); % special as average of triu and tril
AUGkeywrdcase(AUGsig.ine)=AUGkeywrdall(AUGsig.ine); % special as adds error bars
AUGkeywrdcase(AUGsig.ite)=AUGkeywrdall(AUGsig.ite); % idem
%AUGkeywrdcase(AUGsig.inerho)=AUGkeywrdall(AUGsig.inerho); % idem
%AUGkeywrdcase(AUGsig.iterho)=AUGkeywrdall(AUGsig.iterho); % idem
AUGkeywrdcase(AUGsig.inerho)=AUGkeywrdall(AUGsig.inerho); % idem
AUGkeywrdcase(AUGsig.ineterho)=AUGkeywrdall(AUGsig.ineterho); % idem
AUGkeywrdcase(AUGsig.iterho)=AUGkeywrdall(AUGsig.iterho); % idem
AUGkeywrdcase(AUGsig.isxr)=AUGkeywrdall(AUGsig.isxr);
AUGkeywrdcase(AUGsig.isxR)=AUGkeywrdall(AUGsig.isxR);
AUGkeywrdcase(AUGsig.isxb)=AUGkeywrdall(AUGsig.isxb);
......@@ -593,6 +598,142 @@ switch AUGkeywrdcase{index}
trace.name=[num2str(shot) '/' ppftype '/' tracename];
end
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
case {'neterho'} % 'nerho', 'terho',
% LOAD VTA data
% Vertical Thomson core and edge
shotfile_exp_eff = AUGexplocation{index};
trace.t=[];
trace.x=[];
ppftype='VTA';
% if strcmp(AUGkeywrdcase{index},'terho')
[a,e]=rdaAUG_eff(shot,ppftype,'Te_c',shotfile_exp_eff);
if isempty(a) || e~=0
thomson = struct([]);
else
thomson.te_core = a;
rmfield(thomson.te_core,'x'); rmfield(thomson.te_core,'t'); rmfield(thomson.te_core,'data');
thomson.x = a.x;
thomson.data = a.data;
thomson.t = a.t;
thomson.time_core = a.t;
thomson.x = a.x;
end
if ~isempty(thomson)
thomson.dim=[{thomson.x} ; {thomson.t}];
thomson.dimunits=[{'points'} ; {'time [s]'}];
thomson.name=[num2str(shot) '/' ppftype '/te_c;te_e;ne_c;ne_e'];
[alow,e]=rdaAUG_eff(shot,ppftype,'Telow_c',shotfile_exp_eff);
[aup,e]=rdaAUG_eff(shot,ppftype,'Teupp_c',shotfile_exp_eff);
thomson.te_core.error = max(aup.value-thomson.te_core.value,thomson.te_core.value-alow.value);
%
[a,e]=rdaAUG_eff(shot,ppftype,'Ne_c',shotfile_exp_eff);
thomson.ne_core = a;
rmfield(thomson.ne_core,'x'); rmfield(thomson.ne_core,'t'); rmfield(thomson.ne_core,'data');
[alow,e]=rdaAUG_eff(shot,ppftype,'Nelow_c',shotfile_exp_eff);
[aup,e]=rdaAUG_eff(shot,ppftype,'Neupp_c',shotfile_exp_eff);
thomson.ne_core.error = max(aup.value-thomson.ne_core.value,thomson.ne_core.value-alow.value);
%
[r_time]=rdaAUG_eff(shot,ppftype,'R_core',shotfile_exp_eff);
thomson.r_core_time = ones(size(thomson.te_core.value,1),1)*r_time.value;
[z_time]=rdaAUG_eff(shot,ppftype,'Z_core',shotfile_exp_eff);
thomson.z_core_time = z_time.value' * ones(1,size(thomson.te_core.value,2));
%
[a,e]=rdaAUG_eff(shot,ppftype,'Te_e',shotfile_exp_eff);
thomson.te_edge = a;
thomson.time_edge = a.t;
rmfield(thomson.te_edge,'x'); rmfield(thomson.te_edge,'t'); rmfield(thomson.te_edge,'data');
[alow,e]=rdaAUG_eff(shot,ppftype,'Telow_e',shotfile_exp_eff);
[aup,e]=rdaAUG_eff(shot,ppftype,'Teupp_e',shotfile_exp_eff);
thomson.te_edge.error = max(aup.value-thomson.te_edge.value,thomson.te_edge.value-alow.value);
%
[a,e]=rdaAUG_eff(shot,ppftype,'Ne_e',shotfile_exp_eff);
thomson.ne_edge = a;
rmfield(thomson.ne_edge,'x'); rmfield(thomson.ne_edge,'t'); rmfield(thomson.ne_edge,'data');
[alow,e]=rdaAUG_eff(shot,ppftype,'Nelow_e',shotfile_exp_eff);
[aup,e]=rdaAUG_eff(shot,ppftype,'Neupp_e',shotfile_exp_eff);
thomson.ne_edge.error = max(aup.value-thomson.ne_edge.value,thomson.ne_edge.value-alow.value);
%
[r_time]=rdaAUG_eff(shot,ppftype,'R_edge',shotfile_exp_eff);
thomson.r_edge_time = ones(size(thomson.te_edge.value,1),1)*r_time.value;
[z_time]=rdaAUG_eff(shot,ppftype,'Z_edge',shotfile_exp_eff);
thomson.z_edge_time = z_time.value' * ones(1,size(thomson.te_edge.value,2));
%
if strcmp(AUGkeywrdcase{index},'neterho')
equil=gdat(shot,'equil',0);
% core
inb_chord_thomson_core=size(thomson.r_core_time,1);
inb_time_thomson_core=size(thomson.r_core_time,2);
psi_out_core = NaN*ones(inb_chord_thomson_core,inb_time_thomson_core);
rhopsinorm_out_core = NaN*ones(inb_chord_thomson_core,inb_time_thomson_core);
rhotornorm_out_core = NaN*ones(inb_chord_thomson_core,inb_time_thomson_core);
rhovolnorm_out_core = NaN*ones(inb_chord_thomson_core,inb_time_thomson_core);
% edge
inb_chord_thomson_edge=size(thomson.r_edge_time,1);
inb_time_thomson_edge=size(thomson.r_edge_time,2);
psi_out_edge = NaN*ones(inb_chord_thomson_edge,inb_time_thomson_edge);
rhopsinorm_out_edge = NaN*ones(inb_chord_thomson_edge,inb_time_thomson_edge);
rhotornorm_out_edge = NaN*ones(inb_chord_thomson_edge,inb_time_thomson_edge);
rhovolnorm_out_edge = NaN*ones(inb_chord_thomson_edge,inb_time_thomson_edge);
% 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)];
for itequil=1:length(time_equil)-1
rr=equil.Rmesh(:,itequil);
zz=equil.Zmesh(:,itequil);
psirz_in = equil.psi2D(:,:,itequil);
it_thomson_core_inequil = find(thomson.time_core>=time_equil(itequil) & thomson.time_core<=time_equil(itequil+1));
if ~isempty(it_thomson_core_inequil)
rout_core=thomson.r_core_time(:,it_thomson_core_inequil);
zout_core=thomson.z_core_time(:,it_thomson_core_inequil);
psi_at_routzout = interpos2Dcartesian(rr,zz,psirz_in,rout_core,zout_core);
psi_out_core(:,it_thomson_core_inequil) = reshape(psi_at_routzout,inb_chord_thomson_core,length(it_thomson_core_inequil));
rhopsinorm_out_core(:,it_thomson_core_inequil) = sqrt((psi_out_core(:,it_thomson_core_inequil)-equil.psi_axis(itequil))./(equil.psi_lcfs(itequil)-equil.psi_axis(itequil)));
for it_cx=1:length(it_thomson_core_inequil)
rhotornorm_out_core(:,it_thomson_core_inequil(it_cx)) = ...
interpos(equil.rhopolnorm(:,itequil),equil.rhotornorm(:,itequil),rhopsinorm_out_core(:,it_thomson_core_inequil(it_cx)),-3,[2 2],[0 1]);
rhovolnorm_out_core(:,it_thomson_core_inequil(it_cx)) = ...
interpos(equil.rhopolnorm(:,itequil),equil.rhovolnorm(:,itequil),rhopsinorm_out_core(:,it_thomson_core_inequil(it_cx)),-3,[2 2],[0 1]);
end
end
% edge
it_thomson_edge_inequil = find(thomson.time_edge>=time_equil(itequil) & thomson.time_edge<=time_equil(itequil+1));
if ~isempty(it_thomson_edge_inequil)
rout_edge=thomson.r_edge_time(:,it_thomson_edge_inequil);
zout_edge=thomson.z_edge_time(:,it_thomson_edge_inequil);
psi_at_routzout = interpos2Dcartesian(rr,zz,psirz_in,rout_edge,zout_edge);
psi_out_edge(:,it_thomson_edge_inequil) = reshape(psi_at_routzout,inb_chord_thomson_edge,length(it_thomson_edge_inequil));
rhopsinorm_out_edge(:,it_thomson_edge_inequil) = sqrt((psi_out_edge(:,it_thomson_edge_inequil)-equil.psi_axis(itequil))./(equil.psi_lcfs(itequil)-equil.psi_axis(itequil)));
for it_cx=1:length(it_thomson_edge_inequil)
rhotornorm_out_edge(:,it_thomson_edge_inequil(it_cx)) = ...
interpos(equil.rhopolnorm(:,itequil),equil.rhotornorm(:,itequil),rhopsinorm_out_edge(:,it_thomson_edge_inequil(it_cx)),-3,[2 2],[0 1]);
rhovolnorm_out_edge(:,it_thomson_edge_inequil(it_cx)) = ...
interpos(equil.rhopolnorm(:,itequil),equil.rhovolnorm(:,itequil),rhopsinorm_out_edge(:,it_thomson_edge_inequil(it_cx)),-3,[2 2],[0 1]);
end
end
end
thomson.core_psi_on_rztime = psi_out_core;
thomson.core_rhopsinorm_on_rztime = rhopsinorm_out_core;
thomson.core_rhotornorm_on_rztime = rhotornorm_out_core;
thomson.core_rhovolnorm_on_rztime = rhovolnorm_out_core;
thomson.edge_psi_on_rztime = psi_out_edge;
thomson.edge_rhopsinorm_on_rztime = rhopsinorm_out_edge;
thomson.edge_rhotornorm_on_rztime = rhotornorm_out_edge;
thomson.edge_rhovolnorm_on_rztime = rhovolnorm_out_edge;
end
trace = thomson;
else
trace.data = [];
trace.dim = [];
trace.dimunits = [];
trace.x = [];
trace.t = [];
trace.units = [];
trace.name=[num2str(shot) '/' ppftype '/' tracename];
end
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
case {'te', 'ne'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment