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

add IDE, IDG option also for 1D signals ala FPG like li, adding 'source','idg'

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@6961 d63d8f72-b253-0410-a779-e742ad2e26cf
parent b49a8d8c
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,6 @@ default_machine = 'aug'; ...@@ -68,7 +68,6 @@ default_machine = 'aug';
gdat_params.machine=default_machine; gdat_params.machine=default_machine;
gdat_params.doplot = 0; gdat_params.doplot = 0;
gdat_params.exp_name = 'AUGD'; gdat_params.exp_name = 'AUGD';
gdat_params.equil = 'EQI';
gdat_params.nverbose = 1; gdat_params.nverbose = 1;
% construct list of keywords from global set of keywords and specific AUG set % construct list of keywords from global set of keywords and specific AUG set
...@@ -198,6 +197,10 @@ if (nargin>=ivarargin_first_char) ...@@ -198,6 +197,10 @@ if (nargin>=ivarargin_first_char)
end end
end end
data_request_eff = gdat_params.data_request; % in case was defined in pairs data_request_eff = gdat_params.data_request; % in case was defined in pairs
% default equil:
if ~isfield(gdat_params,'equil'); gdat_params.equil = 'EQI'; end
if isfield(gdat_params,'source') && (strcmp(lower(gdat_params.source),'ide') || strcmp(lower(gdat_params.source),'idg') ...
|| strcmp(lower(gdat_params.source),'ida')); gdat_params.equil = 'IDE'; end
% if it is a request_keyword can obtain description: % if it is a request_keyword can obtain description:
if ischar(data_request_eff) || length(data_request_eff)==1 if ischar(data_request_eff) || length(data_request_eff)==1
...@@ -259,6 +262,16 @@ if strcmp(mapping_for_aug.method,'signal') ...@@ -259,6 +262,16 @@ if strcmp(mapping_for_aug.method,'signal')
disp(['expects at least 2 cells in expression, mapping_for_aug.expression = ' mapping_for_aug.expression]); disp(['expects at least 2 cells in expression, mapping_for_aug.expression = ' mapping_for_aug.expression]);
return return
end end
% allow changing main source with simple signals, 'source' parameter relates to mapping_for_aug.expression{1}
if ~isfield(gdat_data.gdat_params,'source') || isempty(gdat_data.gdat_params.source) || ~ischar(gdat_data.gdat_params.source)
gdat_data.gdat_params.source = mapping_for_aug.expression{1};
else
% special case for IDE instead of IDG when FPG is present value
if strcmp(lower(gdat_data.gdat_params.source),'ide') && strcmp(lower(mapping_for_aug.expression{1}),'fpg')
gdat_data.gdat_params.source = 'IDG';
end
mapping_for_aug.expression{1} = gdat_data.gdat_params.source;
end
gdat_data.gdat_params.exp_name = exp_location; gdat_data.gdat_params.exp_name = exp_location;
[aatmp,error_status]=rdaAUG_eff(shot,mapping_for_aug.expression{1},mapping_for_aug.expression{2},exp_location); [aatmp,error_status]=rdaAUG_eff(shot,mapping_for_aug.expression{1},mapping_for_aug.expression{2},exp_location);
if error_status~=0 if error_status~=0
...@@ -765,7 +778,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase') ...@@ -765,7 +778,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
for itime=1:length(time_eqdsks) for itime=1:length(time_eqdsks)
time_eff = time_eqdsks(itime); time_eff = time_eqdsks(itime);
% use read_results updated to effectively obtain an eqdsk with sign correct with COCOS=2 % use read_results updated to effectively obtain an eqdsk with sign correct with COCOS=2
[eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(equil,time_eff,gdat_data.gdat_params.zshift); [eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(equil,time_eff,gdat_data.gdat_params.zshift,'source',gdat_data.gdat_params.equil);
eqdskAUG.fnamefull = fullfile(['/tmp/' getenv('USER')],['EQDSK_' num2str(shot) 't' num2str(time_eff,'%.4f')]); eqdskAUG.fnamefull = fullfile(['/tmp/' getenv('USER')],['EQDSK_' num2str(shot) 't' num2str(time_eff,'%.4f')]);
cocos_out = equil.cocos; cocos_out = equil.cocos;
if isfield(gdat_data.gdat_params,'cocos') && ~isempty(gdat_data.gdat_params.cocos) if isfield(gdat_data.gdat_params,'cocos') && ~isempty(gdat_data.gdat_params.cocos)
...@@ -838,7 +851,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase') ...@@ -838,7 +851,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
Ri=adapt_rda(Ri,NTIME,M_Rmesh,itotransposeback); Ri=adapt_rda(Ri,NTIME,M_Rmesh,itotransposeback);
[Zj,e]=rdaAUG_eff(shot,DIAG,'Zj',exp_name_eff); [Zj,e]=rdaAUG_eff(shot,DIAG,'Zj',exp_name_eff);
Zj=adapt_rda(Zj,NTIME,N_Zmesh,itotransposeback); Zj=adapt_rda(Zj,NTIME,N_Zmesh,itotransposeback);
[PFM_tree,e]=rdaAUG_eff(shot,DIAG,'PFM',exp_name_eff); [PFM_tree,e]=rdaAUG_eff(shot,DIAG,'PFM','-raw','-exp',exp_name_eff); % -raw necessary for IDE
PFM_tree=adaptPFM_rda(PFM_tree,M_Rmesh,N_Zmesh,NTIME); PFM_tree=adaptPFM_rda(PFM_tree,M_Rmesh,N_Zmesh,NTIME);
[Pres,e]=rdaAUG_eff(shot,DIAG,'Pres',exp_name_eff); [Pres,e]=rdaAUG_eff(shot,DIAG,'Pres',exp_name_eff);
Pres=adapt_rda(Pres,NTIME,2*ndimrho,itotransposeback); Pres=adapt_rda(Pres,NTIME,2*ndimrho,itotransposeback);
...@@ -850,7 +863,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase') ...@@ -850,7 +863,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
else else
FFP.value=NaN*ones(NTIME,max(Lpf1_t)); FFP.value=NaN*ones(NTIME,max(Lpf1_t));
end end
if strcmp(DIAG,'EQI') || strcmp(DIAG,'EQH') if strcmp(DIAG,'EQI') || strcmp(DIAG,'EQH') || strcmp(DIAG,'IDE')
[Rinv,e]=rdaAUG_eff(shot,DIAG,'Rinv',exp_name_eff); [Rinv,e]=rdaAUG_eff(shot,DIAG,'Rinv',exp_name_eff);
Rinv=adapt_rda(Rinv,NTIME,ndimrho,itotransposeback); Rinv=adapt_rda(Rinv,NTIME,ndimrho,itotransposeback);
[R2inv,e]=rdaAUG_eff(shot,DIAG,'R2inv',exp_name_eff); [R2inv,e]=rdaAUG_eff(shot,DIAG,'R2inv',exp_name_eff);
...@@ -859,8 +872,12 @@ elseif strcmp(mapping_for_aug.method,'switchcase') ...@@ -859,8 +872,12 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
Bave=adapt_rda(Bave,NTIME,ndimrho,itotransposeback); Bave=adapt_rda(Bave,NTIME,ndimrho,itotransposeback);
[B2ave,e]=rdaAUG_eff(shot,DIAG,'B2ave',exp_name_eff); [B2ave,e]=rdaAUG_eff(shot,DIAG,'B2ave',exp_name_eff);
B2ave=adapt_rda(B2ave,NTIME,ndimrho,itotransposeback); B2ave=adapt_rda(B2ave,NTIME,ndimrho,itotransposeback);
[FTRA,e]=rdaAUG_eff(shot,DIAG,'FTRA',exp_name_eff); if strcmp(DIAG,'IDE')
FTRA=adapt_rda(FTRA,NTIME,ndimrho,itotransposeback); FTRA.value=[];
else
[FTRA,e]=rdaAUG_eff(shot,DIAG,'FTRA',exp_name_eff);
FTRA=adapt_rda(FTRA,NTIME,ndimrho,itotransposeback);
end
else else
Rinv.value=[]; R2inv.value=[]; Bave.value=[]; B2ave.value=[]; FTRA.value=[]; Rinv.value=[]; R2inv.value=[]; Bave.value=[]; B2ave.value=[]; FTRA.value=[];
end end
...@@ -1058,7 +1075,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase') ...@@ -1058,7 +1075,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {'ne_rho', 'te_rho', 'nete_rho'} case {'ne_rho', 'te_rho', 'nete_rho'}
if ~isfield(gdat_data.gdat_params,'fit') || isempty(gdat_data.gdat_params.fit) || ~isnumeric(gdat_data.gdat_params.fit) if ~isfield(gdat_data.gdat_params,'fit') || isempty(gdat_data.gdat_params.fit) || ~isnumeric(gdat_data.gdat_params.fit)
gdat_data.gdat_params.fit = 0; gdat_data.gdat_params.fit = 1; % default do fit
end end
params_eff = gdat_data.gdat_params; params_eff = gdat_data.gdat_params;
params_eff.data_request=data_request_eff(1:2); % start with ne if nete_rho params_eff.data_request=data_request_eff(1:2); % start with ne if nete_rho
......
...@@ -4,6 +4,11 @@ function [eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(shot,time,zshift,var ...@@ -4,6 +4,11 @@ function [eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(shot,time,zshift,var
% %
% if shot is a structure assumes obtained from gdat(shot,'equil',...); % if shot is a structure assumes obtained from gdat(shot,'equil',...);
% %
% varargin{1:2}: 'source','EQI' (default) or 'source','IDE' (used in gdat(...,'equil') )
%
% [eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(shot,time);
% [eqdskAUG, equil_all_t, equil_t_index]=geteqdskAUG(shot,time,[],'source','IDE');
%
% you can then do: % you can then do:
% write_eqdsk('fname',eqdskAUG,17); % EQI is COCOS=17 by default % write_eqdsk('fname',eqdskAUG,17); % EQI is COCOS=17 by default
% write_eqdsk('fname',eqdskAUG,[17 11]); % if you want an ITER version with COCOS=11 % write_eqdsk('fname',eqdskAUG,[17 11]); % if you want an ITER version with COCOS=11
...@@ -21,14 +26,27 @@ else ...@@ -21,14 +26,27 @@ else
time_eff = time; time_eff = time;
end end
if ~exist('zshift') if ~exist('zshift') || isempty(zshift) || ~isnumeric(zshift)
zshift_eff = 0.; % no shift zshift_eff = 0.; % no shift
else else
zshift_eff = zshift; zshift_eff = zshift;
end end
if nargin >= 5 && ~isempty(varargin{1})
if ~isempty(varargin{2})
equil_source = varargin{2}
else
disp(['Warning source for equil in geteqdskAUG not defined']);
return;
end
else
equil_source = 'EQI';
end
equilpar_source = 'FPG';
if strcmp(lower(equil_source),'ide'); equilpar_source = 'IDG'; end
if isnumeric(shot) if isnumeric(shot)
equil=gdat(shot,'equil'); equil=gdat(shot,'equil','equil',equil_source);
else else
equil = shot; equil = shot;
shot = equil.shot; shot = equil.shot;
...@@ -78,10 +96,10 @@ fedge=eqdsk.r0.*eqdsk.b0; ...@@ -78,10 +96,10 @@ fedge=eqdsk.r0.*eqdsk.b0;
F2 = psisign.*2.*F2_05 + fedge.^2; F2 = psisign.*2.*F2_05 + fedge.^2;
eqdsk.F = sqrt(F2)*sign(eqdsk.b0); eqdsk.F = sqrt(F2)*sign(eqdsk.b0);
rmag=gdat(shot,'rmag'); rmag=gdat(shot,'rmag','source',equilpar_source);
[zz itrmag]=min(abs(rmag.t-time_eff)); [zz itrmag]=min(abs(rmag.t-time_eff));
eqdsk.raxis = rmag.data(itrmag); eqdsk.raxis = rmag.data(itrmag);
zmag=gdat(shot,'zmag'); zmag=gdat(shot,'zmag','source',equilpar_source);
eqdsk.zaxis = zmag.data(itrmag) - eqdsk.zshift; eqdsk.zaxis = zmag.data(itrmag) - eqdsk.zshift;
% get plasma boundary % get plasma boundary
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment