diff --git a/crpptbx/TCV_IMAS/get_ids_equilibrium_fixed_boundary.m b/crpptbx/TCV_IMAS/get_ids_equilibrium_fixed_boundary.m index 9223e759b26af21768108c62a74defe9535904a9..020183262dd42d64cbcead5c72cc1f4dc92755b8 100644 --- a/crpptbx/TCV_IMAS/get_ids_equilibrium_fixed_boundary.m +++ b/crpptbx/TCV_IMAS/get_ids_equilibrium_fixed_boundary.m @@ -268,4 +268,29 @@ profiles_1d.rho_volume_norm = gdat(params_equilibrium.shot,'rhovol'); % triangularity_upper = gdat(params_equilibrium.shot,'triangularity_upper'); profiles_1d.volume = gdat(params_equilibrium.shot,'volume_rho'); -keyboard +profiles_1d_fieldnames = fieldnames(profiles_1d); +special_fields = {'geometric_axis', 'rho_tor_norm', 'psi'}; % fields needing non-automatic treatments +for it=1:length(ids_equilibrium.time) + for i=1:length(profiles_1d_fieldnames) + if ~any(strcmp(profiles_1d_fieldnames{i},special_fields)) + if ~isstruct(ids_equilibrium.time_slice{it}.profiles_1d.(profiles_1d_fieldnames{i})) + ids_equilibrium.time_slice{it}.profiles_1d.(profiles_1d_fieldnames{i}) = ... + profiles_1d.(profiles_1d_fieldnames{i}).data(:,it); + else + special_fields{end+1} = profiles_1d_fieldnames{i}; + end + end + end +end + +% special cases +nrho = length(profiles_1d.rho_tor.x); +ntime = length(temp.psi_axis.data); +for it=1:length(ids_equilibrium.time) + ids_equilibrium.time_slice{it}.profiles_1d.rho_tor_norm = ids_equilibrium.time_slice{it}.profiles_1d.rho_tor./ ... + ids_equilibrium.time_slice{it}.profiles_1d.rho_tor(end); + ids_equilibrium.time_slice{it}.profiles_1d.psi = ... + reshape(1-profiles_1d.rho_tor.x.^2,nrho,1)*reshape(temp.psi_axis.data,1,ntime) + ... + ones(nrho,1)*reshape(global_quantities.psi_boundary.data,1,ntime); +end +