Skip to content
Snippets Groups Projects
Commit 3d216872 authored by Antonia Frank's avatar Antonia Frank
Browse files

add rhotor to all time slices and fix nbi rhotor

parent c7d35459
No related branches found
No related tags found
1 merge request!165Core sources tcv2ids2database
Pipeline #206412 passed
...@@ -322,14 +322,16 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources ...@@ -322,14 +322,16 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
% interpolate the rho_pol & rho_tor on ec_powers_tgrid % interpolate the rho_pol & rho_tor on ec_powers_tgrid
interp_rho_pol = zeros(n_rho,nt_ec_out); interp_rho_pol = zeros(n_rho,nt_ec_out);
interp_rho_tor = zeros(n_rho,nt_ec_out); interp_rho_tor = repmat(rho_tor_norm(:,1),1,nt_ec_out);
for irho = 1:n_rho for irho = 1:n_rho
interp_rho_pol(irho,3:end-2) = interpos(21,ec_tgrid_toray,rho_pol_norm(irho,:),ec_tgrid_out(3:end-2)); interp_rho_pol(irho,3:end-2) = interpos(21,ec_tgrid_toray,rho_pol_norm(irho,:),ec_tgrid_out(3:end-2));
interp_rho_tor(irho,3:end-2) = interpos(21,ec_tgrid_toray,rho_tor_norm(irho,:),ec_tgrid_out(3:end-2)); %interp_rho_tor(irho,3:end-2) = interpos(21,ec_tgrid_toray,rho_tor_norm(irho,:),ec_tgrid_out(3:end-2));
end end
% fill rho_pol just outside of TORAY times(zero power) with the known profiles one time slice after/before % fill rho_pol just outside of TORAY times(zero power) with the known profiles one time slice after/before
interp_rho_pol(:,2) = interp_rho_pol(:,3); interp_rho_pol(:,end-1) = interp_rho_pol(:,end-2); interp_rho_pol(:,2) = interp_rho_pol(:,3); interp_rho_pol(:,end-1) = interp_rho_pol(:,end-2);
%interp_rho_tor(:,2) = interp_rho_tor(:,3); interp_rho_tor(:,end-1) = interp_rho_tor(:,end-2);
% normalised & interpolated profiles * p_ec_injected on interp_tgrid % normalised & interpolated profiles * p_ec_injected on interp_tgrid
interp_p_dens = zeros(n_rho,nb_launchers+1,nt_ec_out); interp_p_dens = zeros(n_rho,nb_launchers+1,nt_ec_out);
interp_p_integrated = zeros(n_rho,nb_launchers+1,nt_ec_out); interp_p_integrated = zeros(n_rho,nb_launchers+1,nt_ec_out);
...@@ -347,6 +349,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources ...@@ -347,6 +349,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
for ii = 1:nt_ec_out for ii = 1:nt_ec_out
% 1d_profiles % 1d_profiles
ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.time = ec_tgrid_out(ii); ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.time = ec_tgrid_out(ii);
ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.grid.rho_tor_norm = interp_rho_tor(:,ii);
% grids (do not fill for first and last time slice) % grids (do not fill for first and last time slice)
if ii~=1 || ii~=nt_ec_out if ii~=1 || ii~=nt_ec_out
ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.grid.rho_tor_norm = interp_rho_tor(:,ii); ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.grid.rho_tor_norm = interp_rho_tor(:,ii);
...@@ -422,7 +425,7 @@ if numel(active_nbi)>0 ...@@ -422,7 +425,7 @@ if numel(active_nbi)>0
p_nbi_injected_tmp = interpos(nbi_powers_tgrid,powers_gdat.(nbi_names{i_nbi}).data,nbi_tgrid_out); p_nbi_injected_tmp = interpos(nbi_powers_tgrid,powers_gdat.(nbi_names{i_nbi}).data,nbi_tgrid_out);
for ii = 1:nt_nbi_out for ii = 1:nt_nbi_out
ids_core_sources.source{last_index+i_nbi}.profiles_1d{ii}.time = nbi_tgrid_out(ii); ids_core_sources.source{last_index+i_nbi}.profiles_1d{ii}.time = nbi_tgrid_out(ii);
ids_core_sources.source{last_index+i_nbi}.profiles_1d{ii}.rho_tor_norm = rho_test; ids_core_sources.source{last_index+i_nbi}.profiles_1d{ii}.grid.rho_tor_norm = rho_test;
% globals % globals
ids_core_sources.source{last_index+i_nbi}.global_quantities{ii}.time = nbi_tgrid_out(ii); ids_core_sources.source{last_index+i_nbi}.global_quantities{ii}.time = nbi_tgrid_out(ii);
ids_core_sources.source{last_index+i_nbi}.global_quantities{ii}.power = p_nbi_injected_tmp(ii); ids_core_sources.source{last_index+i_nbi}.global_quantities{ii}.power = p_nbi_injected_tmp(ii);
...@@ -463,7 +466,7 @@ if ~isempty(powers_gdat.dnbi) ...@@ -463,7 +466,7 @@ if ~isempty(powers_gdat.dnbi)
p_dnbi_injected = interpos(dnbi_powers_tgrid,powers_gdat.dnbi.data,dnbi_tgrid_out); p_dnbi_injected = interpos(dnbi_powers_tgrid,powers_gdat.dnbi.data,dnbi_tgrid_out);
for ii = 1:nt_dnbi_out for ii = 1:nt_dnbi_out
ids_core_sources.source{last_index+1}.profiles_1d{ii}.time = dnbi_tgrid_out(ii); ids_core_sources.source{last_index+1}.profiles_1d{ii}.time = dnbi_tgrid_out(ii);
ids_core_sources.source{last_index+1}.profiles_1d{ii}.rho_tor_norm = rho_test; ids_core_sources.source{last_index+1}.profiles_1d{ii}.grid.rho_tor_norm = rho_test;
% globals % globals
ids_core_sources.source{last_index+1}.global_quantities{ii}.time = dnbi_tgrid_out(ii); ids_core_sources.source{last_index+1}.global_quantities{ii}.time = dnbi_tgrid_out(ii);
ids_core_sources.source{last_index+1}.global_quantities{ii}.power = p_dnbi_injected(ii); ids_core_sources.source{last_index+1}.global_quantities{ii}.power = p_dnbi_injected(ii);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment