From 8e53829a6d2a6ec35a7294f74d57ea606fc5b68f Mon Sep 17 00:00:00 2001 From: Olivier Sauter <Olivier.Sauter@epfl.ch> Date: Tue, 26 May 2020 16:44:11 +0200 Subject: [PATCH] add xout array for cxrs get profiles --- matlab/TCV/gdat_tcv.m | 26 ++++++++++++++++---------- matlab/TCV/tcv_help_parameters.m | 1 + 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m index 17fc6996..619fb239 100644 --- a/matlab/TCV/gdat_tcv.m +++ b/matlab/TCV/gdat_tcv.m @@ -946,7 +946,6 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') else cxrs_plot = 0; end - gdat_data.gdat_params.cxrs_plot = cxrs_plot; if isfield(params_eff,'source') && ~isempty(params_eff.source) source = params_eff.source; else @@ -961,6 +960,13 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') end gdat_data.gdat_params.cxrs_time_interval = cxrs_time_interval; gdat_data.gdat_params.cxrs_plot = cxrs_plot; + if isfield(params_eff,'cxrs_xout') + cxrs_xout = params_eff.cxrs_xout; + else + cxrs_xout = [linspace(0,1.,201) [1.01:0.01:1.05]]; + end + gdat_data.gdat_params.cxrs_xout = cxrs_xout; + cxrs_params.prof.all.xout = cxrs_xout; fit_tension_default = -100.; if isfield(params_eff,'fit_tension') fit_tension = params_eff.fit_tension; @@ -1977,11 +1983,11 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') % calculate new psiscatvol [psiscatvol,psi_max] = psi_scatvol_zshift(gdat_data, zshift, psitbx_str, gdat_params); end - + % Add the results to the output of gdat gdat_data.psiscatvol = psiscatvol; gdat_data.psi_max = psi_max; - + if ~isempty(psiscatvol.data) && ~ischar(psiscatvol.data) && ~isempty(psi_max.data) && ~ischar(psi_max.data) psi_norm = 1.-psiscatvol.data./repmat(psi_max.data(:).',[size(psiscatvol.data,1),1]); mask = psi_norm < 0; @@ -3476,7 +3482,7 @@ for is = 1:nsys disp(['!!!!!!!!!!!!!!!!!!!!!!!!! cannot continue with ' data_request_eff]) return end - + nodenameeff = ['\results::thomson' edge_str ':' data_request_eff(1:2)]; tracetdi=tdi(nodenameeff); if isempty(tracetdi.data) || ischar(tracetdi.data) || isempty(tracetdi.dim) @@ -3486,7 +3492,7 @@ for is = 1:nsys data_tmp(is).dim = {[],[]}; continue end - + data_tmp(is).data=tracetdi.data.'; % Thomson data as (t,z) tracestd=tdi(['\results::thomson' edge_str ':' data_request_eff(1:2) ':error_bar']); data_tmp(is).error_bar=tracestd.data'; @@ -3514,7 +3520,7 @@ gdat_data.t = time; gdat_data.system=vertcat(data_tmp.system); if status_any,gdat_data.units = data_tmp(isys_ref).units;end -% add fir if ne requested +% add fir if ne requested % NOTE: not a system dependent value so far. Only the main fir ratio was ever stored if strcmp(data_request_eff(1:2),'ne') tracefirrat_data = get_fir_thom_rat_data(shot,time,nverbose); @@ -3561,10 +3567,10 @@ for is = 1:nsys disp(['!!!!!!!!!!!!!!!!!!!!!!!!! cannot continue with ' data_request_eff]) return end - + psi_max_{is} =gdat_tcv([],['\results::thomson',edge_str,':psi_max' substr_liuqe],'nverbose',nverbose); psiscatvol_{is}=gdat_tcv([],['\results::thomson',edge_str,':psiscatvol' substr_liuqe],'nverbose',nverbose); - + status(is) = validdata(psi_max_{is}) & validdata(psiscatvol_{is}); end @@ -3578,12 +3584,12 @@ else % Select and concatenate psi_max_v = [psi_max_{status}]; psiscatvol_v = [psiscatvol_{status}]; - + psi_max = psi_max_v(1); psi_max.data = horzcat(psi_max_v.data); psi_max.data_fullpath = strjoin({psi_max_v.data_fullpath},'; '); psi_max.label = strjoin({psi_max_v.data_fullpath},'; '); - + psiscatvol = psiscatvol_v(1); psiscatvol.data = horzcat(psiscatvol_v.data); z = arrayfun(@(x) x.dim{2}, psiscatvol_v, 'UniformOutput', false); diff --git a/matlab/TCV/tcv_help_parameters.m b/matlab/TCV/tcv_help_parameters.m index 2d232d30..e25c436b 100644 --- a/matlab/TCV/tcv_help_parameters.m +++ b/matlab/TCV/tcv_help_parameters.m @@ -24,6 +24,7 @@ help_struct_all = struct(... % TCV related help_struct_all.cxrs_plot = '0 (default) no plots, 1 get plots from CXRS_get_profiles see ''help CXRS_get_profiles'' for k_plot values'; +help_struct_all.cxrs_xout = 'xout array for rhopol fits, set [] to get CXRS_get_profiles default'; help_struct_all.cxrs_time_interval = ['cxrs: (time_interval can have several nbs) take data and average over time interval(s) only, plots from CXRS_get_profiles are then provided' ... ' as well']; help_struct_all.fit_tension = ['smoothing value used in interpos fitting routine, -30 means ''30 times default value'', thus -1 often a' ... -- GitLab