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

FormatROD #645

Merged
merged 7 commits into from
Jul 26, 2023
Merged

FormatROD #645

merged 7 commits into from
Jul 26, 2023

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Jul 20, 2023

This is for #11.

FormatROD.py consists of @biochem-fan's gist, edited to pass precommit checks and to change to a faster understand method.

This has been tested to work with a couple of images:

The conversation at #11 and FIXMEs in the code suggest that support remains partial, but it is a good start and I think worth adding to dxtbx at this point.

@biochem-fan
Copy link
Member

biochem-fan commented Jul 20, 2023

I don't have time to study your changes at the moment.

I recommend that you test on https://xrda.pdbj.org/entry/93 as well, which has a more complicated geometry. At the moment this class does not read axes, so you cannot index all sweeps in one go but each sweep should be indexable individually.

@dagewa
Copy link
Member Author

dagewa commented Jul 20, 2023

Thanks, I'll take a look 👍

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #645 (f93f74c) into main (1625cfa) will decrease coverage by 0.29%.
Report is 2 commits behind head on main.
The diff coverage is 21.25%.

❗ Current head f93f74c differs from pull request most recent head 3ed0b46. Consider uploading reports for the commit 3ed0b46 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #645      +/-   ##
==========================================
- Coverage   39.39%   39.10%   -0.29%     
==========================================
  Files         178      179       +1     
  Lines       15519    15757     +238     
  Branches     2996     3040      +44     
==========================================
+ Hits         6113     6162      +49     
- Misses       8827     9012     +185     
- Partials      579      583       +4     

@dagewa
Copy link
Member Author

dagewa commented Jul 20, 2023

