diff --git a/crpptbx/TCV/gdat_tcv.m b/crpptbx/TCV/gdat_tcv.m index 803c5c32008bc5a05621019c0348ed7609c2f263..3a544d57a6d7a853de3ae9b72062f95f60cc5436 100644 --- a/crpptbx/TCV/gdat_tcv.m +++ b/crpptbx/TCV/gdat_tcv.m @@ -1009,6 +1009,9 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') gdat_data.(sources_avail{i}).data_fullpath=[]; gdat_data.(sources_avail{i}).label=[]; end + if ~isfield(gdat_data.gdat_params,'trialindx') || gdat_data.gdat_params.trialindx < 0 + gdat_data.gdat_params.trialindx = []; + end if ~isfield(gdat_data.gdat_params,'source') || isempty(gdat_data.gdat_params.source) gdat_data.gdat_params.source = sources_avail; elseif ~iscell(gdat_data.gdat_params.source) @@ -1057,7 +1060,11 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') ec_help = ''; % EC if strcmp(lower(source_icd.ec),'toray') - [ptot,icdtot] = astra_tcv_EC_exp(shot); % centralized function for toray nodes + if isempty(gdat_data.gdat_params.trialindx) + [ptot,icdtot] = astra_tcv_EC_exp(shot); % centralized function for toray nodes + else + [ptot,icdtot] = astra_tcv_EC_exp(shot,[],[],[],[],[],gdat_data.gdat_params.trialindx); % centralized function for toray nodes + end data_fullpath = 'from toray nodes using astra_tcv_EC_exp(shot)'; ec_help = 'from toray icdint with extracting of effective Icd for given launcher depending on nb rays used'; if isfield(icdtot,'tgrid'); icdtot.t = icdtot.tgrid; end diff --git a/crpptbx/gdat_plot.m b/crpptbx/gdat_plot.m index 6f278c25ecee8cb8f3ce3c5bdd4cd06aa4f2702b..a044a5747da9925841236dff848ba15883ec0014 100644 --- a/crpptbx/gdat_plot.m +++ b/crpptbx/gdat_plot.m @@ -30,7 +30,7 @@ end doplot=1; if isfield(gdat_plot_params,'doplot') && ~isempty(gdat_plot_params.doplot) doplot = gdat_plot_params.doplot; -elseif isfield(gdat_data.gdat_params,'doplot') || ~isempty(gdat_data.gdat_params.doplot) +elseif isfield(gdat_data,'gdat_params') && isfield(gdat_data.gdat_params,'doplot') && ~isempty(gdat_data.gdat_params.doplot) if gdat_data.gdat_params.doplot~=0 % assume one does not call gdat_plot not to plot doplot = gdat_data.gdat_params.doplot; end @@ -50,7 +50,7 @@ if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty( fighandle = figure(abs(doplot)); hold all end - if strcmp(gdat_data.gdat_request,'eqdsk') + if isfield(gdat_data,'gdat_request') && strcmp(gdat_data.gdat_request,'eqdsk') % special case, plot contours of first equil endstr = ''; if iscell(gdat_data.eqdsk); endstr = '{1}'; end @@ -77,6 +77,7 @@ if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty( end return end + 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} ']']);