-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix issues with calculate_qw_pixels2 for recent horace #1751
base: master
Are you sure you want to change the base?
Conversation
c8b7757
to
7f33451
Compare
7f33451
to
f886f6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just comment:
solves the problem so no direct objections but quality of changes is low as opportunity to remove substantial and very important code duplication is missed.
if ~iscell(win.header) | ||
header = {win.header}; | ||
header = num2cell(win.header)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, we should not use header
in new code. This is legacy method, necessary for writing old format sqw
files and may be in some printing (also legacy, no time to throw it from there)
This is probably another ticket though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the new alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experiment.IX_experiment
or sqw.experiment_info.expdata
function detdcn = spec_coords_to_det (detpar) | ||
% Matrix to convert coordinates in spectrometer (or laboratory) frame into detector frame | ||
% | ||
% >> d_mat = spec_coords_to_det (detpar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is code duplication as something similar is in rundatah/convert_to_sqw
. Which one is better I do not know, as see some optimization here too. Probably other ticket again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A whole chunk of this including calculate_qw_pixels2
is duplicated in rundatah
(c.f. rundatah.calc_qspec
) and the whole thing needs to be split off into utilities at some point, but like you say, not this ticket.
Update function to work with unique_references_container, struct-array header and use established functions.
This will likely be used in the on-the-fly re-computation of pixels.
Fixes #1152