Skip to content
Snippets Groups Projects
tcv2ids2database.m 1.15 KiB
Newer Older
% 
% script to get TCV data as ids and then write them on the database
%

shot=40000;
Olivier Sauter's avatar
Olivier Sauter committed
shot=62745;
Olivier Sauter's avatar
Olivier Sauter committed
ids2get = {'equilibrium', 'magnetics', 'pf_active','wall'}; % default will load all defined so far
[ids_from_tcv,idsok] = tcv2ids(shot,ids2get);

%% can plot with: [plotids_H] = plotids([],idsok.ids{1},idsok.ids{2});
if isfield(ids_from_tcv,'tf')
  % avoid present problem of not saving data if ids_from_tcv.tf.field_map{1}.time is not set
Olivier Sauter's avatar
Olivier Sauter committed
  if length(ids_from_tcv.tf.field_map)>0 && abs(ids_from_tcv.tf.field_map{1}.time+9.e40)<1e-5
    ids_from_tcv.tf.field_map{1}.time = -8.9000e+40;
    disp(['WARNING: ids_from_tcv.tf.field_map{1}.time changed to ' num2str(ids_from_tcv.tf.field_map{1}.time) ' to avoid writing error']);
  end
end
%%
[ids_put_status] = ids2database(shot,run_out,occurence,ids_from_tcv);

Olivier Sauter's avatar
Olivier Sauter committed

% [plotids_H] = plotids([],idsok.ids);

% tic;[TTTe,idse]=evalc('ids_get(expIdx, ''equilibrium'')');toc
% tic;[TTTm,idsm]=evalc('ids_get(expIdx, ''magnetics'')');toc
% tic;[TTTp,idsp]=evalc('ids_get(expIdx, ''pf_active'')');toc
% tic;[TTTt,idst]=evalc('ids_get(expIdx, ''tf'')');toc
% tic;[TTTw,idsw]=evalc('ids_get(expIdx, ''wall'')');toc