I confirm that after applying the file renaming workaround (#11 (comment)), all 14 datasets in XRD-93.zip can be indexed with the expected cell.

@dagewa
Copy link
Member Author

dagewa commented Jul 20, 2023

I note the comment about porting decode_TY6_oneline into C++. I might look at that, but I don't think it is a blocker for this PR. Performance on those 14 datasets (which use the TY6 compression) seemed acceptable

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.

Now that you tested the code on several datasets, I think this is ready to be merged.
Thanks!

Non-essential suggestion:
How about mentioning the file name issue as a comment, or submiting an issue to the DIALS repository, so that someone who processes ROD datasets can find the workaround.

@dagewa
Copy link
Member Author

dagewa commented Jul 20, 2023

Thanks! I put the issue in dxtbx, because that's where the template handling is found. But I added a note to the module docstring too.

I'll wait to see if @graeme-winter has any other files to test before merging.

@graeme-winter
Copy link
Collaborator

Thanks! I put the issue in dxtbx, because that's where the template handling is found. But I added a note to the module docstring too.

I'll wait to see if @graeme-winter has any other files to test before merging.

Should Hypix 6000 data work?

Grey-Area work :) $ dials.import ../LY*
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
DIALS 3.dev.1007-g94744f537
/Users/graeme/git/dials/modules/dxtbx/src/dxtbx/format/FormatROD.py:232: RuntimeWarning: invalid value encountered in multiply
  gonio_angles = np.array(self._bin_header["start_angles_steps"]) * np.array(

The following parameters have been modified:

input {
  experiments = <image files>
}

--------------------------------------------------------------------------------
  format: <class 'dxtbx.format.FormatROD.FormatROD'>
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_1_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_2_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_3_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_4_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_5_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_6_##.rodhypix:90:99
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:1:1
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:10:10
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:100:109
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:11:11
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:110:119
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:12:12
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:120:129
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:13:13
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:130:139
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:14:14
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:140:149
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:15:15
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:150:159
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:16:16
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:160:169
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:17:17
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:170:179
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:18:18
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:180:189
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:19:19
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:190:199
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:2:2
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:20:20
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_###.rodhypix:200:200
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:21:29
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:3:3
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:30:39
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:4:4
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:40:49
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:5:5
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:50:59
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:6:6
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:60:69
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:7:7
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:70:79
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:8:8
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:80:89
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_#.rodhypix:9:9
  template: /Users/graeme/data/rigaku-hypix-6000/native/LY_HP6000_7_##.rodhypix:90:99
  num images: 1400
  sequences:
    still:    0
    sweep:    273
  num stills: 0
--------------------------------------------------------------------------------
Writing experiments to imported.expt

It does not appear to have recognised that _9.thing goes with _10.thing etc. - I thought that was in this PR? I saw commits along these lines

@graeme-winter
Copy link
Collaborator

OK, working around that; please hold the line

@graeme-winter
Copy link
Collaborator

OK, I have a 7-scan run, which only partly indexes:

+------------+-------------+---------------+-------------+
|   Imageset |   # indexed |   # unindexed | % indexed   |
|------------+-------------+---------------+-------------|
|          0 |       19254 |           199 | 99.0%       |
|          1 |        2181 |         17506 | 11.1%       |
|          2 |        3732 |         15335 | 19.6%       |
|          3 |        2172 |         17084 | 11.3%       |
|          4 |       16098 |           129 | 99.2%       |
|          5 |       18165 |           188 | 99.0%       |
|          6 |        1771 |         14536 | 10.9%       |
+------------+-------------+---------------+-------------+

which suggests that there is at least one missed goniometry datum; testing joint=0

(this is for info not a blocker)

Copy link
Collaborator

@graeme-winter graeme-winter left a comment

Choose a reason for hiding this comment

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

Firstly thank you for the changes - this has been on my to-do for a very long time, and I appreciate the work which went in to getting this done.

As mentioned in the review comment it feels slow to use but I would be the first to recognise working-but-slow is vastly superior to broken.

I also note that indexing a 7 sweep run did not work correctly, where indexing the sweeps one-at-a-time worked fine, so there is some geometric infelicity in the metadata reading (or writing) which would benefit from some attention in a subsequent PR

I would like this to be merged as is, I appreciate the addition of this capability; with the frame renumbering workaround from @biochem-fan this works nicely and adds real capability to DIALS.

I am still waiitng for the processing of my 7-scan run to finish but I am mid-way through integrating it so I am confident that this is a good change set.

epoch=None,
)

