Skip to content

Commit

Permalink
Re pace-neutrons#1830 unit test which demonstrates the issue (fails) …
Browse files Browse the repository at this point in the history
…and runs if fixed
  • Loading branch information
abuts committed Feb 28, 2025
1 parent 8dc9917 commit 7e4fd87
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions _test/test_IX_classes/test_IX_experiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,41 @@ function test_comparison_hash_eq(~)
assertEqual(ch1,ch2,'-ignore_str');
end

function test_convert_from_old_binfile_header_full_data(~)
in = struct(...
'filename', 'sqw_T30p0_BG_fourA_newVANA237684.nxspe',...
'filepath','spe/',...
'efix',5.1128,...
'emode',1,...
'alatt',[23.9549 8.0759 18.2733],...
'angdeg',[90 90 90.3000],...
'cu',[0 1 0],...
'cv',[0 0 1],...
'psi',-0.2409,...
'omega',0,...
'dpsi',0,...
'gl',0,...
'gs',0,...
'en',-1:0.02:4.2,...
'uoffset', zeros(4,1),...
'u_to_rlu',[3.8125,-0.0200,0.0,0;0,1.2853,0.,0;0,0,2.9083,0;0,0,0,1],...
'ulen',[1 1 1 1],...
'ulabel','');
in.ulabel = {'Q_\zeta' 'Q_\xi' 'Q_\eta' 'E'};

[exp_rec,alatt,angdeg] = IX_experiment.build_from_binfile_header(in);

assertEqual(alatt,in.alatt);
assertEqual(angdeg,in.angdeg);
assertEqual(exp_rec.angular_units,'rad');
assertEqual(exp_rec.run_id,30); % this is wrong, but this is
% old file, so was build with this kind of processing and
% should properly process it
assertEqual(exp_rec.psi,in.psi);
assertTrue(isempty(exp_rec.u_to_rlu));
end


function test_convert_to_and_from_old_binfile_headers(~)
exp = IX_experiment();
exp(1).filename = 'aa';
Expand Down

0 comments on commit 7e4fd87

Please sign in to comment.