diff --git a/matlab/TCV/tcv_requests_mapping.m b/matlab/TCV/tcv_requests_mapping.m index ad1bc170dab3bea172e5cffe6628196f901c8e63..04dcc1f5c8e483714b1882bb15b8e965bb07ed20 100644 --- a/matlab/TCV/tcv_requests_mapping.m +++ b/matlab/TCV/tcv_requests_mapping.m @@ -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; diff --git a/matlab/tests/test_requestnames.m b/matlab/tests/test_requestnames.m index 63595919b38cbbbedf2ad19c8636348badc1df83..feb82bf0ac9118d03762699d8ab34b6d06a7f7f2 100644 --- a/matlab/tests/test_requestnames.m +++ b/matlab/tests/test_requestnames.m @@ -1,48 +1,60 @@ 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 diff --git a/matlab/tests/test_requestnames_tcv.m b/matlab/tests/test_requestnames_tcv.m index f40ecbfa9348473a86ef5552e37e9ad0340510a7..6941e96ddac1f9ae3cc07d32ee0dc76e58b0c5d5 100644 --- a/matlab/tests/test_requestnames_tcv.m +++ b/matlab/tests/test_requestnames_tcv.m @@ -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