Skip to content

Commit

Permalink
Putative support for E-32-0105 instrument with vertical axis at Max I…
Browse files Browse the repository at this point in the history
…V: overrides default based on serial number key
  • Loading branch information
graeme-winter committed Jun 27, 2018
1 parent 0c18395 commit 66a61ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dxtbx/format/FormatHDFEigerNearlyNexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,20 @@ def create_scalar(handle, path, dtype, value):
# print " - making up starting angle to be 0"
# print " - using /entry/sample/goniometer/omega_range_average as oscillation range"
# Get the number of images

try:
key = handle['/entry/instrument/detector/detector_number'].value
default_axis = {'E-32-0105':(0,1,0)}[key]
except KeyError as e:
default_axis = (1,0,0)

num_images = 0
for name in sorted(handle['/entry/data'].iterkeys()):
num_images += len(handle_orig['/entry/data/%s' % name])
dataset = group.create_dataset('omega', (num_images,), dtype="float32")
dataset.attrs['units'] = 'degree'
dataset.attrs['transformation_type'] = 'rotation'
dataset.attrs['vector'] = (1, 0, 0)
dataset.attrs['vector'] = default_axis
dataset.attrs['offset'] = 0
dataset.attrs['depends_on'] = '.'
omega_range_average = handle['/entry/sample/goniometer/omega_range_average'][()]
Expand Down

7 comments on commit 66a61ba

@graeme-winter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nksauter for info

@jmp1985 discussion topic if this is better solution than subclassing

@graeme-winter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Results from xia2:

For AUTOMATIC/DEFAULT/NATIVE                 Overall    Low     High
High resolution limit                           1.11    3.01    1.11
Low resolution limit                           55.83   55.90    1.13
Completeness                                   94.3   100.0    53.5
Multiplicity                                   10.9    12.4     4.2
I/sigma                                        11.7    40.1     1.0
Rmerge(I)                                     0.083   0.054   0.859
Rmerge(I+/-)                                  0.080   0.052   0.813
Rmeas(I)                                      0.087   0.056   0.972
Rmeas(I+/-)                                   0.087   0.056   0.989
Rpim(I)                                       0.025   0.016   0.446
Rpim(I+/-)                                    0.033   0.021   0.557
CC half                                       0.999   0.998   0.594
Wilson B factor                              10.275
Anomalous completeness                         92.0   100.0    44.3
Anomalous multiplicity                          5.8     7.2     2.4
Anomalous correlation                        -0.001  -0.053  -0.055
Anomalous slope                               0.892
Total observations                           479780   31855    5169
Total unique                                  44001    2569    1228
Assuming spacegroup: P 41 21 2
Other likely alternatives are:
P 43 21 2
Unit cell (with estimated std devs):
78.94923(12) 78.94923(12) 36.92462(9)
90.0         90.0         90.0    

MTZ out to dimple with PDB file gives about 25% Rwork / free => think we're OK

@nksauter
Copy link
Contributor

Choose a reason for hiding this comment

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

The code does process the MAX-IV Eiger 16M H5 file, yet the mechanism used is still up for debate. This commit hardcodes the vertical gonio axis (0,1,0) based on the detector serial number, yet the file actually encodes the gonio axis under the key /entry/sample/transformations/omega/vector. So shouldn't the dxtbx format reader check the serial number, and if it is E-32-0105, proceed to the keyed gonio axis?

@graeme-winter
Copy link
Contributor Author

@graeme-winter graeme-winter commented on 66a61ba Jun 27, 2018 via email

Choose a reason for hiding this comment

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

@graeme-winter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, following up now

Looked for this entry, see:

> h5dump -g /entry/sample/transformations/omega feedback-hewl_2_master.h5 

HDF5 "feedback-hewl_2_master.h5" {
GROUP "/entry/sample/transformations/omega" {
   ATTRIBUTE "vector" {
      DATATYPE  H5T_IEEE_F64LE
      DATASPACE  SIMPLE { ( 3 ) / ( 3 ) }
      DATA {
      (0): 0, -1, 0
      }
   }
}
}

So will need to invert 'Y' anyway to have this work right... however, when I try to access this from h5py with

      print(handle['/entry/sample/transformations/omega'])

I get

Traceback (most recent call last):
  File "/Users/graeme/svn/cctbx/build/../modules/cctbx_project/dxtbx/command_line/print_header.py", line 49, in <module>
    print_header()
  File "/Users/graeme/svn/cctbx/build/../modules/cctbx_project/dxtbx/command_line/print_header.py", line 16, in print_header
    i = format_class(arg)
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/FormatHDFEigerNearlyNexus.py", line 305, in __init__
    FormatHDF5.__init__(self, image_file, **kwargs)
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/FormatHDF5.py", line 17, in __init__
    Format.__init__(self, image_file, **kwargs)
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/Format.py", line 199, in __init__
    self.setup()
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/Format.py", line 209, in setup
    self._start()
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/FormatHDFEigerNearlyNexus.py", line 320, in _start
    fixer = EigerNXmxFixer(self._image_file, temp_file)
  File "/Users/graeme/svn/cctbx/modules/cctbx_project/dxtbx/format/FormatHDFEigerNearlyNexus.py", line 249, in __init__
    print(handle['/entry/sample/transformations/omega'])
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/Users/graeme/svn/cctbx/base/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_hl/group.py", line 167, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'omega' doesn't exist)"

so for reasons which are unclear this can't find the same info that h5dump can see...

@nksauter
Copy link
Contributor

@nksauter nksauter commented on 66a61ba Jun 28, 2018 via email

Choose a reason for hiding this comment

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

@graeme-winter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is attribute of group thing; got it thanks @nksauter

Please sign in to comment.