Skip to content
Snippets Groups Projects
Commit 71016935 authored by Francesco Carpanese's avatar Francesco Carpanese
Browse files

commit script to get IDS

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@11365 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 4de900a3
Branches
Tags
No related merge requests found
function [ids_struct_out] = imasget_bpol_probe(shot, ids_structures) function [ids_struct_out] = imasget_bpol_probe(shot, ids_structures)
% Get bpol probes % Get magnetics.bpol_probe
ids_struct_out = {};
mdsopen(shot); mdsopen(shot);
tmp = gdat( shot, '\MAGNETICS::BPOL_003'); tmp = gdat( shot, '\MAGNETICS::BPOL_003');
% Get dimension % Get data
Nprobes = size(tmp.data,2);
Ntime = size(tmp.data,1);
names = tmp.dim{2}; names = tmp.dim{2};
time = tmp.dim{1}; time = tmp.dim{1};
data = tmp.data; data = tmp.data;
% Preallocate dimension % Preallocate output structure
Nprobes = size(tmp.data,2);
ids_struct_out(1:Nprobes) = ids_structures.magnetics.bpol_probe(1); ids_struct_out(1:Nprobes) = ids_structures.magnetics.bpol_probe(1);
......
function ids_struct_out = imasget_flux_loop(shot, ids_structures) function ids_struct_out = imasget_flux_loop(shot, ids_structures)
% Get the bpol_probe signals into IDS structure % Get ids field magnetics.fluxx_loop
ids_struct_out = {}; % Get data
mdsopen(shot); mdsopen(shot);
tmp = gdat(shot, 'tcv_idealloop("FLUX")'); tmp = gdat(shot, 'tcv_idealloop("FLUX")');
% Get dimension
Nprobes = size(tmp.data,2);
Ntime = size(tmp.data,1);
names = tmp.dim{2}; names = tmp.dim{2};
time = tmp.dim{1}; time = tmp.dim{1};
data = tmp.data; data = tmp.data;
% Preallocate dimension % Preallocate output structure
Nprobes = size(tmp.data,2);
ids_struct_out(1:Nprobes) = ids_structures.magnetics.flux_loop(1); ids_struct_out(1:Nprobes) = ids_structures.magnetics.flux_loop(1);
% Get all the data % Put data on ids structure
for ii=1:Nprobes for ii=1:Nprobes
ids_struct_out{ii}.name = [names{ii}]; ids_struct_out{ii}.name = [names{ii}];
ids_struct_out{ii}.position{1}.r = mdsvalue('STATIC("R_F" )[$1]',ids_struct_out{ii}.name); ids_struct_out{ii}.position{1}.r = mdsvalue('STATIC("R_F" )[$1]',ids_struct_out{ii}.name);
......
function [ids_struct_out] = imasget_ip(shot, ids_structures) function [ids_struct_out] = imasget_ip(shot, ids_structures)
% Get the bpol_probe signals into IDS structure % Get magnetics.method{1}.ip
mdsopen(shot); mdsopen(shot);
tmp = gdat( shot, 'ip_trapeze'); tmp = gdat( shot, 'ip_trapeze');
% Get dimension
Ntime = size(tmp.data,1);
time = tmp.dim{1}; time = tmp.dim{1};
data = tmp.data; data = tmp.data;
% Preallocate dimension % Preallocate dimension
ids_struct_out = ids_structures.magnetics.method(1); ids_struct_out = ids_structures.magnetics.method(1);
% Put data into ids structure
ids_struct_out{1}.ip.data = data; ids_struct_out{1}.ip.data = data;
ids_struct_out{1}.ip.time = time; ids_struct_out{1}.ip.time = time;
......
function [ids_struct_out] = imasget_circuit(shot, ids_structures) function [ids_struct_out] = imasget_circuit(shot, ids_structures)
mdsopen(shot) mdsopen(shot)
%% Get power supply/coils names for each circuit. %% Get power supply/coils names for each circuit.
[coil_names2ids, power_supply_names2ids, circuit_names2ids, mds_paths2ids, ~] = pf_active_definition(); [coil_names2ids, power_supply_names2ids, circuit_names2ids, mds_paths2ids, ~] = pf_active_definition();
% Get dimension % Get dimension
ncircuits2ids = numel(circuit_names2ids); ncircuits2ids = numel(circuit_names2ids);
% Preallocate memory and get data
ids_struct_out(1:ncircuits2ids) = ids_structures.pf_active.circuit(1); ids_struct_out(1:ncircuits2ids) = ids_structures.pf_active.circuit(1);
for ii=1:ncircuits2ids for ii=1:ncircuits2ids
...@@ -13,14 +15,9 @@ for ii=1:ncircuits2ids ...@@ -13,14 +15,9 @@ for ii=1:ncircuits2ids
ids_struct_out{ii}.current.data = tmpdata.data; ids_struct_out{ii}.current.data = tmpdata.data;
ids_struct_out{ii}.current.time = tmpdata.dim{1}; ids_struct_out{ii}.current.time = tmpdata.dim{1};
%ids_struct_out{ii}.connection = %ids_struct_out{ii}.connection =
end end
%% %%
%{ %{
% 19 circuits + TF (19 rectifiers power supplies) + FPS % 19 circuits + TF (19 rectifiers power supplies) + FPS
......
...@@ -4,10 +4,10 @@ function [ids_struct_out] = imasget_coil(shot, ids_structures) ...@@ -4,10 +4,10 @@ function [ids_struct_out] = imasget_coil(shot, ids_structures)
% TODO add logic to get the current in the coils only onces. % TODO add logic to get the current in the coils only onces.
% Coils that can be characterized by R, Z and a % Coils that can be characterized by R, Z and a
% crosssectional area are described as distinct coils with a single element this also corresponds to coils with distinct TCV names). % crosssectional area are described as distinct coils with a single element, this also corresponds to coils with distinct TCV names).
% Elements can be used in the future to refine the spatial % Elements can be used in the future to refine the spatial
% description of each coil. % description of each coil.
% the circular conductor of G-coils approximated by a square of equal % The circular conductor of G-coils approximated by a square of equal
% crosssectional area. % crosssectional area.
% Each coil has a positive turnsign. The return current in T_003 is % Each coil has a positive turnsign. The return current in T_003 is
% dealt with in the circuit description and in the machine mapping. % dealt with in the circuit description and in the machine mapping.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment