Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fake_calibration_image images are missing first/last ring #2440

Closed
kif opened this issue Feb 17, 2025 · 3 comments
Closed

fake_calibration_image images are missing first/last ring #2440

kif opened this issue Feb 17, 2025 · 3 comments
Labels
bug Serious issue, to be addressed in priority !

Comments

@kif
Copy link
Member

kif commented Feb 17, 2025

bug_20250212.pdf

Thanks Oier for the report.

@kif kif added the bug Serious issue, to be addressed in priority ! label Feb 17, 2025
@EdgarGF93
Copy link
Collaborator

EdgarGF93 commented Feb 17, 2025

Yes, there is a bug with fake_calibration_image:

    angle1 = 26.6
    angle2 = 26.8
    ai1 = AzimuthalIntegrator(dist=1.185, detector=detector, wavelength=wl, poni1=my_poni1, poni2=my_poni2, rot1=np.radians(angle1))
    ai2 = AzimuthalIntegrator(dist=1.185, detector=detector, wavelength=wl, poni1=my_poni1, poni2=my_poni2, rot1=np.radians(angle2))
    data1 = cal.fake_calibration_image(ai=ai1)   
    data2 = cal.fake_calibration_image(ai=ai2)
    fig, ax = subplots(nrows=3)
    display(data1, ax=ax[0], label=f"Angle: {angle1}")
    display(data2, ax=ax[1], label=f"Angle: {angle2}")    
    res1d_1 = ai1.integrate1d(data1, 1000, unit="2th_deg")
    res1d_2 = ai2.integrate1d(data2, 1000, unit="2th_deg")
    plot1d(result=res1d_1, ax=ax[2], label=f"Angle: {angle1}")
    plot1d(result=res1d_2, ax=ax[2], label=f"Angle: {angle2}")
    plt.show()

Image

fake_calibration_image is strict with the peaks he is simulating and if the center of the peak does not fall into the image, he is not using that peak, although the tails of the peaks does appear in the image. It's easy to see if we integrate a bunch angles between 26 and 28 degrees:

Image

@EdgarGF93
Copy link
Collaborator

By adding a soft condition:

if t >= tth_max * 1.05:

We get:

Image

Image

@EdgarGF93
Copy link
Collaborator

EdgarGF93 commented Feb 17, 2025

Closed with #2441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Serious issue, to be addressed in priority !
Projects
None yet
Development

No branches or pull requests

2 participants