Commit 7bcec776 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

try fix getting R_time through mds

inor bug fix in gdat_tcv and gdat_plot as well
parent 88d25819
Pipeline #55816 passed with stage
in 3 minutes and 9 seconds
......@@ -540,7 +540,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
try
% eval(['[r_time]=sf2ab(diag_name,shot,r_node,''-exp'',exp_name_eff' extra_arg_sf2sig_eff_string ');']);
% both for CEZ and CMZ, and.. Ti:1 is ok, otherwise introduce string above
[r_time,err]=rdaAUG_eff(shot,diag_name,r_node,exp_name_eff,[],extra_arg_sf2sig_eff_string,['area-base:' r_node ':1']);
[r_time,err]=rdaAUG_eff(shot,diag_name,'Ti',exp_name_eff,[],extra_arg_sf2sig_eff_string,['area-base:' r_node ':1']);
catch ME_R_time
% assume no shotfile
disp(getReport(ME_R_time))
......@@ -552,7 +552,7 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
gdat_data.r(inotok) = NaN;
try
% eval(['[z_time]=sf2ab(diag_name,shot,z_node,''-exp'',exp_name_eff' extra_arg_sf2sig_eff_string ');']);
[z_time,err]=rdaAUG_eff(shot,diag_name,z_node,exp_name_eff,[],extra_arg_sf2sig_eff_string,['area-base:' z_node ':1']);
[z_time,err]=rdaAUG_eff(shot,diag_name,'Ti',exp_name_eff,[],extra_arg_sf2sig_eff_string,['area-base:' z_node ':1']);
gdat_data.z = z_time.data;
inotok=find(gdat_data.z<=0);
gdat_data.z(inotok) = NaN;
......
......@@ -180,10 +180,12 @@ if usemdsplus
end
if ~isempty(area_time_base_name)
if nargin_eff>=5 & ~isempty(varargin_eff{1})
eval(['[data,error]=mdsvalue(''_rdaeff' user diagname '=augdiag(' num2str(shot) ',"' diagname '","' area_time_base_name '","' shotfile_exp ...
eval(['[data,error]=mdsvalue(''_rdaeff' user diagname '=augdiag(' num2str(shot) ',"' diagname '","' sigtype '","' shotfile_exp ...
'",' ed_number ',' num2str(varargin_eff{1}(1),'%.14f') ',' num2str(varargin_eff{1}(end),'%.14f') ')'');']);
% $$$ eval(['[data,error]=mdsvalue(''_rdaeff' user diagname '=augdiag(' num2str(shot) ',"' diagname '","' area_time_base_name '","' shotfile_exp ...
% $$$ '",' ed_number ',' num2str(varargin_eff{1}(1),'%.14f') ',' num2str(varargin_eff{1}(end),'%.14f') ')'');']);
else
eval(['[data,error]=mdsvalue(''_rdaeff' user diagname '=augdiag(' num2str(shot) ',"' diagname '","' area_time_base_name '","' shotfile_exp ...
eval(['[data,error]=mdsvalue(''_rdaeff' user diagname '=augdiag(' num2str(shot) ',"' diagname '","' sigtype '","' shotfile_exp ...
'",' ed_number ',,,_oshot' user diagname ',_oed' user diagname ')'');']);
end
if ~isempty(area_time_base_dimof)
......
......@@ -1174,7 +1174,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
for itime=1:length(time)
time_eff = time(itime);
% use read_results updated to effectively obtain an eqdsk with sign correct with COCOS=2
[fnames_readresults]=read_results_for_chease(shot,time_eff,liuqe_version,3,[],[],[],zshift,0,1,nrz_out);
[fnames_readresults]=read_results_for_chease(shot,time_eff,liuqe_version_eff,3,[],[],[],zshift,0,1,nrz_out);
cocos_read_results_for_chease = 17;
if isempty(fnames_readresults)
if gdat_params.nverbose>=1;
......@@ -1996,6 +1996,8 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
% Add the results to the output of gdat
gdat_data.psiscatvol = psiscatvol;
gdat_data.psi_max = psi_max;
r_thomson = gdat_tcv(gdat_data.shot,'\DIAGZ::THOMSON_SET_UP:RADIAL_POS');
gdat_data.r_thomson = r_thomson;
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]);
......@@ -2012,13 +2014,11 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
r_edge = gdat(gdat_data.shot,params_eff);
params_eff.data_request='z_contour_edge';
z_edge = gdat(gdat_data.shot,params_eff);
Z_thomson = psiscatvol.dim{1};
%OS: not ok for old shots: R_thomson = gdat_tcv(gdat_data.shot,'\tcv_shot::top.diagz.measurements.thomson.set_up:radial_pos');
R_thomson.data = 0.90*ones(size(Z_thomson));
z_thomson = psiscatvol.dim{1};
psinorm_max = max(max(psi_norm));
for it=1:numel(psiscatvol.dim{2})
iteq=iround_os(r_edge.t,psiscatvol.dim{2}(it));
inpol=inpolygon(R_thomson.data,Z_thomson,r_edge.data(:,iteq),z_edge.data(:,iteq));
inpol=inpolygon(r_thomson.data,z_thomson,r_edge.data(:,iteq),z_edge.data(:,iteq));
is_private_flux = [psi_norm(:,it) < 1] & ~inpol;
% at this stage set private flux "rho" to max, could use 1.3^2
psi_norm(is_private_flux,it) = psinorm_max;
......@@ -3688,7 +3688,7 @@ switch numel(zshifteff)
end
% Get LIUQE times corresponding to TS times
t_eq = t_psi(iround(t_psi,t_th));
t_eq = t_psi(iround_os(t_psi,t_th));
% Get PSI map
psi = psitbxtcv(gdat_data.shot,t_eq,'*0',psitbx_str);
......
......@@ -64,7 +64,11 @@ if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty(
elseif any(find(size(gdat_data.data)==length(gdat_data.t)))
try
if length(size(gdat_data.data))<=2
plot(gdat_data.t,gdat_data.data);
if isnumeric(gdat_data.t)
plot(gdat_data.t,gdat_data.data);
elseif iscell(gdat_data.t)
plot(str2num(cell2mat(gdat_data.t)),gdat_data.data);
end
else
disp('WARNING')
disp(['size(gdat_data.data) = ' num2str(size(gdat_data.data)) ', >2D thus do not try to plot'])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment