Skip to content
Snippets Groups Projects
Commit 10e4a6f1 authored by Luke Simons's avatar Luke Simons
Browse files

Merge branch 'master' into 67-add-tcv_get_ids_bolometer-to-tcv_imas-functions

parents 1ad9043d f1383d34
Branches 67-add-tcv_get_ids_bolometer-to-tcv_imas-functions
No related tags found
1 merge request!171Resolve "Add tcv_get_ids_bolometer to TCV_IMAS functions"
Pipeline #255152 passed
function [ids_pf_passive,ids_pf_passive_description,varargout] = tcv_get_ids_pf_passive(shot, ids_pf_passive_empty, gdat_params, varargin)
%
% gdat_params: gdat_data.gdat_params to get all params passed from original call, in particular error_bar options
%
% Input pharser
if exist('gdat_params','var')
[ids_pf_passive, params_pf_passive] = tcv_ids_headpart(shot, ids_pf_passive_empty,'pf_passive','homogeneous_time',0,'gdat_params',gdat_params,varargin{:});
else
[ids_pf_passive, params_pf_passive] = tcv_ids_headpart(shot, ids_pf_passive_empty,'pf_passive','homogeneous_time',0,varargin{:});
aa=gdat_tcv;
gdat_params = aa.gdat_params; % to get default params
end
params_eff_ref = gdat_params; params_eff_ref.doplot=0;
try params_eff_ref=rmfield(params_eff_ref,'source');catch;end % make sure no source (from ids def)
% Get subfield
G.rv = gdat(shot, 'STATIC("R_V")'); % Vessel radial coord 256x1
G.wv = gdat(shot, 'STATIC("A_V")'); % Vessel conductor width 256x1
G.zv = gdat(shot, 'STATIC("Z_V")'); % Vessel vert. coord 256x1
G.hv = gdat(shot, 'STATIC("B_V")'); % Vessel conductor heigth 256x1
G.Rv = gdat(shot, 'STATIC("RES_V")'); % Vessel resistivity 1 in 256x1 in ohm
G.res = gdat(shot, 'STATIC("RHO_V")'); % Vessel resistance 1 in ohm*m
G.dimv = gdat(shot, 'STATIC("N_V")'); % Number of turns
Uf = gdat(shot, 'TCV_IDEALLOOP("VLOOP")'); % Flux loop voltage
Tvs = gdat(shot, 'STATIC("T_V_S")'); % Transfer matrix segments to vessel elements
Rs = gdat(shot, 'STATIC("RES_S")'); % Resistance of each segment
Is = -Uf.data./Rs.data'; % Measured current in each segment
Iv = Tvs.data*Is'; % Mapped to each vessel element
%ids_core_profiles.profiles_1d{1}.ion{1}.state = {};
%ids_core_profiles.profiles_1d{1}.neutral{1}.state = {};
%ids_core_profiles.profiles_1d(1:length(ids_core_profiles.time)) = ids_core_profiles.profiles_1d(1);
loop_template = ids_pf_passive.loop{1};
for ii=1:G.dimv.data
% Duplicate loop substructure
ids_pf_passive.loop{ii} = loop_template;
ids_pf_passive.loop{ii}.element{1}.geometry.geometry_type = 3;
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.r = G.rv.data(ii)-G.wv.data(ii)/2;
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.z = G.zv.data(ii)-G.hv.data(ii)/2;
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.length_alpha = G.wv.data(ii);
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.length_beta = G.hv.data(ii);
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.alpha = 0;
ids_pf_passive.loop{ii}.element{1}.geometry.oblique.beta = 0;
ids_pf_passive.loop{ii}.element{1}.turns_with_sign = 1;
ids_pf_passive.loop{ii}.element{1}.name = num2str(ii);
ids_pf_passive.loop{ii}.name = num2str(ii); % might not be correct
ids_pf_passive.loop{ii}.resistivity = G.Rv.data(ii)/2/pi/G.rv.data(ii)*G.wv.data(ii)*G.hv.data(ii);
ids_pf_passive.loop{ii}.resistance = G.res.data;
ids_pf_passive.loop{ii}.current = Iv(ii,:);
ids_pf_passive.loop{ii}.time = Uf.t;
end
%% Code
if nargin <= 2
ids_pf_passive.code.name = ['tcv_get_ids_pf_passive, within gdat, with shot= ' num2str(params_pf_passive.shot) ];
else
ids_pf_passive.code.name = ['tcv_get_ids_pf_passive, within gdat, with shot= ' num2str(params_pf_passive.shot) '; varargin: ' varargin{:}];
end
ids_pf_passive_description.code.name = ids_pf_passive.code.name;
ids_pf_passive.code.output_flag = zeros(size(ids_pf_passive.time));
% Not sure about this, copied from active but might need changes
% cocos automatic transform
if exist('ids_generic_cocos_nodes_transformation_symbolic','file')
[ids_pf_passive,cocoscoeff]=ids_generic_cocos_nodes_transformation_symbolic(ids_pf_passive,'pf_passive',gdat_params.cocos_in, ...
gdat_params.cocos_out,gdat_params.ipsign_out,gdat_params.b0sign_out,gdat_params.ipsign_in,gdat_params.b0sign_in, ...
gdat_params.error_bar,gdat_params.nverbose);
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