-
Notifications
You must be signed in to change notification settings - Fork 46
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
Correct array/scan-point index mixup #1933
Conversation
@phyy-nx I am working on some code in a different branch in which the scan-varying model at the start and end of a frame is interpolated to give a crystal model for the frame centre. I think that concept could be introduced in |
@kmdalton would you or someone in your group like to take a look at this? You use this more than I. |
@PrinceWalnut, can you look at these modifications to |
This version works as well as the previous version, which is to say it works for scan-varying crystals but not scan-static crystal models, or for models which have not had shoeboxes assigned yet (particularly those for which force2d=True was set during spotfinding). You can get around the shoebox issue by using the following snippet to select refls for including into the still:
To handle scan-static models, the EDIT: I have developed a few variants of this script specifically for dealing with scan-static and for multi-beam experiments. Perhaps these should be added as either separate scripts, or into this script with some smart selection depending on arguments? |
I would suggest approving this request, and I can update my fork and my scripts and form a pull request later with the extra functionality I have. My scripts will also have this array bug, so I need to change them first. |
@phyy-nx That's all the input I have here. I can pull this fix and add my own for the mentioned issues above if it's useful for you. Otherwise LGTM |
Great! And a separate pull request to add those features seems good. Thanks! |
Correct instances where an array-index, which might not start from 0, is conflated with a scan-point index, which always starts from zero. Fixes #1929
Bugfixes -------- - Correct reporting of phi angle in scan-varying model plots. (#1929) - ``dials.sequence_to_stills``: correct error in the crystal model for scans that do not start from image 1. (#1933) - `dials.show`: only show format class if meaningful (i.e. not Format or FormatMultiImage) (#1981) Improved Documentation ---------------------- - Update some Cosym and resolution-related PHIL descriptions. (#1969)
Bugfixes -------- - Correct reporting of phi angle in scan-varying model plots. (#1929) - ``dials.sequence_to_stills``: correct error in the crystal model for scans that do not start from image 1. (#1933) - `dials.show`: only show format class if meaningful (i.e. not Format or FormatMultiImage) (#1981) Improved Documentation ---------------------- - Update some Cosym and resolution-related PHIL descriptions. (#1969)
Features -------- - It is now possible to explicitly bootstrap all supported python versions. (`#XXX <https://github.com/dials/dials/issues/XXX>`_) Bugfixes -------- - Correct reporting of phi angle in scan-varying model plots. (#1929) - ``dials.sequence_to_stills``: correct error in the crystal model for scans that do not start from image 1. (#1933) - `dials.show`: only show format class if meaningful (i.e. not Format or FormatMultiImage) (#1981) Improved Documentation ---------------------- - Update some Cosym and resolution-related PHIL descriptions. (#1969)
Features -------- - It is now possible to explicitly bootstrap all supported python versions. (#1988) Bugfixes -------- - Correct reporting of phi angle in scan-varying model plots. (#1929) - ``dials.sequence_to_stills``: correct error in the crystal model for scans that do not start from image 1. (#1933) - `dials.show`: only show format class if meaningful (i.e. not Format or FormatMultiImage) (#1981) Improved Documentation ---------------------- - Update some Cosym and resolution-related PHIL descriptions. (#1969)
Features -------- - It is now possible to explicitly bootstrap all supported python versions. (#1988) Bugfixes -------- - ``dials.refine``: Fix crash from recording of parameter correlations in ``history.json``. (#1923) - Correct reporting of phi angle in scan-varying model plots. (#1929) - ``dials.sequence_to_stills``: correct error in the crystal model for scans that do not start from image 1. (#1933) - `dials.show`: only show format class if meaningful (i.e. not Format or FormatMultiImage) (#1981) Improved Documentation ---------------------- - Update some Cosym and resolution-related PHIL descriptions. (#1969)
Correct instances where an array-index, which might not start from 0, is conflated with a scan-point index, which always starts from zero.
Two of these are in plot generation code. This issue is more pernicious than first thought (#1929) as it is not limited to merely shifting of the X-axis. If there are multiple crystals in the experiment, and these have different scan ranges (possible due to scan-trimming) then the plots themselves are also shifted relative to one another.
Here's an example with two crystals in the same imageset with scans that go from -24.1° to 24.9° and from -35.1° to 22.9°. Previously the orientation plot from
dials.plot_scan_varying_model
incorrectly showed both scan-varying models starting from -44.1°, which is the result ofscan.get_angle_from_array_index(0)
from either of the scans.wrong behaviour on main:
WIth these changes the two scans are correctly displayed as starting at -24.1° and -35.1°.
correct behaviour on branch:
The third instance is in
dials.sequence_to_stills
, for which Aaron is tagged for review.