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

add radcam in mapping and hence in tests

parent d7484faa
No related branches found
No related tags found
1 merge request!152add radcam 4 cameras top upper euatorial and bottom or 1 to 4
Pipeline #195486 failed
......@@ -458,7 +458,7 @@ switch lower(data_request)
mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=''tcv_eq("surf","LIUQE.M")'';' ...
'gdat_tmp=gdat_tcv(shot,params_eff); gdat_tmp.dim = {gdat_tmp.t}; gdat_tmp.x=[]; gdat_tmp.data= gdat_tmp.data(end,:);' ...
'gdat_tmp.dimunits{1}=''s'';gdat_tmp.help=''toroidal surface of LCFS'';'];
case 'sxr'
case {'sxr', 'mpx', 'radcam'}
mapping.timedim = 1;
mapping.gdat_timedim = 2;
mapping.method = 'switchcase';
......@@ -583,10 +583,6 @@ switch lower(data_request)
% $$$ mapping.method = 'tdiliuqe';
% $$$ % mapping.expression = '\results::thomson:psiscatvol:foo';
% $$$ mapping.expression = '\results::thomson:psiscatvol';
case 'mpx'
mapping.timedim = 1;
mapping.gdat_timedim = 2;
mapping.method = 'switchcase';
case {'profnerho','profterho'}
mapping.timedim = 1;
mapping.label = data_request;
......
classdef (SharedTestFixtures={...
check_mds,check_gdatpaths}) ...
test_requestnames < matlab.unittest.TestCase
properties (Abstract)
Machine;
end
properties(TestParameter,Abstract)
% parameters that will vary during tests
shot;
requests_fast; % placeholders
requests_slow;
end
methods(Static)
function test_gdat_call(testCase,shot,request)
% actual function to test gdat call
testCase.assertTrue(isnumeric(str2double(shot)));
testCase.assertTrue(ischar(request));
% gdat call
gdat_call = sprintf(['gdat_' lower(testCase.Machine) '(%s,''%s'')'],shot,request);
do_gdat_call = 1;
switch request
case 'eqdsk'
% avoid writing files in /tmp, may not be allowed
gdat_call = sprintf(['gdat_%s(%s,''%s'',''write'',0)'],lower(testCase.Machine),shot,request);
case 'radcam'
% need a newer shot for tcv radcam
shot = 81102;
gdat_call = sprintf(['gdat_' lower(testCase.Machine) '(%s,''%s'')'],shot,request);
end
% logging
fprintf('Testing gdat call: %s\n',gdat_call);
if do_gdat_call
gdat_out = eval(gdat_call); %#ok<NASGU>
else
gdat_out = struct([]);
end
% in some future: check for warnings
%gdat_out = verifyWarningFree(testCase,eval(gdat_call),...
% 'Warning issued from gdat call:\n %s\n',gdat_call);
% (add optional sanity checks of gdat_out here)
switch request
case 'rtc'
% in this case .data is empty, all in .scd_mems
testCase.assertTrue(isfield(gdat_out,'scd_mems') && isstruct(gdat_out.scd_mems));
% testCase.assertTrue(isstruct(gdat_out.scd_mems));
otherwise
testCase.assertTrue(isnumeric(gdat_out.data) & numel(gdat_out.data)>0);
end
end
end
end
\ No newline at end of file
end
......@@ -11,17 +11,17 @@ classdef (TestTags={'tcv'})test_requestnames_tcv < test_requestnames
requests_fast = get_all_gdat_requests('TCV','fast');
requests_slow = get_all_gdat_requests('TCV','slow');
end
methods(Test,TestTags = {'fast'})
function test_gdat_call_fast(testCase,shot,requests_fast)
testCase.test_gdat_call(testCase,shot,requests_fast);
end
end
methods(Test,TestTags = {'slow'})
function test_gdat_call_slow(testCase,shot,requests_slow)
testCase.test_gdat_call(testCase,shot,requests_slow);
end
end
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