Skip to content
Snippets Groups Projects
Commit 429ae097 authored by Federico Felici's avatar Federico Felici
Browse files

Cleanup and add test

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@12052 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 855e6688
No related branches found
No related tags found
No related merge requests found
......@@ -21,14 +21,14 @@ end
% Preallocate memory and get data
ids_struct_out(1:tcv_circuit_info.ntotcircuits) = ids_structures;
for ii=1:tcv_circuit_info.ntotcircuits
tmpdata = gdat_tcv(shot,['' tcv_circuit_info.mds_paths{ii} '']); % Get current
if ischar(tmpdata.data)
if shot == -1; % model shot
% replace by dummy
tmpdata.dim{1} = [];
tmpdata.data = [];
warning('no time data loaded for shot %d',shot);
ids_struct_out_description{ii}.current = 'not loaded';
else
tmpdata = gdat_tcv(shot,['' tcv_circuit_info.mds_paths{ii} '']); % Get current
ids_struct_out_description{ii}.current = ['from ' tmpdata.data_fullpath];
end
ids_struct_out{ii}.current.data = tmpdata.data;
......
......@@ -74,11 +74,12 @@ for ii=1:ncircuits2ids
ids_struct_out_description{ind_coil_ids}.name = ['through aa=tcv_ids_pf_active_definition from aa.coil_names '];
% time-varying data
tmpdata = tdi(mds_paths2ids{ii});
if ischar(tmpdata.data), % arcane way to detect no data was loaded
if shot == -1
tmpdata.dim{1} = [];
tmpdata.data = [];
warning('no time data loaded for shot %d',shot);
else
tmpdata = tdi(mds_paths2ids{ii});
end
ids_struct_out{ind_coil_ids}.current.data = tmpdata.data;
ids_struct_out_description{ind_coil_ids}.current.data = ['from ' mds_paths2ids{ii}];
......
......@@ -21,16 +21,19 @@ end
% Preallocate memory and get data
ids_struct_out(1:tcv_circuit_info.ntotpowersupplies) = ids_structures;
for ii=1:tcv_circuit_info.ntotpowersupplies
tmpdata = gdat_tcv(shot,['' tcv_circuit_info.mds_paths{ii} '']); % Get current
if ischar(tmpdata.data);
if shot ==-1
warning('no time data loaded for shot %d',shot);
tmpdata.dim{1} = [];
tmpdata.data = [];
% empty dummy
ids_struct_out_description{ii}.current = sprintf('Not loaded for shot %d',shot);
else
tmpdata = gdat_tcv(shot,['' tcv_circuit_info.mds_paths{ii} '']); % Get current
ids_struct_out_description{ii}.current = ['abs value from ' tmpdata.data_fullpath];
end
ids_struct_out{ii}.current.data = abs(tmpdata.data); %%%%%%% FF:WHY ABS?? %%%%%%%
ids_struct_out_description{ii}.current = ['abs value from ' tmpdata.data_fullpath];
ids_struct_out{ii}.current.time = tmpdata.dim{1};
ids_struct_out{ii}.name = tcv_circuit_info.power_supply_names{ii}{1};
ids_struct_out_description{ii}.name = ...
......
function passed = test_tcv_get_ids
thispath = fileparts(mfilename('fullpath'));
run(fullfile(thispath,'..','gdatpaths'));
% simple test to check functionality
shotlist = [-1,40000];
for ishot=1:numel(shotlist)
shot = shotlist(ishot);
pf_active = tcv2ids(shot,'ids_names',{'pf_active','wall'});
end
passed = true;
end
......@@ -10,3 +10,6 @@ function [pass] = test_gdat_tcv_short
test_machine = 'tcv';
test_signals = {'ip', 'q_rho'};
[pass,request_list,err,telaps,skipped,gdat_results] = test_all_requestnames('machine',test_machine,'testmode',test_signals,'nverbose',0);
%% test some TCV_IMAS things
test_tcv_get_ids;
\ No newline at end of file
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