Skip to content

Commit

Permalink
Added convertion from tthrad to RecD2_NM
Browse files Browse the repository at this point in the history
  • Loading branch information
vallsv committed Oct 2, 2023
1 parent a1187e2 commit 588d591
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 588d591

Please sign in to comment.