Skip to content
Snippets Groups Projects
Commit 5a48b159 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

add head part in tf and fix work around for time in field_map

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@11412 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 7107d9ad
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,14 @@ occurence=0;
ids2get = []; % 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});
%% 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
if 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);
function [ids_struct_out,ids_struct_out_description] = tcv_get_ids_tf(shot, ids_struct_in,varargin)
function [ids_tf_out,ids_tf_out_description] = tcv_get_ids_tf(shot, ids_tf_empty,varargin)
%
% [ids_struct_out] = tcv_get_ids_tf(shot, ids_struct_in,varargin);
% [ids_tf_out] = tcv_get_ids_tf(shot, ids_tf_empty,varargin);
%
% Get the vacuum toroidal field
%
% ids_struct_in should at least be the empty tf ids structure in input
% ids_tf_empty should at least be the empty tf ids structure in input
%
ids_struct_out = ids_struct_in;
ids_tf_out = ids_tf_empty;
[ids_tf_out, params_tf] = tcv_ids_headpart(shot, ids_tf_empty,'tf','homogeneous_time',0,varargin{:});
tmp = gdat(shot, 'b0');
if ~ischar(tmp.data)
ids_struct_out.b_field_tor_vacuum_r.data = tmp.data;
ids_struct_out.b_field_tor_vacuum_r.time = tmp.t;
ids_struct_out.r0 = tmp.r0;
ids_struct_out_description.b_field_tor_vacuum_r.data = ' gdat(shot, ''b0'')';
ids_struct_out_description.r0 = ' b0.r0 from gdat(shot, ''b0'')';
ids_tf_out.b_field_tor_vacuum_r.data = tmp.data;
ids_tf_out.b_field_tor_vacuum_r.time = tmp.t;
ids_tf_out.r0 = tmp.r0;
ids_tf_out_description.b_field_tor_vacuum_r.data = ' gdat(shot, ''b0'')';
ids_tf_out_description.r0 = ' b0.r0 from gdat(shot, ''b0'')';
else
% leave defaults
ids_struct_out_description = struct([]);
ids_tf_out_description = struct([]);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment