Giter VIP home page Giter VIP logo

Comments (8)

graeme-winter avatar graeme-winter commented on August 30, 2024

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

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

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]))

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

Hang on, maybe I am not so happy with that solution after all πŸ€”

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

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]))

from dxtbx.

gebauer avatar gebauer commented on August 30, 2024

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.

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

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?

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

OK - @gebauer I added a fix for this in 8916daf 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...

from dxtbx.

graeme-winter avatar graeme-winter commented on August 30, 2024

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)

from dxtbx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.