Created
August 29, 2016 14:11
-
-
Save CJ-Wright/ca3acbb20f780c45c290b29aa5c681fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyFAI.geometry import Geometry | |
from skbeam.core.utils import radius_to_twotheta | |
from skbeam.core.utils import twotheta_to_q | |
from numpy.testing import assert_array_almost_equal | |
import matplotlib.pyplot as plt | |
geo = Geometry( | |
detector='Perkin', pixel1=.0002, pixel2=.0002, | |
dist=.23, | |
poni1=.209, poni2=.207, | |
# poni1=0, poni2=0, | |
# rot1=.0128, | |
# rot2=-.015, | |
# rot3=-5.2e-8, | |
wavelength=1.43e-11 | |
) | |
r = geo.rArray((2048, 2048)) | |
tth = radius_to_twotheta(.23, r) | |
q = twotheta_to_q(tth, .143) | |
pfq = geo.qArray((2048, 2048))/10 | |
fig, axs = plt.subplots(1, 2, sharex=True, sharey=True) | |
axs[0].imshow(r) | |
axs[0].set_title('r') | |
axs[1].imshow(pfq) | |
axs[1].set_title('q') | |
plt.show() | |
print(q) | |
print() | |
print(pfq) | |
assert_array_almost_equal(q, pfq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment