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

adapt further to avoid errors when data is empty

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@11663 d63d8f72-b253-0410-a779-e742ad2e26cf
parent ba44f31c
No related branches found
No related tags found
No related merge requests found
......@@ -898,6 +898,10 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
case {'equil'}
% get equil params and time array in gdat_data.t
[gdat_data,exp_name_eff,DIAG,NTIME_Lpf,NTIME,Lpf1_t,Lpf_SOL,M_Rmesh,N_Zmesh] = get_EQ_params(gdat_data);
if isempty(Lpf1_t)
disp('Lpf1_t is empty, probably no data, return')
return
end
% since Lpf depends on time, need to load all first and then loop over time for easier mapping
[qpsi,e]=rdaAUG_eff(shot,DIAG,'Qpsi',exp_name_eff,[],gdat_data.gdat_params.extra_arg_sf2sig);
ndimrho = size(qpsi.data,2);
......@@ -2304,6 +2308,16 @@ function [gdat_data,exp_name_eff,DIAG,NTIME_Lpf,NTIME,Lpf1_t,Lpf_SOL,M_Rmesh,N_Z
% get basic params to be able to read results in EQ-like shotfiles
% M_Rmesh,N_Zmesh only needed for equil when 2D quantities are required
%
exp_name_eff = gdat_data.gdat_params.exp_name;
DIAG = [];
NTIME_Lpf = [];
NTIME = [];
Lpf1_t = [];
Lpf_SOL = [];
M_Rmesh = [];
N_Zmesh = [];
extra_arg_sf2sig_eff_string = '';
if ~strcmp(gdat_data.gdat_params.extra_arg_sf2sig,'[]')
extra_arg_sf2sig_eff_string = [',' gdat_data.gdat_params.extra_arg_sf2sig];
......@@ -2328,12 +2342,16 @@ Lpf_par = rdaAUG_eff(shot,DIAG,'Lpf',exp_name_eff,[],gdat_data.gdat_params.extra
% since June, nb of time points in EQ results is not consistent with NTIME and time
% It seems the first NTIME points are correct, so use this explicitely
NTIME_Lpf = length(Lpf_par.value);
if (NTIME < NTIME_Lpf)
if ~isempty(NTIME) && ~isempty(NTIME_Lpf) && isnumeric(NTIME) && isnumeric(NTIME_Lpf) && (NTIME < NTIME_Lpf)
if gdat_data.gdat_params.nverbose>=3; disp('WARNING: nb of times points smaller then equil results, use first NTIME points'); end
elseif (NTIME > NTIME_Lpf)
elseif ischar(NTIME) || ischar(NTIME_Lpf) || (NTIME > NTIME_Lpf)
if gdat_data.gdat_params.nverbose >= 1
disp('ERROR: nb of times points LARGER then equil results')
disp('this is unexpected, so stop there and ask Olivier.Sauter@epfl.ch')
if ischar(NTIME) || ischar(NTIME_Lpf)
disp(['probably no data, NTIME_Lpf = ' NTIME_Lpf])
else
disp('ERROR: nb of times points LARGER then equil results')
disp('this is unexpected, so stop there and ask Olivier.Sauter@epfl.ch')
end
end
return
end
......
......@@ -200,7 +200,7 @@ if usemdsplus
nb_surfaces_m1 = 40;
nb_xpoints_m1 = 4;
if strcmp(sigtype,'Lpf')
if (min(adata.data)<100000+3 && min(adata.data)~=0) || max(adata.data)>100000*20
if (min(adata.data)<0*100000+3 && min(adata.data)~=0) || max(adata.data)>100000*20
keyboard
disp(['seems to be a problem with Lpf assume 1 sol point and ' num2str(nb_surfaces_m1+1) ' surfaces'])
adata.data(:) = 100000 + nb_surfaces_m1;
......
......@@ -81,7 +81,12 @@ if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty(
if ~isfield(gdat_data,'shot'); return; end % allows to plot if just .t and .data exist
title([gdat_data.gdat_params.machine ' #' num2str(gdat_data.shot)]);
if isfield(gdat_data,'mapping_for')
xlabel(['time [' gdat_data.dimunits{gdat_data.mapping_for.(gdat_data.gdat_params.machine).gdat_timedim} ']']);
dimunits_x = gdat_data.dimunits{gdat_data.mapping_for.(gdat_data.gdat_params.machine).gdat_timedim};
if ischar(dimunits_x)
xlabel(['time [' dimunits_x ']']);
else
xlabel(['time']);
end
else
xlabel(['time']);
end
......
......@@ -68,7 +68,12 @@ for ireq = 1:Nreq
if ~ismember(myrequest,skip)
% build request string
gdat_call{ireq} = sprintf(['gdat_' machine '(%d,''%s'',''doplot'',%d)'],shot,myrequest,doplot);
if strcmp(myrequest,'transp')
shotfile_user='PUETTI';
gdat_call{ireq} = sprintf(['gdat_' machine '(%d,''%s'',''doplot'',%d,''exp_name'',''%s'')'],shot,myrequest,doplot,shotfile_user);
else
gdat_call{ireq} = sprintf(['gdat_' machine '(%d,''%s'',''doplot'',%d)'],shot,myrequest,doplot);
end
% eval call
[err(ireq),telaps(ireq),gdat_results{ireq}] = do_gdat_call(gdat_call{ireq},nverbose);
......
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