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.export format=pets #2014

Merged
merged 47 commits into from
Mar 10, 2022
Merged

dials.export format=pets #2014

merged 47 commits into from
Mar 10, 2022

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Feb 17, 2022

This enables export of integrated.{expt,refl} for electron diffraction data in the special "*_dyn.cif_pets" format used by PETS 2 in preparation for dynamic diffraction refinement by Jana2020.

The software combination PETS+Jana is currently the only way (to our knowledge) to determine absolute structure from continuous rotation electron diffraction patterns. In addition, dynamical refinement provides much improved R-factors compared to kinematic refinement (see https://chemrxiv.org/engage/chemrxiv/article-details/619971832bf8a9871fe627ed for details). This feature allows DIALS to replace PETS in that combination.

The DIALS output for a quartz crystal has been successfully used for dynamic diffraction refinement in Jana, although the results are not as good as those from PETS. One significant remaining difference is in the intensity error estimates, which are severely underestimated in DIALS, compared to PETS. Partly, this is due to the lack of a proper model for the integrating detector response in DIALS (for reference, with the quartz dataset used in the test, PETS sets a combined gain and cascade factor Gγ=3.5 and pixel noise factor ψ=70). Including a more sophisticated model for the errors is the next step in improving the results of dynamic diffraction refinement in DIALS. This will be addressed in separate PRs.

Draft until dials/data#346 is merged.

Closes #1859

dagewa and others added 30 commits December 13, 2021 16:36
- check only crystal orientation is scan-varying
Turns out this is much more work than is necessary! PETS only
outputs the frame orientation, not the reflection orientation.
I committed this for reference, but will simplify now, making
use of the dials.frame_orientations program
Previously, orientations were returned at the beginning of each
frame. This commit calculates the orientation at the centre of
each frame. This is closer to expectations, and allows the code
to be reused in export_pets
This is still untested. A good test would be to compare predictions
before and after reorientation
- Use map_centroids_to_reciprocal_space for simpler way to
  reconstruct r
- This way, we rotate the Ewald sphere rather than the relps
- Calculate extinction distances by comparison with the rotated
  Ewald sphere for the virtual frame centre
Name collision between alpha and beta orientation angles and the
cell angles.
Clearly reveals our zone axes are inverted compared to PETS.
Another indication of geometry issues...
It was a deg/rad mix up! Tidied up and retained the sanity check
dagewa and others added 12 commits January 28, 2022 14:30
- use the excitation error cutoff only to filter reflections
- this should include more low resolution reflections
- Makes alpha the rotation angle. Not sure about beta and omega yet...
Otherwise it appears to remove many reflections for the Glycine
example (not sure why).
Previously, was using map_centroids_to_reciprocal_space to calculate
relps for the excitation error calculation. However, this uses only
the scan-static crystal model. We need the calculation using the
scan-varying model.

Also tidy up, and rename some variables
Also, do not create the last virtual frame if it extends beyond
the end of the scan. Then number of VFs matches PETS, and each
VF is filled.
We are more interested in write_dyn_cif_pets. Non-dynamic diffraction
data could be prepared for Jana by exporting in SHELX format.
@dagewa dagewa marked this pull request as ready for review March 7, 2022 17:12
@ndevenish
Copy link
Member

🤔 I think these tests should be working now?

@dagewa
Copy link
Member Author

dagewa commented Mar 9, 2022

It requires dials.data get quartz_processed. Not sure if that works yet in the CI?

@ndevenish
Copy link
Member

CI has dials-data 2.4.10, but can reproduce on my workstation:

$  dials.data get quartz_processed
Repository location: /dls/science/groups/scisoft/DIALS/dials_data

$ pytest -k test_pets --regression
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-mep23677/pytest-1/test_pets_profile_0/profile.cif_pets'
....
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-mep23677/pytest-1/test_pets_sum_0/sum.cif_pets'

@ndevenish ndevenish merged commit 17eecdd into dials:main Mar 10, 2022
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.

Export PETS2-like integration results
3 participants