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

Adapt ec_launchers to give imo correct angles, to be checked

parent 55cb570e
No related branches found
No related tags found
1 merge request!173Ids for torbeam
......@@ -76,9 +76,6 @@ for iant=1:nb_launchers
% non time-dependent quantities, take 1st ok values
ids_ec_launchers.beam{iant}.frequency.time = [pow.ec.t(1) pow.ec.t(end)];
ids_ec_launchers.beam{iant}.frequency.data =[launch_params{iant}{it_ok{iant}(1)}.freq launch_params{iant}{it_ok{iant}(end)}.freq];
% ids_ec_launchers.beam{iant}.mode.time = [pow.ec.t(1) pow.ec.t(end)];
% ids_ec_launchers.beam{iant}.mode.data = [-1 -1]; % at this stage assume X mode always, to change when available
% ids_ec_launchers.beam{iant}.time = [pow.ec.t(1) pow.ec.t(end)];
ids_ec_launchers.beam{iant}.mode = -1; % at this stage assume X mode always, to change when available
for i=1:length(it_ok{iant})
r0 = sqrt(launch_params{iant}{it_ok{iant}(i)}.x0.^2 + launch_params{iant}{it_ok{iant}(i)}.y0.^2) / 100.; % in [m]
......@@ -87,15 +84,23 @@ for iant=1:nb_launchers
ids_ec_launchers.beam{iant}.launching_position.z(i) = launch_params{iant}{it_ok{iant}(i)}.z0/100.;
ids_ec_launchers.beam{iant}.launching_position.phi(i) = atan2(launch_params{iant}{it_ok{iant}(i)}.y0/100,r0);
ids_ec_launchers.beam{iant}.time(i) = time_launch;
% define wave vector based on TORAY angles
% Reminder: theta_toray, zero on z-axis, pointing inwards with 90deg
% phi_toray, zero along outpard radial direction, pointing
% towards core with 180deg, +: clockwise, -: counter-clockwise
kz = cos(launch_params{iant}{it_ok{iant}(i)}.theta_toray*pi/180.);
kmr = -sin(launch_params{iant}{it_ok{iant}(i)}.theta_toray*pi/180.).*cos(launch_params{iant}{it_ok{iant}(i)}.phi_toray*pi/180.);
kphi = sin(launch_params{iant}{it_ok{iant}(i)}.theta_toray*pi/180.).*sin(launch_params{iant}{it_ok{iant}(i)}.phi_toray*pi/180.); %*sigma_Rphiz (=+1 for TCV cocos=17)
if (kz==0 && kmr==0)
kR = -sin(launch_params{iant}{it_ok{iant}(i)}.theta_toray*pi/180.);
kmr = cos((launch_params{iant}{it_ok{iant}(i)}.phi_toray)*pi/180.);
kphi = sin((launch_params{iant}{it_ok{iant}(i)}.phi_toray)*pi/180.); %*sigma_Rphiz (=+1 for TCV cocos=17)
% poloidal angle defined from -R axis to -Z axis
if kz==0 % if kz=0 wave vector lies in toroidal plane
ids_ec_launchers.beam{iant}.steering_angle_pol(i) = 0.;
else
ids_ec_launchers.beam{iant}.steering_angle_pol(i) = atan2(-kz,kmr);
ids_ec_launchers.beam{iant}.steering_angle_pol(i) = -atan2(kz,-kR);
end
ids_ec_launchers.beam{iant}.steering_angle_tor(i) = asin(kphi);
ids_ec_launchers.beam{iant}.steering_angle_tor(i) = -atan2(kphi,-kmr);
ids_ec_launchers.beam{iant}.spot.size(1,i) = 0.023;
ids_ec_launchers.beam{iant}.spot.size(2,i) = 0.012;
ids_ec_launchers.beam{iant}.spot.angle(i) = 0.0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment