diff --git a/matlab/TCV_IMAS/tcv_get_ids_ec_launchers.m b/matlab/TCV_IMAS/tcv_get_ids_ec_launchers.m index a132f2a36158e03bcf83d202fdbd5c31f773ef66..e6f3b040e8ce238e03ed89f3baaeb51aebaa838a 100644 --- a/matlab/TCV_IMAS/tcv_get_ids_ec_launchers.m +++ b/matlab/TCV_IMAS/tcv_get_ids_ec_launchers.m @@ -33,7 +33,7 @@ end nb_launchers = size(pow.ec.data,2)-1; % at this stage keep same numbering as standard TCV launchers before mid-2019 -ids_ec_launchers.launcher(1:nb_launchers) = ids_ec_launchers.launcher(1); % copy empty structure for all units, then fill in +ids_ec_launchers.beam(1:nb_launchers) = ids_ec_launchers.beam(1); % copy empty structure for all units, then fill in ids_ec_launchers_description.comment = ['assume ' num2str(nb_launchers) ' launchers']; if shot>=63000 @@ -48,22 +48,22 @@ end ids_ec_launchers_description.launch_params = launch_params; for iant=1:nb_launchers - ids_ec_launchers.launcher{iant}.identifier = ['L' num2str(iant)]; + ids_ec_launchers.beam{iant}.identifier = ['L' num2str(iant)]; switch iant case {1,4} - ids_ec_launchers.launcher{iant}.name = 'LFS equatorial launcher'; + ids_ec_launchers.beam{iant}.name = 'LFS equatorial launcher'; case {2, 3, 5, 6} - ids_ec_launchers.launcher{iant}.name = 'LFS top launcher'; + ids_ec_launchers.beam{iant}.name = 'LFS top launcher'; otherwise - ids_ec_launchers.launcher{iant}.name = 'TOP launcher'; + ids_ec_launchers.beam{iant}.name = 'TOP launcher'; end if any(isfinite(pow.ec.data(:,iant))) - ids_ec_launchers.launcher{iant}.power_launched.data = pow.ec.data(:,iant); - ids_ec_launchers.launcher{iant}.power_launched.time = pow.ec.t; - ids_ec_launchers_description.launcher{iant}.power_launched = 'from gdat powers .ec'; - ids_ec_launchers_description.launcher{iant}.launching_position = 'from launch_params obtained from toray_raygeom_TCV'; + ids_ec_launchers.beam{iant}.power_launched.data = pow.ec.data(:,iant); + ids_ec_launchers.beam{iant}.power_launched.time = pow.ec.t; + ids_ec_launchers_description.beam{iant}.power_launched = 'from gdat powers .ec'; + ids_ec_launchers_description.beam{iant}.launching_position = 'from launch_params obtained from toray_raygeom_TCV'; else - ids_ec_launchers_description.launcher{iant}.power_launched = 'no power for this launcher from gdat powers .ec'; + ids_ec_launchers_description.beam{iant}.power_launched = 'no power for this launcher from gdat powers .ec'; end if length(launch_params)>=iant && ~isempty(launch_params{iant}) % find 1st non-empty data @@ -74,48 +74,41 @@ for iant=1:nb_launchers end end % non time-dependent quantities, take 1st ok values - ids_ec_launchers.launcher{iant}.frequency.time = [pow.ec.t(1) pow.ec.t(end)]; - ids_ec_launchers.launcher{iant}.frequency.data =[launch_params{iant}{it_ok{iant}(1)}.freq launch_params{iant}{it_ok{iant}(end)}.freq]; - ids_ec_launchers.launcher{iant}.mode.time = [pow.ec.t(1) pow.ec.t(end)]; - ids_ec_launchers.launcher{iant}.mode.data = [-1 -1]; % at this stage assume X mode always, to change when available + 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] time_launch = launch_params{iant}{it_ok{iant}(i)}.time; - ids_ec_launchers.launcher{iant}.launching_position.r(i) = r0; - ids_ec_launchers.launcher{iant}.launching_position.z(i) = launch_params{iant}{it_ok{iant}(i)}.z0/100.; - ids_ec_launchers.launcher{iant}.launching_position.phi(i) = atan2(launch_params{iant}{it_ok{iant}(i)}.y0/100,r0); - ids_ec_launchers.launcher{iant}.launching_position.time(i) = time_launch; + ids_ec_launchers.beam{iant}.launching_position.r(i) = r0; + 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; 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) - ids_ec_launchers.launcher{iant}.steering_angle_pol.data(i) = 0.; + ids_ec_launchers.beam{iant}.steering_angle_pol(i) = 0.; else - ids_ec_launchers.launcher{iant}.steering_angle_pol.data(i) = atan2(-kz,kmr); + ids_ec_launchers.beam{iant}.steering_angle_pol(i) = atan2(-kz,kmr); end - ids_ec_launchers.launcher{iant}.steering_angle_pol.time(i) = time_launch; - ids_ec_launchers.launcher{iant}.steering_angle_tor.data(i) = asin(kphi); - ids_ec_launchers.launcher{iant}.steering_angle_tor.time(i) = time_launch; -% $$$ ids_ec_launchers.launcher{iant}.beam.spot.size.data(i,1) = 0.023; -% $$$ ids_ec_launchers.launcher{iant}.beam.spot.size.data(i,2) = 0.012; - ids_ec_launchers.launcher{iant}.beam.spot.size.data(1,i) = 0.023; - ids_ec_launchers.launcher{iant}.beam.spot.size.data(2,i) = 0.012; - ids_ec_launchers.launcher{iant}.beam.spot.size.time(i) = time_launch; - ids_ec_launchers.launcher{iant}.beam.spot.angle.data(i) = 0.0; - ids_ec_launchers.launcher{iant}.beam.spot.angle.time(i) = time_launch; -% $$$ ids_ec_launchers.launcher{iant}.beam.phase.curvature.data(i,1) = 1./1.88; -% $$$ ids_ec_launchers.launcher{iant}.beam.phase.curvature.data(i,2) = 1./-0.95; % negative in launch_params... - ids_ec_launchers.launcher{iant}.beam.phase.curvature.data(1,i) = 1./1.88; - ids_ec_launchers.launcher{iant}.beam.phase.curvature.data(2,i) = 1./-0.95; % negative in launch_params... - ids_ec_launchers.launcher{iant}.beam.phase.angle.data(i) = 0.0; - ids_ec_launchers.launcher{iant}.beam.phase.angle.time(i) = time_launch; - ids_ec_launchers.launcher{iant}.beam.phase.curvature.time(i) = time_launch; + ids_ec_launchers.beam{iant}.steering_angle_tor(i) = asin(kphi); + 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; + ids_ec_launchers.beam{iant}.phase.curvature(1,i) = 1./1.88; + ids_ec_launchers.beam{iant}.phase.curvature(2,i) = 1./-0.95; % negative in launch_params... + ids_ec_launchers.beam{iant}.phase.angle(i) = 0.0; end end end % cocos automatic transform if exist('ids_generic_cocos_nodes_transformation_symbolic') == 2 + [ids_ec_launchers,cocoscoeff]=ids_generic_cocos_nodes_transformation_symbolic(ids_ec_launchers,'ec_launchers',gdat_params.cocos_in, ... gdat_params.cocos_out,gdat_params.ipsign_out,gdat_params.b0sign_out,gdat_params.ipsign_in,gdat_params.b0sign_in, ... gdat_params.error_bar,gdat_params.nverbose);