Skip to content
Snippets Groups Projects
tcv_get_ids_nbi.m 1.48 KiB
Newer Older
Olivier Sauter's avatar
Olivier Sauter committed
function [ids_nbi,ids_nbi_description,varargout] = tcv_get_ids_nbi(shot,ids_nbi_empty, gdat_params,varargin);
%
%  [ids_nbi,ids_nbi_description,varargout] = tcv_get_ids_nbi(shot,ids_nbi_empty,varargin);
%
%
% gdat_params: gdat_data.gdat_params to get all params passed from original call, in particular error_bar options
%

[ids_nbi, params_nbi] = tcv_ids_headpart(shot,ids_nbi_empty,'nbi','homogeneous_time',0,varargin{:});

% 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
%

pow=gdat_tcv(shot,'powers');

nb_units = 2; % assume 2 units: 1st NBH and DNBI
ids_nbi.unit(1:nb_units) = ids_nbi.unit(1); % copy empty structure for all units, then fill in

for iunit=1:length(nb_units)
  switch iunit
   case 1
    ids_nbi.unit{iunit}.identifier = 'NBH1';
    ids_nbi.unit{iunit}.name = '25keV 1st NBH source';
    ids_nbi.unit{iunit}.power_launched.time = pow.nbi.t;
    ids_nbi.unit{iunit}.power_launched.data = pow.nbi.data;
   case 2
    ids_nbi.unit{iunit}.identifier = 'DNBI';
    ids_nbi.unit{iunit}.name = 'diagnostic NBI';
    % ids_nbi.unit{iunit}.power_launched.data = pow.nbi.data; % DNBI power time values and time
    % ids_nbi.unit{iunit}.power_launched.time = ;
   otherwise
    warning(['iunit = ' num2str(iunit) ' not yet defined']);
  end

end