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

Replace write_pgyro with gdat ec_data call (has now gyro2launcher and active_launchers)

parent 4630a267
No related branches found
No related tags found
1 merge request!137Add quantities to ids for MRE
......@@ -79,9 +79,9 @@ ids_core_sources.source{last_index+1}.global_quantities(1:ohm_n_t) = {globals_te
% fill profiles for times n t_grid
for ii = 1:bs_n_t
ids_core_sources.source{last_index+1}.profiles_1d{ii}.time = bs_t_grid(ii);
ids_core_sources.source{last_index+1}.profiles_1d{ii}.j_parallel = ...
bs_data.cd_dens.data(:,ii)';
ids_core_sources.source{last_index+1}.profiles_1d{ii}.time = bs_t_grid(ii);
ids_core_sources.source{last_index+1}.profiles_1d{ii}.j_parallel = ...
bs_data.cd_dens.data(:,ii)';
end
last_index = last_index+1; % add if statement to only increment if bs source has been added
......@@ -92,19 +92,16 @@ ec_gdat = gdat(shot,'ec_data'); ec_data = ec_gdat.ec.ec_data;
ec_time = ec_data.p_dens.t;
n_ec_time = numel(ec_time);
ec_t_grid = powers_gdat.ec.t; ec_n_t = numel(ec_t_grid);
[status,time,pgyro,pgyro_ecrh,gyro2launcher,freq2launcher] = write_pgyro(shot);
nb_launchers = size(ec_gdat.ec.ec_data.rho_max_pow_dens.data,1);
active_launchers = [];
for i_lau = 1:numel(gyro2launcher)
if gyro2launcher(i_lau) ~= 0
active_launchers(end+1) = i_lau;
end
n_active_launchers = numel(active_launchers);
end
id_ec.description = 'L1/G1 Sources from electron cyclotron heating and current drive';
ec_inputs = ec_gdat.ec.ec_inputs;
nb_launchers = numel(ec_inputs.launchers_active.data);
active_launchers = find(ec_inputs.launchers_active.data==1)';
n_active_launchers = sum(ec_inputs.launchers_active.data);
main_desc = 'Source from electron cyclotron heating and current drive';
id_ec.index = 3; id_ec.name = 'ec';
for i_lau = active_launchers
id_ec.description = sprintf('L%i/G%i, %s',i_lau,ec_inputs.gyro2launcher.data(i_lau),main_desc);
ids_core_sources.source{last_index+i_lau} = source_template;
ids_core_sources.source{last_index+i_lau}.identifier = id_ec;
ids_core_sources.source{last_index+i_lau}.profiles_1d(1:ec_n_t) = {profiles_template};
......@@ -214,7 +211,7 @@ for ii = 1:ec_n_t
interp_p_dens(:,launcher_index,ii);
ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.electrons.power_inside = ...
interp_p_integrated(:,launcher_index,ii);
% current density (to adapt to <J.B>/B0)
% current density (to adapt to <J.B>/B0)
ids_core_sources.source{last_index+i_lau}.profiles_1d{ii}.j_parallel = ...
interp_cd_dens(:,launcher_index,ii);
% integrated current density (to adapt to INTEGRAL(<J.B>/B0)*ds_phi)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment