Skip to content
Snippets Groups Projects

Add multi shot

Merged Olivier Sauter requested to merge add_multi_shot into master
All threads resolved!
Files
2
+ 21
6
@@ -187,10 +187,21 @@ try
@@ -187,10 +187,21 @@ try
else
else
args = [{shot,data_request},varargin_eff];
args = [{shot,data_request},varargin_eff];
end
end
[gdat_data,gdat_params,error_status,varargout] = feval(['gdat_' lower(machine_eff)],args{:});
% treat multiple shot numbers
% because data request can be an actual detailed tree related signal, upper and lower case need to be kept, but other places remain with lower case when case insensitive
if exist('shot') && numel(args) > 0 && isnumeric(args{1})
% needed since some substructure have machine name like mapping_for
args_in = args;
gdat_data.gdat_params.machine = lower(gdat_data.gdat_params.machine);
for i=1:numel(shot)
 
args{1} = shot(i);
 
[gdat_data_i,gdat_params,error_status(i),varargout] = feval(['gdat_' lower(machine_eff)],args{:});
 
gdat_data_i.gdat_params.machine = lower(gdat_data_i.gdat_params.machine);
 
gdat_data(i) = gdat_data_i;
 
end
 
else
 
[gdat_data,gdat_params,error_status,varargout] = feval(['gdat_' lower(machine_eff)],args{:});
 
% because data request can be an actual detailed tree related signal, upper and lower case need to be kept, but other places remain with lower case when case insensitive
 
% needed since some substructure have machine name like mapping_for
 
gdat_data.gdat_params.machine = lower(gdat_data.gdat_params.machine);
 
end
catch ME_gdat
catch ME_gdat
warning(['problems calling gdat_' lower(machine_eff)]);
warning(['problems calling gdat_' lower(machine_eff)]);
@@ -204,9 +215,13 @@ catch ME_gdat
@@ -204,9 +215,13 @@ catch ME_gdat
return
return
end
end
gdat_data.gdat_call = gdat_call;
if numel(gdat_data) > 0
 
for i=1:numel(gdat_data)
 
gdat_data(i).gdat_call = gdat_call;
 
end
 
end
if gdat_data.gdat_params.doplot
if numel(gdat_data) > 0 && gdat_data(1).gdat_params.doplot
try
try
% plot gdat_data versus 1st dim by default, if nb_dims<=2, otherwise do not plot
% plot gdat_data versus 1st dim by default, if nb_dims<=2, otherwise do not plot
hhh = gdat_plot(gdat_data); % return handle to figure
hhh = gdat_plot(gdat_data); % return handle to figure
Loading