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

add R to ece and eced keywords in gdat and used in sawteeth as well

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4447 d63d8f72-b253-0410-a779-e742ad2e26cf
parent e7e071e3
No related branches found
No related tags found
No related merge requests found
......@@ -332,7 +332,8 @@ AUGkeywrdcase(AUGsig.issx_h)=AUGkeywrdall(AUGsig.issx_h);
AUGkeywrdcase(AUGsig.issx_i)=AUGkeywrdall(AUGsig.issx_i);
AUGkeywrdcase(AUGsig.issx_j)=AUGkeywrdall(AUGsig.issx_j);
AUGkeywrdcase(AUGsig.issx)=AUGkeywrdall(AUGsig.issx);
%AUGkeywrdcase(AUGsig.iece)=AUGkeywrdall(AUGsig.iece);
AUGkeywrdcase(AUGsig.iece)=AUGkeywrdall(AUGsig.iece);
AUGkeywrdcase(AUGsig.ieced)=AUGkeywrdall(AUGsig.ieced);
AUGkeywrdcase(AUGsig.icxrs)=AUGkeywrdall(AUGsig.icxrs);
AUGkeywrdcase(AUGsig.icxrs_rho)=AUGkeywrdall(AUGsig.icxrs_rho);
AUGkeywrdcase(AUGsig.ipgyro)=AUGkeywrdall(AUGsig.ipgyro); % idem
......@@ -656,6 +657,70 @@ switch AUGkeywrdcase{index}
trace.name=[num2str(shot) '/' ppftype '/' tracename];
end
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
case {'ece','eced'}
% LOAD MULTI CHANNEL DATA
% load AUG ece data
shotfile_exp_eff = AUGexplocation{index};
if nargin>=3 & ~isempty(varargin{1})
starti=varargin{1}(1);
endi=varargin{1}(2);
else
starti=1;
endi=30;
end
if nargin>=4 & ~isempty(varargin{2})
status=varargin{2};
else
status=ones(endi-starti+1,1);
end
if nargin>=6 & ~isempty(varargin{4})
timerange=varargin{4};
else
timerange=[0 10];
end
if nargin>=7 & ~isempty(varargin{5})
nth=varargin{5};
else
nth=1;
end
trace.t=[];
trace.x=[];
ppftype=AUGsiglocation{1,index};
tracename=AUGsiglocation{2,index};
[a,e]=rdaAUG_eff(shot,ppftype,tracename,shotfile_exp_eff,timerange);
starti=1;
endi=size(a.value,1);
trace=a;
trace.dim=[{[starti:endi]'} ; {trace.t}];
trace.x=trace.dim{1};
trace.dimunits=[{'channels'} ; {'time [s]'}];
trace.units='W/m^2';
trace.name=[num2str(shot) '/' ppftype '/' tracename];
% keep only nth points
trace.t=trace.t(1:nth:end);
trace.data=trace.data(:,1:nth:end);
trace.dim{2}=trace.t;
% get R
[aR,e]=rdaAUG_eff(shot,ppftype,'R-A',shotfile_exp_eff,timerange);
domatchRtime=1;
if domatchRtime
% interpolate R structure on ece data time array, to ease plot vs R
for i=starti:endi
radius.data(i,:) = interp1(aR.t,aR.data(i,:),trace.t);
end
radius.t=trace.t;
else
radius.data = aR.data;
radius.t=aR.t;
end
ij=find(trace.data==0);
trace.data(ij)=NaN;
varargout{1}={radius};
trace.R=radius;
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
case {'cxrs', 'cxrs_rho'}
% LOAD CEZ data
......@@ -1038,18 +1103,32 @@ switch AUGkeywrdcase{index}
trace_all.ecrh1(i) = a;
trace_all.pgyro(:,i) = reshape(a.data,nb_timepoints,1);
end
a = sf2par('ECS',shot,'gyr_freq',['P_sy1_g' num2str(i)]);
try
a = sf2par('ECS',shot,'gyr_freq',['P_sy1_g' num2str(i)]);
catch
% gyr_freq not present (old shots for example)
a=[];
end
if isempty(a)
else
trace_all.freq_ecrh1(i) = a;
trace_all.freq_ech(i) = a.value;
end
a = sf2par('ECS',shot,'GPolPos',['P_sy1_g' num2str(i)]);
try
a = sf2par('ECS',shot,'GPolPos',['P_sy1_g' num2str(i)]);
catch
% GPolPos not present
a=[];
end
if isempty(a)
else
trace_all.polpos_ecs(i) = a.value;
end
a = sf2par('ECS',shot,'GTorPos',['P_sy1_g' num2str(i)]);
try
a = sf2par('ECS',shot,'GTorPos',['P_sy1_g' num2str(i)]);
catch
a=[];
end
if isempty(a)
else
trace_all.torpos_ecs(i) = a.value;
......@@ -1062,18 +1141,30 @@ switch AUGkeywrdcase{index}
trace_all.ecrh2(i) = a;
trace_all.pgyro(:,i+4) = reshape(a.data,nb_timepoints,1);
end
a = sf2par('ECS',shot,'gyr_freq',['P_sy2_g' num2str(i)]);
try
a = sf2par('ECS',shot,'gyr_freq',['P_sy2_g' num2str(i)]);
catch
a=[];
end
if isempty(a)
else
trace_all.freq_ecrh2(i) = a;
trace_all.freq_ech(i+4) = a.value;
end
a = sf2par('ECS',shot,'GPolPos',['P_sy2_g' num2str(i)]);
try
a = sf2par('ECS',shot,'GPolPos',['P_sy2_g' num2str(i)]);
catch
a=[];
end
if isempty(a)
else
trace_all.polpos_ecs(i+4) = a.value;
end
a = sf2par('ECS',shot,'GTorPos',['P_sy2_g' num2str(i)]);
try
a = sf2par('ECS',shot,'GTorPos',['P_sy2_g' num2str(i)]);
catch
a=[];
end
if isempty(a)
else
trace_all.torpos_ecs(i+4) = a.value;
......
......@@ -26,14 +26,14 @@ if nargin >= 2
% asks from list
if ~isempty(tb_fields)
h_for_waitfor=figure;
global field_chosen2
global field_chosen
h1=uicontrol('Style','listbox','string',tb_fields,'pos',[20 20 200 300],'Max',20, ...
'callback', ['global field_chosen2;field_chosen2=get(gcbo,''value'') ;']);
'callback', ['global field_chosen;field_chosen=get(gcbo,''value'') ;']);
h2=uicontrol('Style','text','pos',[20 330 200 30],'string','choose fields to plot (ctrl-enter for multiple choices) then quit');
h3=uicontrol('Style','pushbutton','string','quit','pos',[300 20 30 20],'callback', ['field_chosen=get(' num2str(h1,'%.15e') ',''value''); close gcf;']);
h3=uicontrol('Style','pushbutton','string','quit','pos',[300 20 30 20],'callback', ['close gcf;']);
waitfor(h_for_waitfor);
list_fields = tb_fields(field_chosen2);
clear global field_chosen2
list_fields = tb_fields(field_chosen);
clear global field_chosen
else
disp('torbeam_out_struct empty');
return
......
......@@ -28,7 +28,7 @@ end
time_array=linspace(0,10,10/0.05);
file_out_prefix = ['tbdemo_' num2str(abs(shot)) '_gyro'];
if nargin>=3
if nargin>=3 && mod(length(varargin),2)==0
for i=1:2:length(varargin)-1
if ~isempty(varargin{i}) && ~isempty(varargin{i+1})
switch lower(varargin{i})
......@@ -49,10 +49,21 @@ if shot>0
run_with_IDA = 0;
% test if IDA present
hhh = sfread('IDA', shot);
if hhh.handle~=0;
run_with_IDA = 1;
disp('use IDA since shotfile exists')
hhIDA = sfread('IDA', shot);
if hhIDA.handle~=0;
netest=gdat(shot,'IDA/ne');
tetest=gdat(shot,'IDA/te');
if ~isempty(netest.data) && ~isempty(tetest.data)
run_with_IDA = 1;
disp('use IDA since shotfile exists')
end
end
hhDLP = sfread('DLP', shot);
dousedcr = '';
if hhDLP.handle~=0;
dousedcr = '-usedcr';
disp('can usedcr since DLP shotfile exists');
end
for igyro=1:8
......@@ -72,7 +83,7 @@ if shot>0
% [a,b]=unix(['ssh sxaug21.aug.ipp.mpg.de ~rem/public/tbm_demo/tbmdemo -batch -silent -shot ' num2str(shot) ' -time ' num2str(time_array(itt_tok(j))) ' -system ' num2str(igyro) ' -usedcr -eqdiag EQI -betapol -usemirror -cdrive 1 >> ' ['.' filename]]);
% [a,b]=unix(['ssh sxaug21.aug.ipp.mpg.de ~rem/public/tbm_demo/tbmdemo -batch -silent -shot ' num2str(shot) ' -time ' num2str(time_array(itt_tok(j))) ' -system ' num2str(igyro) ' -ntm -usedcr -eqdiag EQI -betapol -usemirror -cdrive 1 >> ' ['.' filename]]);
[a,b]=unix(['~rem/public/tbm_demo/tbmdemo -batch -silent -shot ' num2str(shot) ' -time ' num2str(time_array(itt_tok(j))) ' -system ' num2str(igyro) ' -ntm -usedcr -eqdiag EQI -betapol -usemirror -cdrive 1 >> ' ['.' filename]]);
[a,b]=unix(['~rem/public/tbm_demo/tbmdemo -batch -silent -shot ' num2str(shot) ' -time ' num2str(time_array(itt_tok(j))) ' -system ' num2str(igyro) ' -ntm ' dousedcr ' -eqdiag EQI -betapol -usemirror -cdrive 1 >> ' ['.' filename]]);
else
% -shot 29672 -time 3.0 -system 5 -batch -ntm -silent -usemirror -cdrive 1
% [a,b]=unix(['ssh sxaug21.aug.ipp.mpg.de ~rem/public/tbm_demo/tbmdemo -batch -silent -shot ' num2str(shot) ' -time ' num2str(time_array(itt_tok(j))) ' -system ' num2str(igyro) ' -ntm -usemirror -cdrive 1 >> ' ['.' filename]]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment