Giter Site home page Giter Site logo

Make 'hkl.calc.get_position(h, k, l, wl)' value error "Reflection un-reachable as wavelength is more than twice the plane distance" optional about diffcalc-core HOT 1 CLOSED

diamondlightsource avatar diamondlightsource commented on August 16, 2024
Make 'hkl.calc.get_position(h, k, l, wl)' value error "Reflection un-reachable as wavelength is more than twice the plane distance" optional

from diffcalc-core.

Comments (1)

isikhar avatar isikhar commented on August 16, 2024

Works on main branch:

>>> from diffcalc.hkl.calc import HklCalculation
>>> from diffcalc.hkl.constraints import Constraints
>>> from diffcalc.hkl.geometry import Position
>>> from diffcalc.ub.calc import UBCalculation
>>> from diffcalc.util import I
>>> from pprint import pprint

>>> ubcalc = UBCalculation("sixcircle")
>>> ubcalc.set_lattice("Cubic", 5.0)
>>> ubcalc.set_u(I)
Calculating UB matrix.
>>> ubcalc.UB
array([[ 1.25663706e+00, -2.02082652e-16, -2.02082652e-16],
       [ 0.00000000e+00,  1.25663706e+00, -7.69468277e-17],
       [ 0.00000000e+00,  0.00000000e+00,  1.25663706e+00]])
>>> cons = Constraints({"psi": 0, "mu": 0, "nu": 0})
>>> hklcalc = HklCalculation(ubcalc, cons)
>>> wl = 1.0
>>> hkl = (-7.9686, -2.4182, 5.0)
>>> all_pos = hklcalc.get_position(*hkl, wl)
>>> for pos, virt in all_pos:
...   pprint(pos.asdict)
...   pprint(virt)
...   print()
... 
{'chi': 64.18973190676942,
 'delta': 152.48941882403741,
 'eta': 21.120991410913476,
 'mu': 0.0,
 'nu': 0.0,
 'phi': -90.0}
{'alpha': -68.87900858908654,
 'beta': -41.36842741312396,
 'betain': 18.928712375048693,
 'betaout': 42.50142273269622,
 'naz': 90.00000000000001,
 'psi': -8.017236285327718e-15,
 'qaz': 90.0,
 'tau': 145.12371800110526,
 'theta': 76.24470941201871,
 'ttheta': 152.48941882403741}

{'chi': -64.18973190676942,
 'delta': 152.48941882403741,
 'eta': -158.8790085890865,
 'mu': 0.0,
 'nu': 0.0,
 'phi': 90.0}
{'alpha': -68.87900858908652,
 'beta': -41.36842741312394,
 'betain': 18.928712375048708,
 'betaout': 42.50142273269622,
 'naz': 90.0,
 'psi': 0.0,
 'qaz': 90.0,
 'tau': 145.12371800110523,
 'theta': 76.24470941201871,
 'ttheta': 152.48941882403741}

{'chi': 115.81026809323058,
 'delta': -152.48941882403741,
 'eta': 158.8790085890865,
 'mu': 0.0,
 'nu': 0.0,
 'phi': 90.0}
{'alpha': -68.87900858908652,
 'beta': -41.36842741312394,
 'betain': 18.928712375048708,
 'betaout': 42.501422732696234,
 'naz': -90.00000000000001,
 'psi': 8.017236285327715e-15,
 'qaz': -90.0,
 'tau': 145.12371800110523,
 'theta': 76.24470941201871,
 'ttheta': 152.48941882403741}

{'chi': -115.81026809323058,
 'delta': -152.48941882403741,
 'eta': -21.120991410913476,
 'mu': 0.0,
 'nu': 0.0,
 'phi': -90.0}
{'alpha': -68.87900858908654,
 'beta': -41.36842741312396,
 'betain': 18.928712375048693,
 'betaout': 42.50142273269622,
 'naz': -90.0,
 'psi': 0.0,
 'qaz': -90.0,
 'tau': 145.12371800110526,
 'theta': 76.24470941201871,
 'ttheta': 152.48941882403741}

from diffcalc-core.

Related Issues (4)

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.