cctbx / dxtbx

Diffraction Experiment Toolbox
BSD 3-Clause "New" or "Revised" License
2 stars 18 forks source link

Trying to override panel geometry fails #299

Closed graeme-winter closed 1 year ago

graeme-winter commented 3 years ago
Silver-Surfer 20200922_1431_rotation_data_150deg :( $ dials.import bipySQA_images.nxs goniometer.axes=1,0,0,0.766414,-0.642347,0,1,0,0 panel.fast_axis=0,-1,0 panel.slow_axis=1,0,0 panel.origin=-15.0417,103.915,-64.6736
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
DIALS 3.dev.359-gc125d54b0
The following parameters have been modified:

input {
  experiments = <image files>
}
geometry {
  detector {
    panel {
      fast_axis = 0 -1 0
    }
    panel {
      slow_axis = 1 0 0
    }
    panel {
      origin = -15.0417 103.915 -64.6736
    }
  }
  goniometer {
    axes = 1 0 0 0.766414 -0.642347 0 1 0 0
  }
}

fails with

RuntimeError: Please report this error to dials-support@lists.sourceforge.net: dxtbx Internal Error: /Users/graeme/svn/cctbx/modules/dxtbx/model/virtual_panel.h(92): DXTBX_ASSERT((double)(d1 * d2) < EPS) failure.

Debugging by print() shows:

                print(panel_params.fast_axis, panel_params.slow_axis, panel_params.origin)

->

[0.0, -1.0, 0.0] (-0.0, -1.0, 0.0) (103.971395, 15.160915000000003, -61.9456)

i.e. seems to only be re-assigning one axis then failing. How can I re-assign all of these at once?

graeme-winter commented 3 years ago

Putting everything into a phil file seems to work - but this is not obvious to the general user:

geometry {
  detector {
    panel {
      fast_axis = 0 -1 0
      slow_axis = 1 0 0
      origin = -15.0417 103.915 -64.6736
    }
  }
  goniometer {
    axes = 1 0 0 0.766414 -0.642347 0 1 0 0
  }
}
rjgildea commented 3 years ago

This is a consequence of the panel scope being .multiple=True - there is no way on the command line to "group" parameters into the same instance of the scope. I think explicitly providing a phil file is the only way to do this.

graeme-winter commented 3 years ago

... in which case pls can program stop and tell me this, rather than proceeding partially then complaining to me that it did something wrong?

alternatively... probably not rocket science to match these things up manually?

Humbly suggest reading part of what I told it and then failing is the most unhelpful correct outcome one could expect.