Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel in crystal alignment #1725

Merged
merged 7 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion _test/test_change_crystal/test_change_crystal_bragg_coarse.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@

sim_sqw_file = fullfile(obj.dir_out, 'test_change_crystal_coarse_sim.sqw'); % output file for simulation in reference lattice
obj = obj.build_misaligned_source_file(sim_sqw_file);


obj.save();
end
function test_change_crystal_family_invalid_throw_in_memory(obj)
sqw_sample = read_sqw(obj.misaligned_sqw_file);
Expand Down Expand Up @@ -591,6 +592,7 @@ function test_legacy_vs_pix_aligmnent_recovered_on_load(obj)
assertEqualToTol(cut_old.data, cut_new.data);
skipTest('Re #1616 Experiment alignment is not recovered as modern alignment')
end
%
function test_rotmat_recovery(~)
% this is test to check how well rotation matrix can be recovered
% from u_to_rlu_matrix; The procedure occuring while we take
Expand Down Expand Up @@ -632,6 +634,36 @@ function test_rotmat_recovery(~)

assertElementsAlmostEqual(corr.rotmat,rotmat_rec);
end
function test_corrections_work_in_parallel(obj)
% testing if multifit works in parallel (actually no parallel
% should be invoked) for this kind of task
abuts marked this conversation as resolved.
Show resolved Hide resolved

clOb = set_temporary_config_options('hpc_config','parallel_multifit',true);
%
bragg_pos=[...
0, -1, 0; ...
1, 2, 0; ...
0, -1, 1];
alatt0 = [5,5,5];
angdeg0 = [90,90,90];

% the Bragg points positions found by fitting measured Bragg
% peaks shape to Gaussian and identifying the Gaussian centerpoints
% See test_u_alignment_tf_way for the procedure of obtaining
% them
rlu_real = [...
0.0372, -0.9999, 0.0521;...
0.9200, 2.0328, -0.1568;...
0.1047, -0.9425, 1.0459];

% Get correction class from the 3 peak positions:
% ------------------------------------------------
corr = refine_crystal(rlu_real, ...
alatt0,angdeg0, bragg_pos);
hpc = hpc_config;
assertTrue(hpc.parallel_multifit);
assertEqualWithSave(obj,corr)
end

function test_bragg_pos(obj)
bragg_pos= [...
Expand Down
1 change: 1 addition & 0 deletions _test/test_change_crystal/test_change_crystal_bragg_fine.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
catch
end
end
obj.save();
end
function setUp(~)
hpc = hpc_config;
Expand Down
Binary file modified _test/test_change_crystal/test_change_crystal_coarse.mat
Binary file not shown.
Loading