From 4b02143f54ba0541c88b5a21a63b3cb0d9112f55 Mon Sep 17 00:00:00 2001 From: Antonia Frank <antonia.frank@epfl.ch> Date: Wed, 7 Aug 2024 14:15:34 +0200 Subject: [PATCH] Add vacuum toroidal field and change homogeneous time flag to 0 --- matlab/TCV_IMAS/tcv_get_ids_core_sources.m | 18 ++++++++++++++---- matlab/TCV_IMAS/tcv_get_ids_summary.m | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m index 11e00e69..68d0ef27 100644 --- a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m +++ b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m @@ -14,10 +14,11 @@ tens_rho = -0.1; if exist('gdat_params','var') [ids_core_sources, params_core_sources] = ... - tcv_ids_headpart(shot,ids_equil_empty,'cores_sources','gdat_params',gdat_params,varargin{:}); + tcv_ids_headpart(shot,ids_equil_empty,'cores_sources','gdat_params',gdat_params,... + 'homogeneous_time',0,varargin{:}); else [ids_core_sources, params_core_sources] = ... - tcv_ids_headpart(shot,ids_equil_empty,'cores_sources',varargin{:}); + tcv_ids_headpart(shot,ids_equil_empty,'cores_sources','homogeneous_time',0,varargin{:}); aa=gdat_tcv; gdat_params = aa.gdat_params; % to get default params end @@ -27,14 +28,23 @@ try params_eff_ref=rmfield(params_eff_ref,'source');catch;end % make sure no sou % initialize description ids_core_sources_description = []; +%% fill vacuum_toroidal field +params_eff = params_eff_ref; params_eff.data_request='b0'; +b0_gdat=gdat(params_core_sources.shot,params_eff); +ids_core_sources.vacuum_toroidal_field.r0 = b0_gdat.r0; +ids_core_sources.vacuum_toroidal_field.b0 = b0_gdat.data; +ids_core_sources_description.vacuum_toroidal_field = b0_gdat.request_description; +ids_core_sources.time = b0_gdat.t; %% % save source template to fill for differnet source options source_template = ids_core_sources.source{1}; profiles_template = source_template.profiles_1d{1}; globals_template = source_template.global_quantities{1}; %% get time grid and data from gdat -ohm_gdat = gdat(shot,'ohm_data'); -powers_gdat = gdat(shot,'powers'); +params_eff = params_eff_ref; params_eff.data_request='ohm_data'; +ohm_gdat = gdat(params_core_sources.shot,params_eff); +params_eff = params_eff_ref; params_eff.data_request='powers'; +powers_gdat = gdat(params_core_sources.shot,params_eff); % fix time grid to ohm time grid, same as bs last_index = 0; diff --git a/matlab/TCV_IMAS/tcv_get_ids_summary.m b/matlab/TCV_IMAS/tcv_get_ids_summary.m index b5571a17..e24b4ee2 100644 --- a/matlab/TCV_IMAS/tcv_get_ids_summary.m +++ b/matlab/TCV_IMAS/tcv_get_ids_summary.m @@ -16,7 +16,7 @@ end % As a general rule, for a new substructure under the main ids, construct a local structure like: % "global_quantities" with subfields being the relevant data to get and a local structure: -% "global_quantities_desc" which contains the same subfields themselves containing the gdat string aftre shot used +% "global_quantities_desc" which contains the same subfields themselves containing the gdat string after shot used % % vacuum_toroidal_field and time, using homogeneous % -- GitLab