Commit 98fb919f authored by Olivier Sauter's avatar Olivier Sauter
Browse files

tcv_get_ids_core_sources.m just copied from cores_profiles, not yet implemented

parent b7a81956
Pipeline #103935 passed with stages
in 2 minutes and 5 seconds
......@@ -21,10 +21,12 @@ machine = 'tcv';
tens_time = -1;
tens_rho = -0.1;
error('not yet modified from core_profiles to core_sources');
if exist('gdat_params','var')
[ids_core_sources, params_cores_profiles] = tcv_ids_headpart(shot,ids_equil_empty,'cores_profiles','gdat_params',gdat_params,varargin{:});
[ids_core_sources, params_core_sources] = tcv_ids_headpart(shot,ids_equil_empty,'core_sources','gdat_params',gdat_params,varargin{:});
else
[ids_core_sources, params_cores_profiles] = tcv_ids_headpart(shot,ids_equil_empty,'cores_profiles',varargin{:});
[ids_core_sources, params_core_sources] = tcv_ids_headpart(shot,ids_equil_empty,'core_sources',varargin{:});
aa=gdat_tcv;
gdat_params = aa.gdat_params; % to get default params
end
......@@ -36,10 +38,10 @@ ids_core_sources_description = [];
% base all from times fro nete_rho (which should be conf by default)
params_eff = params_eff_ref;
params_eff.data_request='ne_rho'; params_eff.fit = 1;
temp_1d.ne_rho = gdat(params_cores_profiles.shot,params_eff);
temp_1d.ne_rho = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.ne_rho = params_eff.data_request;
params_eff.data_request = 'te_rho';
temp_1d.te_rho = gdat(params_cores_profiles.shot,params_eff);
temp_1d.te_rho = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.te_rho = params_eff.data_request;
% compute grids_1d for fit rhopol grid, need a gdat_data like structure
temp_1d.fit.te_rho = temp_1d.te_rho.fit;
......@@ -48,10 +50,10 @@ temp_1d.fit.te_rho.shot = temp_1d.te_rho.shot;
temp_1d.fit.te_rho = get_grids_1d(temp_1d.fit.te_rho,1,1);
params_eff.data_request = 'psi_axis';
temp_1d.psi_axis = gdat(params_cores_profiles.shot,params_eff);
temp_1d.psi_axis = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.psi_axis = params_eff.data_request;
params_eff.data_request = 'psi_edge';
temp_1d.psi_edge = gdat(params_cores_profiles.shot,params_eff);
temp_1d.psi_edge = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.psi_edge = params_eff.data_request;
temp_1d.fit.ne_rho = temp_1d.ne_rho.fit;
......@@ -79,7 +81,7 @@ ids_core_sources.profiles_1d(1:length(ids_core_sources.time)) = ids_core_sources
%
params_eff = params_eff_ref;
params_eff.data_request='b0';
vacuum_toroidal_field.b0=gdat(params_cores_profiles.shot,params_eff);
vacuum_toroidal_field.b0=gdat(params_core_sources.shot,params_eff);
vacuum_toroidal_field_desc.b0 = params_eff.data_request;
ids_core_sources.vacuum_toroidal_field.r0 = vacuum_toroidal_field.b0.r0;
ids_core_sources.vacuum_toroidal_field.b0 = interpos(63,vacuum_toroidal_field.b0.t,vacuum_toroidal_field.b0.data,ids_core_sources.time,-1);
......@@ -88,41 +90,41 @@ ids_core_sources_description.vacuum_toroidal_field = [vacuum_toroidal_field_desc
% global_quantities data into local global_quantities.* structure with correct end names and global_quantities_desc.* with description. Use temp.* and temp_desc.* structures for temporary data
params_eff.data_request='ip';
global_quantities.ip = gdat(params_cores_profiles.shot,'ip','machine',machine);
global_quantities.ip = gdat(params_core_sources.shot,'ip','machine',machine);
global_quantities_desc.ip = params_eff.data_request;
params_eff.data_request = 'ohm_data';
current_non_inductive = gdat(params_cores_profiles.shot,params_eff);
current_non_inductive = gdat(params_core_sources.shot,params_eff);
global_quantities.current_non_inductive.data = current_non_inductive.ohm.ohm_data.cd_tot.data;
global_quantities.current_non_inductive.t = current_non_inductive.ohm.ohm_data.cd_tot.t;
global_quantities_desc.current_non_inductive = current_non_inductive.ohm.ohm_data.cd_tot.label;
params_eff.data_request = 'bs_data';
current_bootstrap = gdat(params_cores_profiles.shot,params_eff);
current_bootstrap = gdat(params_core_sources.shot,params_eff);
global_quantities.current_bootstrap.data = current_bootstrap.bs.bs_data.cd_tot.data;
global_quantities.current_bootstrap.t = current_bootstrap.bs.bs_data.cd_tot.t;
global_quantities_desc.current_bootstrap = current_bootstrap.bs.bs_data.cd_tot.label;
params_eff.data_request = 'vloop';
global_quantities.v_loop = gdat(params_cores_profiles.shot,params_eff);
global_quantities.v_loop = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.v_loop = params_eff.data_request;
params_eff.data_request = 'li';
global_quantities.li_3 = gdat(params_cores_profiles.shot,params_eff);
global_quantities.li_3 = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.li_3 = params_eff.data_request;
params_eff.data_request = 'beta';
global_quantities.beta_tor = gdat(params_cores_profiles.shot,params_eff);
global_quantities.beta_tor = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.beta_tor = params_eff.data_request;
params_eff.data_request = 'betan';
global_quantities.beta_tor_norm = gdat(params_cores_profiles.shot,params_eff);
global_quantities.beta_tor_norm = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.beta_tor_norm = params_eff.data_request;
params_eff.data_request = 'betap';
global_quantities.beta_pol = gdat(params_cores_profiles.shot,params_eff);
global_quantities.beta_pol = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.beta_pol = params_eff.data_request;
params_eff.data_request = 'w_mhd';
global_quantities.energy_diamagnetic = gdat(params_cores_profiles.shot,params_eff);
global_quantities.energy_diamagnetic = gdat(params_core_sources.shot,params_eff);
global_quantities_desc.energy_diamagnetic = params_eff.data_request;
params_eff.data_request = 'results.conf:z_eff'; params_eff_fit1=params_eff; params_eff_fit1.fit=1;
global_quantities.z_eff_resistive = gdat(params_cores_profiles.shot,params_eff_fit1);
global_quantities.z_eff_resistive = gdat(params_core_sources.shot,params_eff_fit1);
global_quantities_desc.z_eff_resistive = params_eff_fit1.data_request;
ids_core_sources_description.global_quantities = global_quantities_desc;
......@@ -147,13 +149,13 @@ end
%
%% profiles_1d (cannot use eqdsk since not same radial mesh)
params_eff.data_request = 'area_rho';
temp_1d.area = gdat(params_cores_profiles.shot,params_eff);
temp_1d.area = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.area = params_eff.data_request;
for ir=1:length(temp_1d.area.x)
area_cpt(ir,:) = interpos(temp_1d.area.t,temp_1d.area.data(ir,:),ids_core_sources.time,tens_time);
end
params_eff.data_request = 'q_rho';
temp_1d.q = gdat(params_cores_profiles.shot,params_eff);
temp_1d.q = gdat(params_core_sources.shot,params_eff);
temp_1d_desc.q = params_eff.data_request;
for ir=1:length(temp_1d.q.x)
q_cpt(ir,:) = interpos(temp_1d.q.t,temp_1d.q.data(ir,:),ids_core_sources.time,tens_time);
......@@ -233,13 +235,13 @@ end
% ion, assume only D if no CXRS (need to ask how to check if H...)
params_eff_fit1.data_request = 'cxrs';
temp_1d.cxrs_rho = gdat(params_cores_profiles.shot,params_eff_fit1);
temp_1d.cxrs_rho = gdat(params_core_sources.shot,params_eff_fit1);
temp_1d_desc.cxrs_rho = params_eff_fit1.data_request;
params_eff_fit1.data_request = 'results.conf:ti';
temp_1d.ti_conf_rho = gdat(params_cores_profiles.shot,params_eff_fit1);
temp_1d.ti_conf_rho = gdat(params_core_sources.shot,params_eff_fit1);
temp_1d_desc.ti_conf_rho = params_eff_fit1.data_request;
params_eff_fit1.data_request = 'results.conf:ni';
temp_1d.ni_conf_rho = gdat(params_cores_profiles.shot,params_eff_fit1);
temp_1d.ni_conf_rho = gdat(params_core_sources.shot,params_eff_fit1);
temp_1d_desc.ni_conf_rho = params_eff_fit1.data_request;
data_fullpath_raw = 'Ti(C sometimes B) from cxrs system 1 to 3';
temp_1d.ti.raw = temp_1d.cxrs_rho.ti.raw;
......@@ -340,9 +342,9 @@ ids_core_sources_description.temp_1d_desc = temp_1d_desc;
ids_core_sources_description.profiles_1d.magnetic_shear = 'from interpos with rhotor';
if nargin <= 2
ids_core_sources.code.name = ['tcv_get_ids_core_sources, within gdat, with shot= ' num2str(params_cores_profiles.shot) ];
ids_core_sources.code.name = ['tcv_get_ids_core_sources, within gdat, with shot= ' num2str(params_core_sources.shot) ];
else
ids_core_sources.code.name = ['tcv_get_ids_core_sources, within gdat, with shot= ' num2str(params_cores_profiles.shot) '; varargin: ' varargin{:}];
ids_core_sources.code.name = ['tcv_get_ids_core_sources, within gdat, with shot= ' num2str(params_core_sources.shot) '; varargin: ' varargin{:}];
end
ids_core_sources_description.code.name = ids_core_sources.code.name;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment