Replies: 5 comments
-
Hi Gudrun,
If you want something reproducible, please provide the
where you have a least 6 digits precision. The residual error come from numerical rounding errors. |
Beta Was this translation helpful? Give feedback.
-
If you don't mind, I will mode this to discussion. |
Beta Was this translation helpful? Give feedback.
-
Of course not. Please go ahead. It could be of interest to others. I will use your example and feed them into my algorithm to see how it performs. |
Beta Was this translation helpful? Give feedback.
-
Hi @kif , I had another look at the chi values. Is there a reason why the difference between target and simulated values are larger at the beginning and smaller at the end? It does not matter what I choose as params for npt_azim, azim_start, azim_stop. My example: import pyFAI.azimuthalIntegrator
%matplotlib widget
import matplotlib.pyplot as plt
import pyFAI
import numpy as np
npt_azim=36
azim_start=-180
azim_stop =180
pilatus = pyFAI.detector_factory("Pilatus1M")
pilatus.mask = np.zeros(pilatus.shape)
wl = 1e-10
ai_init = {"dist":1.0,
"poni1":0.0,
"poni2":0.0,
"rot1":-0.05,
"rot2":+0.05,
"rot3":0.0,
"detector":pilatus,
"wavelength":wl}
ai = pyFAI.azimuthalIntegrator.AzimuthalIntegrator(**ai_init)
if azim_stop > 180:
ai.setChiDiscAtZero()
else:
ai.setChiDiscAtPi()
delta_chi_ideal = (azim_stop-azim_start)/npt_azim
chi_target = np.linspace(azim_start+delta_chi_ideal/2, azim_stop-delta_chi_ideal/2, npt_azim, endpoint=True)
print('chi_target=',chi_target)
chi_simu=ai.integrate2d(ai.detector.mask,100,int(npt_azim),
unit="r_mm",method=("no", "histogram", "cython"),azimuth_range=(azim_start,azim_stop)).azimuthal
print("chi_simu=",chi_simu)
delta_chi =chi_target-chi_simu
fig, ax= plt.subplots()
ax.plot(chi_simu,delta_chi, label='delta_chi', marker='o')
ax.set_title(r'$\chi_{\mathrm{ideal}} - \chi_{\mathrm{pyfai}}$')
ax.set_xlabel('chi (pyfai) [deg]')
ax.set_ylabel('delta_chi [deg]')
delta_chi[0]>delta_chi[-1] |
Beta Was this translation helpful? Give feedback.
-
Hi Gudrun, The difference you are viewing are small and on the order of magnitude of the precision of a float32 ... To be precise, one should come back on the definition of an histogram, where the lower bound is included and the upper-bound excluded. This is why the upper-bound gets multiplied by (1+eps32) so that the maximum value is actually accounted for. And what you are seeing is this epsilon spread over all bins. |
Beta Was this translation helpful? Give feedback.
-
Dear pyFAI-Team,
I am looking at azimuthal chi values. If I specify a 10deg step (36 points in the azimuthal integration), I get
The difference between the symmetric chis (-175.00036405, 174.97450325 ) is 0.025860.
My questions are:
Thank you for your help.
Best regards, Gudrun
Beta Was this translation helpful? Give feedback.
All reactions