Skip to content

Commit

Permalink
Merge pull request #1962 from vallsv/fix-convert-to-d2
Browse files Browse the repository at this point in the history
Added convertion from tthrad to RecD2_NM
  • Loading branch information
kif authored Oct 3, 2023
2 parents a1187e2 + 588d591 commit 4e3f6d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyFAI/gui/utils/unitutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,8 @@ def from2ThRad(twoTheta, unit, wavelength=None, directDist=None, ai=None):
else:
beamCentre = ai.getFit2D()["directDist"] # in mm!!
return beamCentre * numpy.tan(twoTheta) * 0.001
elif unit == units.RecD2_NM:
q = (4.e-9 * numpy.pi / wavelength) * numpy.sin(.5 * twoTheta)
return (q / (2.0 * numpy.pi)) ** 2
else:
raise ValueError("Converting from 2th to unit %s is not supported", unit)

0 comments on commit 4e3f6d7

Please sign in to comment.