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

dials.rlv - handle cases where the beam centre cannot be set #2483

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Aug 2, 2023

Previously when a beam centre could not be calculated, dials.reciprocal_lattice_viewer would raise errors and may even distort the lattice (see #2481). The distortion was occurring because the beam centre controls defaulted to 0.0, 0.0. In some situations when setting the beam centre failed, the beam centre was then read from the control values and therefore set to 0.0, 0.0.

This PR works around by disabling the controls in situations when the beam centre cannot be set. Then, if the control is disabled, its value will not be passed back when updating the models.

In such a case, disable the control and keep the beam centre as `None`
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #2483 (4d07ce7) into main (9e7f4dc) will decrease coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 4d07ce7 differs from pull request most recent head a31d7bd. Consider uploading reports for the commit a31d7bd to get more accurate results

@@            Coverage Diff             @@
##             main    #2483      +/-   ##
==========================================
- Coverage   78.63%   78.60%   -0.04%     
==========================================
  Files         607      607              
  Lines       74365    74365              
  Branches    10121    10121              
==========================================
- Hits        58479    58451      -28     
- Misses      13731    13758      +27     
- Partials     2155     2156       +1     

Copy link
Member

@biochem-fan biochem-fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much.

I confirmed that this fixed problems I reported.

@dagewa dagewa merged commit 3ded4af into main Aug 3, 2023
16 checks passed
@dagewa dagewa deleted the 2481-cannot-change-settings-in-dialsrecprocal_lattice_viewer-when-the-detector-swing-angle-is-larger-than-90 branch August 3, 2023 08:37
toastisme pushed a commit to toastisme/dials that referenced this pull request Aug 21, 2023
…#2483)

In such a case, disable the control and keep the beam centre as `None`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot change settings in dials.recprocal_lattice_viewer when the detector swing angle is larger than 90
3 participants