Skip to content
Snippets Groups Projects
Commit 0c7b6135 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

Merge branch 'small_fixes' into 'master'

Small fixes

See merge request spc/tcv/tbx/gdat!14
parents 7c7a1c43 e11e45b2
No related branches found
No related tags found
1 merge request!14Small fixes
Pipeline #17878 passed
...@@ -63,6 +63,7 @@ if (isempty(rhotor_norm.x) ||isempty(rhotor_norm.t) || isempty(rhotor_norm.data) ...@@ -63,6 +63,7 @@ if (isempty(rhotor_norm.x) ||isempty(rhotor_norm.t) || isempty(rhotor_norm.data)
end end
it_rt = iround_os(rhotor_norm.t,gdat_data.t); it_rt = iround_os(rhotor_norm.t,gdat_data.t);
it_vol = iround_os(rhovol.t,gdat_data.t); it_vol = iround_os(rhovol.t,gdat_data.t);
tens0=0.; % need value of tension even if =0 so that interpos OK with only one xout point
for it=1:length(gdat_data.t) for it=1:length(gdat_data.t)
% do an interpolation on closest point to avoid 2D interp % do an interpolation on closest point to avoid 2D interp
it_rt_eff = it_rt(it); it_rt_eff = it_rt(it);
...@@ -86,16 +87,16 @@ for it=1:length(gdat_data.t) ...@@ -86,16 +87,16 @@ for it=1:length(gdat_data.t)
nb_ii = length(ii); nb_ii = length(ii);
if ~isempty(rhotor_norm.x) && ~isempty(rhotor_norm.data) if ~isempty(rhotor_norm.x) && ~isempty(rhotor_norm.data)
if ndim_x_rhotor==1 if ndim_x_rhotor==1
gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x,rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii)); gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x,rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii),tens0);
else else
gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x(:,it_rt_eff),rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii)); gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x(:,it_rt_eff),rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii),tens0);
end end
end end
if ~isempty(rhovol.x) && ~isempty(rhovol.data) if ~isempty(rhovol.x) && ~isempty(rhovol.data)
if ndim_x_rhovol==1 if ndim_x_rhovol==1
gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x,rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii)); gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x,rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii),tens0);
else else
gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x(:,it_vol_eff),rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii)); gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x(:,it_vol_eff),rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii),tens0);
end end
end end
end end
...@@ -105,16 +106,16 @@ for it=1:length(gdat_data.t) ...@@ -105,16 +106,16 @@ for it=1:length(gdat_data.t)
if ~isempty(rhotor_norm.x) && ~isempty(rhotor_norm.data) if ~isempty(rhotor_norm.x) && ~isempty(rhotor_norm.data)
nb_ii = length(ii); nb_ii = length(ii);
if ndim_x_rhotor==1 if ndim_x_rhotor==1
gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x,rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii,it)); gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x,rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii,it),tens0);
else else
gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x(:,it_rt_eff),rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii,it)); gdat_data.grids_1d.rhotornorm(1:nb_ii,it)=interpos(23,rhotor_norm.x(:,it_rt_eff),rhotor_norm.data(:,it_rt_eff),gdat_data.grids_1d.rhopolnorm(ii,it),tens0);
end end
end end
if ~isempty(rhovol.x) && ~isempty(rhovol.data) if ~isempty(rhovol.x) && ~isempty(rhovol.data)
if ndim_x_rhovol==1 if ndim_x_rhovol==1
gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x,rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii,it)); gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x,rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii,it),tens0);
else else
gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x(:,it_vol_eff),rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii,it)); gdat_data.grids_1d.rhovolnorm(1:nb_ii,it)=interpos(23,rhovol.x(:,it_vol_eff),rhovol.data(:,it_vol_eff),gdat_data.grids_1d.rhopolnorm(ii,it),tens0);
end end
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment