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.index: support arbitrary P1 unit cells #1880

Merged
merged 6 commits into from Nov 22, 2021
Merged

Conversation

rjgildea
Copy link
Contributor

Map input unit cell to minimum cell for aP settings, to support passing in arbitrary P1 cells. The final unit cell will be reported in the requested setting.

Fixes #1878

dwpaley and others added 2 commits September 8, 2021 13:13
This supports passing in arbitrary P1 cells, and getting back the
cell in the requested setting.

Fixes #1878
@rjgildea rjgildea changed the title dials.index: support abitrary P1 unit cells dials.index: support arbitrary P1 unit cells Sep 10, 2021
Copy link
Contributor

@dwpaley dwpaley left a comment

Choose a reason for hiding this comment

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

Looks great, thank you @rjgildea. I'm surprised by the (non-)behavior of change_of_basis_op_to_reference_setting for triclinic, but this solves my problem.

@rjgildea
Copy link
Contributor Author

I'm surprised by the (non-)behavior of change_of_basis_op_to_reference_setting for triclinic

change_of_basis_op_to_reference_setting is purely based on the space group, and independent of the unit cell, so for triclinic it is always the identity op:
https://github.com/cctbx/cctbx_project/blob/35f53cd89fbf93de66dc2ff55632cb5c88144937/cctbx/crystal/__init__.py#L216-L217

@dwpaley
Copy link
Contributor

dwpaley commented Sep 10, 2021

Makes sense. Thanks for fixing this so quickly!

E.g. first application of minimum_cell() gives:
18.05165506, 18.05165506, 19.95912326, 116.8859257, 116.8859257, 90
and second gives:
18.05165506, 18.05165506, 19.95912326, 63.11407432, 63.11407432, 90
@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #1880 (3c73018) into main (1596bb4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1880   +/-   ##
=======================================
  Coverage   67.12%   67.13%           
=======================================
  Files         619      619           
  Lines       70029    70041   +12     
  Branches     9734     9735    +1     
=======================================
+ Hits        47010    47022   +12     
  Misses      21052    21052           
  Partials     1967     1967           

Since the minimum cell reduction may not always be numerically stable,
we can sometimes have multiple equivalent minimum cells.
@rjgildea rjgildea merged commit f899576 into main Nov 22, 2021
@rjgildea rjgildea deleted the unconventional_P1_indexing branch November 22, 2021 15:38
dagewa pushed a commit to dagewa/dials that referenced this pull request Dec 13, 2021
Map input unit cell to minimum cell for aP settings, to support passing in arbitrary P1 cells.
The final unit cell will be reported in the requested setting.

Fixes dials#1878

Co-authored-by: Daniel Paley <dwpaley@gmail.com>
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.

P1 indexing fails if cell parameters are not in conventional setting
3 participants