function [ids_struct_out] =  imasget_circuit(shot, ids_structures)

mdsopen(shot)
%% Get power supply/coils names for each circuit.
[coil_names2ids, power_supply_names2ids, circuit_names2ids, mds_paths2ids, ~] =  pf_active_definition();
% Get dimension
ncircuits2ids = numel(circuit_names2ids);

ids_struct_out(1:ncircuits2ids) = ids_structures.pf_active.circuit(1);
for ii=1:ncircuits2ids
    
    tmpdata = tdi(mds_paths2ids{ii});
    ids_struct_out{ii}.current.data = tmpdata.data;
    ids_struct_out{ii}.current.time = tmpdata.dim{1};
    
    
    %ids_struct_out{ii}.connection = 
    
    
end



%%
%{
% 19 circuits + TF (19 rectifiers power supplies) + FPS
% Same order as power supplies

% nnodes: Number of nodes used to describe each the circuits.
% If circuit is series connected then nnodes = (ncoils + npowersupply)
% All circuit are series connected in TCV and has only one power supply
% therefore for a given circuit nnode = ncoils +1;
nnodes = [2,7,repmat(2,1,16),7,4]; 
value = nnodes;


npfs=length(namepfs);        % Number of power supplies
npfc=length(namepfc);        % Number of coils
ncomponents = npfs + npfc;   % 20 supplies + 32 coils = 52 components
value = zeros(ncircuits,max(nnodes),2*ncomponents); % [20 x 7 x 104]

% Create varibales with indices
for l=1:npfs
    eval(sprintf('s%sin=2*%d-1;',namepfs{l},l));
    eval(sprintf('s%sout=2*%d;',namepfs{l},l));
end
for l=1:npfc
    eval(sprintf('c%sin=2*npfs+2*%d-1;',namepfc{l},l));
    eval(sprintf('c%sout=2*npfs+2*%d;',namepfc{l},l));
end

% OH1
icircuit=1;
value(icircuit,1,[sOH_001out,cA_001in]) = 1;
value(icircuit,2,[cA_001out,sOH_001in]) = 1;
% OH2
icircuit=2;
value(icircuit,1,[sOH_002out,cB_001in]) = 1;
value(icircuit,2,[cB_001out, cC_001in]) = 1;
value(icircuit,3,[cC_001out, cD_001in]) = 1;
value(icircuit,4,[cD_001out, cD_002in]) = 1;
value(icircuit,5,[cD_002out, cC_002in]) = 1;
value(icircuit,6,[cC_002out, cB_002in]) = 1;
value(icircuit,7,[cB_002out,sOH_002in]) = 1;
% E_001
icircuit=3;
value(icircuit,1,[sE_001out,cE_001in]) = 1;
value(icircuit,2,[cE_001out,sE_001in]) = 1;
% E_002
icircuit=4;
value(icircuit,1,[sE_002out,cE_002in]) = 1;
value(icircuit,2,[cE_002out,sE_002in]) = 1;
% E_003
icircuit=5;
value(icircuit,1,[sE_003out,cE_003in]) = 1;
value(icircuit,2,[cE_003out,sE_003in]) = 1;
% E_004
icircuit=6;
value(icircuit,1,[sE_004out,cE_004in]) = 1;
value(icircuit,2,[cE_004out,sE_004in]) = 1;
% E_005
icircuit=7;
value(icircuit,1,[sE_005out,cE_005in]) = 1;
value(icircuit,2,[cE_005out,sE_005in]) = 1;
% E_006
icircuit=8;
value(icircuit,1,[sE_006out,cE_006in]) = 1;
value(icircuit,2,[cE_006out,sE_006in]) = 1;
% E_007
icircuit=9;
value(icircuit,1,[sE_007out,cE_007in]) = 1;
value(icircuit,2,[cE_007out,sE_007in]) = 1;
% E_008
icircuit=10;
value(icircuit,1,[sE_008out,cE_008in]) = 1;
value(icircuit,2,[cE_008out,sE_008in]) = 1;
% F_001
icircuit=11;
value(icircuit,1,[sF_001out,cF_001in]) = 1;
value(icircuit,2,[cF_001out,sF_001in]) = 1;
% F_002
icircuit=12;
value(icircuit,1,[sF_002out,cF_002in]) = 1;
value(icircuit,2,[cF_002out,sF_002in]) = 1;
% F_003
icircuit=13;
value(icircuit,1,[sF_003out,cF_003in]) = 1;
value(icircuit,2,[cF_003out,sF_003in]) = 1;
% F_004
icircuit=14;
value(icircuit,1,[sF_004out,cF_004in]) = 1;
value(icircuit,2,[cF_004out,sF_004in]) = 1;
% F_005
icircuit=15;
value(icircuit,1,[sF_005out,cF_005in]) = 1;
value(icircuit,2,[cF_005out,sF_005in]) = 1;
% F_006
icircuit=16;
value(icircuit,1,[sF_006out,cF_006in]) = 1;
value(icircuit,2,[cF_006out,sF_006in]) = 1;
% F_007
icircuit=17;
value(icircuit,1,[sF_007out,cF_007in]) = 1;
value(icircuit,2,[cF_007out,sF_007in]) = 1;
% F_008
icircuit=18;
value(icircuit,1,[sF_008out,cF_008in]) = 1;
value(icircuit,2,[cF_008out,sF_008in]) = 1;
% G_001/FPS
icircuit=19;
value(icircuit,1,[sG_001out,  cG_001in]) = 1;
value(icircuit,2,[cG_001out,cG_002in]) = 1;
value(icircuit,3,[cG_002out,cG_003in]) = 1;
value(icircuit,4,[cG_003out,cG_004out])= 1; % Lower coils connected in the
value(icircuit,5,[cG_004in,cG_005out]) = 1; % opposite direction
value(icircuit,6,[cG_005in,cG_006out]) = 1;
value(icircuit,7,[cG_006in,   sG_001in]) = 1;
% BCOIL
icircuit=20;
value(icircuit,1,[sBCOILout, cT_001in]) = 1;
value(icircuit,2,[cT_001out, cT_002in]) = 1;
value(icircuit,3,[cT_002out,cT_003out]) = 1; % T_003 connected in the opposite
value(icircuit,4,[cT_003in,  sBCOILin]) = 1; % direction!

%}

end


function connection = create_connection_matrix()


end

