From 13d1c09348e02a33d2bfb40ba2f1b9c02537940e Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Fri, 6 Jul 2018 15:02:12 +0000 Subject: [PATCH] add trialindx to icds ec data_request, also change do_plot to plot with just .t and .data git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@10342 d63d8f72-b253-0410-a779-e742ad2e26cf --- crpptbx/TCV/gdat_tcv.m | 9 ++++++++- crpptbx/gdat_plot.m | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crpptbx/TCV/gdat_tcv.m b/crpptbx/TCV/gdat_tcv.m index 803c5c32..3a544d57 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 6f278c25..a044a574 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} ']']); -- GitLab