def get_raw_data(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

By way of a narrative; spot finding feels slow which I suspect is down to the fact that the get_raw_data() method is itself slower than the equivalent e.g. from CBF or HDF5 data.

I mark this as an opportunity for future improvement perhaps as a C++ implementation rather than a bug here.

@biochem-fan
Copy link
Member

Thank you very much for testing on another dataset.

I also note that indexing a 7 sweep run did not work correctly, where indexing the sweeps one-at-a-time worked fine, so there is some geometric infelicity in the metadata reading (or writing) which would benefit from some attention in a subsequent PR

Indeed, it currently ignores all axes except the last one so I don't expect joint indexing works.

@graeme-winter
Copy link
Collaborator

End result:

                                            Suggested   Low    High  Overall
High resolution limit                           1.45    3.93    1.45    1.42
Low resolution limit                           78.78   78.90    1.47   78.78
Completeness                                   89.2   100.0    27.6    85.3
Multiplicity                                   12.8    21.0     1.1    12.8
I/sigma                                        33.2   120.2     1.0    33.1
Rmerge(I)                                     0.044   0.025   0.443   0.044
Rmerge(I+/-)                                  0.041   0.022   0.767   0.041
Rmeas(I)                                      0.045   0.026   0.626   0.045
Rmeas(I+/-)                                   0.043   0.023   1.085   0.043
Rpim(I)                                       0.010   0.005   0.443   0.010
Rpim(I+/-)                                    0.013   0.006   0.767   0.013
CC half                                       1.000   1.000   0.638   1.000
Anomalous completeness                         79.8   100.0     1.6    75.7
Anomalous multiplicity                          7.3    12.7     1.0     7.2
Anomalous correlation                         0.359   0.725   0.000   0.359
Anomalous slope                               0.797                        
dF/F                                          0.051                        
dI/s(dI)                                      0.717                        
Total observations                           242509   25120     317  242598
Total unique                                  18911    1197     288   18999

I think this is most satisfactory

@graeme-winter
Copy link
Collaborator

Weirdly though:

Grey-Area work :) $ dials.image_viewer integrated.*
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
Traceback (most recent call last):
  File "/Users/graeme/git/dials/build/../modules/dials/src/dials/command_line/image_viewer.py", line 217, in <module>
    run()
  File "/Users/graeme/git/dials/conda_base/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/Users/graeme/git/dials/build/../modules/dials/src/dials/command_line/image_viewer.py", line 193, in run
    params, options = parser.parse_args(args, show_diff_phil=True)
  File "/Users/graeme/git/dials/modules/dials/src/dials/util/options.py", line 876, in parse_args
    params, args = self._phil_parser.parse_args(
  File "/Users/graeme/git/dials/modules/dials/src/dials/util/options.py", line 558, in parse_args
    importer = Importer(
  File "/Users/graeme/git/dials/modules/dials/src/dials/util/options.py", line 207, in __init__
    self.unhandled = self.try_read_experiments_from_images(
  File "/Users/graeme/git/dials/modules/dials/src/dials/util/options.py", line 284, in try_read_experiments_from_images
    experiments = ExperimentListFactory.from_filenames(
  File "/Users/graeme/git/dials/modules/dxtbx/src/dxtbx/model/experiment_list.py", line 533, in from_filenames
    format_class = find_format.find_format(filename)
  File "/Users/graeme/git/dials/modules/dxtbx/src/dxtbx/datablock.py", line 270, in find_format
    self._format_class = get_format_class_for_file(filename)
  File "/Users/graeme/git/dials/modules/dxtbx/src/dxtbx/format/Registry.py", line 121, in get_format_class_for_file
    if scheme in format_class.schemes and format_class.understand(image_file_str):
  File "/Users/graeme/git/dials/modules/dxtbx/src/dxtbx/format/FormatROD.py", line 50, in understand
    hdr = f.read(256).decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 0: ordinal not in range(128)

@graeme-winter
Copy link
Collaborator

@dagewa please could you try

dials.image_viewer indexed.*

or equivalent on any data set

With this change enabled

I think it tries to read *.refl and fails

@graeme-winter
Copy link
Collaborator

dials.image_viewer integrated.*

etc. now fails on e.g. CBF or HDF5 data

@ndevenish
Copy link
Collaborator

This looks like it's trying to read the .refl file, which isn't a plaintext. It's correctly failing, but failing to return False; IIRC this was an intentional because the Registry system used to use exceptions as "Format not understood" but this made it impossible to separate out actual errors from failing to read the file.

@ndevenish
Copy link
Collaborator

This should handle this issue

@graeme-winter
Copy link
Collaborator

This should handle this issue

It did thank you

@dagewa
Copy link
Member Author

dagewa commented Jul 26, 2023

This looks like it's trying to read the .refl file, which isn't a plaintext. It's correctly failing, but failing to return False; IIRC this was an intentional because the Registry system used to use exceptions as "Format not understood" but this made it impossible to separate out actual errors from failing to read the file.

Ah yes, good point. Thanks!

@dagewa dagewa merged commit 180fac8 into cctbx:main Jul 26, 2023
11 checks passed
toastisme pushed a commit to toastisme/dxtbx that referenced this pull request Jul 18, 2024
Partial support for Rigaku Oxford Diffraction format images.
---------

Co-authored-by: Takanori Nakane <nakane.t@gmail.com>
Co-authored-by: Nicholas Devenish <ndevenish@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.

5 participants