From 7e9c95e87dcf01869fbc9c857770cc1017826ef7 Mon Sep 17 00:00:00 2001 From: Antonia Frank <antonia.frank@epfl.ch> Date: Wed, 31 Jul 2024 10:56:46 +0200 Subject: [PATCH] Add liuqe call to get the conversion factor between j_TORAY and j_// --- matlab/TCV_IMAS/tcv_get_ids_core_sources.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m index 388d7d17..11e00e69 100644 --- a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m +++ b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m @@ -87,7 +87,7 @@ end last_index = last_index+1; % add if statement to only increment if bs source has been added %% ec -ec_gdat = gdat(shot,'ec_data'); +ec_gdat = gdat(shot,'ec_data','ec_inputs',1); if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources @@ -113,6 +113,18 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources ids_core_sources.source{last_index+i_lau}.global_quantities = globals_template; end + % get geometrical parameters and conversion from j_V,TORAY to j// = <jdotB>/B0 + % from LIUQE + [L,~,LY] = liuqe(shot,ec_data_tgrid,'iterq',50,'ilim',3,'icsint',true); + rho_pol_norm_liu = L.pQ; % normalized sqrt poloidal flux including axis + mu0 = 4*pi*10^-7; + Rm2_fs = LY.Q2Q; + Vprime = -1./LY.Q1Q; % Q1Q: -dpsi/dV + Ip_psi = LY.ItQ; % Ip(psi) = I_tor(psi) + T = LY.TQ; + B2_fs = mu0*Ip_psi.*2.*pi./Vprime + T.^2.*Rm2_fs; + toray_to_parallel = 1./(T.*Rm2_fs).*B2_fs./R0./B0; + % get data for globals from gdat powers and fill in ids_structure ec_total_pow = transpose(powers_gdat.ec.data(:,nb_launchers+1)); %use power from powers_gdat(injected ec power) instead of ec_data power ec_total_pow(isnan(ec_total_pow)) = 0; -- GitLab