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

Add known orientations to dials.stills_process #2110

Merged
merged 17 commits into from
Sep 22, 2022
Merged

Conversation

phyy-nx
Copy link
Member

@phyy-nx phyy-nx commented May 6, 2022

In Brewster 2018 (see figure 5), two detectors were used to collect data: a front CSPAD detector at a standard position and a second CSPAD 2.5m behind the front detector, used to record low resolution data. The crystal orientations from the front detector were used to index spots on the back detector using bookkeeping code originally in cctbx.xfel.xtc_process. This PR ports that bookkeeping into dials.stills_process as a general use case. A version of the referenced branch was successfully used in a recent XFEL experiment with a front and a back detector.

Specifically, this PR adds known_orientations as a parameter to dials.stills_process, used to specify the path to previous processing results, including crystal orientations. If specified, the known orientations for the images will be used to index the images. Provide paths to experiment list files, using wildcards as needed. The program will load the experiment lists files up front and create a dictionary mapping filename/image number to experiment lists (including potentially multiple lattices). Then, for each image, it refers to this dictionary and if the image had been previously indexed, it uses that orientation to index the image.

Additionally, the require_known_orientation=False parameter is added. If known_orientations are provided, and an orientation for an image is not found, this is whether or not to attempt to index the image from scratch using indexing.method

Includes a test of known_orientations in test_stills_process.py

Note the XFEL GUI already knows about this parameter.

Co-authored-by: Daniel Paley dwpaley@lbl.gov

phyy-nx and others added 13 commits March 15, 2022 15:29
An old feature of xtc_process, if the user has previously indexed the images, they can provide those crystal orientations using the known_orientations as a list of paths to experiment lists.  The bookkeeping is done by matching up filenames + image indices.
If known_orientations are provided, and an orientation for an image is not found, this is whether or not to attempt to index the image from scratch using indexing.method

Co-authored-by: Daniel Paley <dwpaley@lbl.gov>
…on filtering

This duplicate filtering code came when prepping Brewster 2018 Figure 5, where split spots on a detector 2.5m from the source were both indexed by known_orientations using the same miller_index.  That code didn't check for multiple lattices, hence this re-write.
@phyy-nx
Copy link
Member Author

phyy-nx commented May 6, 2022

The new test requires dials/data-files#42 to be merged to add a set of crystal orientations the test uses. After merging that, it needs to be referenced in the image_examples dataset in dials-data.

@phyy-nx phyy-nx requested a review from dwpaley May 6, 2022 23:56
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #2110 (0a20ea3) into main (c645ecc) will decrease coverage by 0.06%.
The diff coverage is 17.64%.

❗ Current head 0a20ea3 differs from pull request most recent head 46e3467. Consider uploading reports for the commit 46e3467 to get more accurate results

@@            Coverage Diff             @@
##             main    #2110      +/-   ##
==========================================
- Coverage   80.36%   80.30%   -0.07%     
==========================================
  Files         580      580              
  Lines       65706    65764      +58     
  Branches     9260     9280      +20     
==========================================
+ Hits        52805    52810       +5     
- Misses      10847    10893      +46     
- Partials     2054     2061       +7     

@phyy-nx
Copy link
Member Author

phyy-nx commented May 11, 2022

Hi, I'd like to merge this tomorrow unless there is feedback. Thanks!

src/dials/command_line/stills_process.py Outdated Show resolved Hide resolved
src/dials/command_line/stills_process.py Outdated Show resolved Hide resolved
src/dials/command_line/stills_process.py Show resolved Hide resolved
src/dials/command_line/stills_process.py Show resolved Hide resolved
src/dials/command_line/stills_process.py Outdated Show resolved Hide resolved
src/dials/command_line/stills_process.py Outdated Show resolved Hide resolved
dwpaley and others added 3 commits July 26, 2022 00:31
…edundant check for a path in test_stills_process
Removes early return for known_crystal_models so the later code that filters duplicate reflections can still run

Co-authored-by: Daniel Paley dwpaley@lbl.gov
@phyy-nx
Copy link
Member Author

phyy-nx commented Sep 22, 2022

Test failure seems unrelated and is on main. Merging. Thanks @dwpaley.

@phyy-nx phyy-nx merged commit a207eb7 into main Sep 22, 2022
@phyy-nx phyy-nx deleted the known_orientations branch September 22, 2022 22:55
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.

None yet

3 participants