Open graeme-winter opened 2 years ago
Aha! Simples just invert the direction for that instrument serial number
h5ls -rvd ../testlyso_D5-4_1_master.h5/entry/instrument/detector/detector_number
Opened "../testlyso_D5-4_1_master.h5" with sec2 driver.
entry/instrument/detector/detector_number Dataset {SCALAR}
Location: 1:271771
Links: 1
Modified: 2022-08-17 11:05:00 BST
Storage: 1 logical byte, 1 allocated byte, 100.00% utilization
Type: 1-byte null-terminated ASCII string
Data:
(0) ""
nope
OK, an afternoon of hacking later I think I have a reasonable logical check to see if your detector is upstream of the beam:
from dxtbx.model.experiment_list import ExperimentList
def is_detector_in_the_way(e):
d = e.detector
if len(d) != 1:
return False
b = e.beam
p = d[0]
n = p.get_normal()
x = b.get_sample_to_source_direction()
dot = sum(_n * _x for _n, _x in zip(n, x))
if abs(dot) > 0.99 and (b.get_wavelength() / d.get_max_resolution(b.get_s0())) > 1:
return True
return False
el = ExperimentList.from_file("imported.expt")
print(is_detector_in_the_way(el[0]))
Hang on, maybe I am not so happy with that solution after all 🤔
This one I am happy with -> now need to work out how to edit the detector model to compensate -
from dxtbx.model.experiment_list import ExperimentList
def is_detector_in_the_way(e):
d = e.detector
if len(d) != 1:
return False
b = e.beam
p = d[0]
n = p.get_normal()
o = p.get_origin()
x = b.get_sample_to_source_direction()
dot = sum(_n * _x for _n, _x in zip(n, x))
doto = sum(_o * _x for _o, _x in zip(o, x))
if abs(dot) > 0.99 and doto > 0:
return True
return False
el = ExperimentList.from_file("imported.expt")
print(is_detector_in_the_way(el[0]))
What is the best way to get around this issue? I have data from the SLS / PXI and it took me quite some time to figure out why it didn't work 😬
Currently, I just invert the last value in the "origin" array manually, and then it seems to work.
What is the best way to get around this issue? I have data from the SLS / PXI and it took me quite some time to figure out why it didn't work 😬
Currently, I just invert the last value in the "origin" array manually, and then it seems to work.
OK, I could have sworn that a fix went out for this along the lines described above. Digging through the history to verify.
What version of DIALS are you using?
OK - @gebauer I added a fix for this in 8916daf88ce94144c5f2d7d585e0c909a79286ce which should have been in releases for last ~ 11 months? I am pretty sure it was back ported to pick up the CCP4 release series as well...
If you could confirm that this is indeed fixed I will close this issue (since it has been fixed, but seems impolite to close an issue when a user has just reported the problem)
Problem comes from SLS where they are using a newer version of the file writer which writes very nearly nexus which looks like NXmx but has inverted beam direction according to how we read.
This reads as NXmx but
yes the effective distance is -150mm