silx-kit / pyFAI

Fast Azimuthal Integration in Python
Other
105 stars 95 forks source link

View of calibrant rings blurry for small wavelengths #1507

Closed elena-pascal closed 3 years ago

elena-pascal commented 3 years ago

Hello pyFAI team,

I am trying to use the API for some electron diffraction applications. I have noticed that the view of the calibrants looks odd for my wavelengths, almost like all rings blurred together. I am pretty sure my geometry is correct, and there should be rings.

Is this expected behaviour or did I hit some edge case?

Thanks, Elena

kif commented 3 years ago

On Wed, 28 Apr 2021 10:25:06 -0700 Elena Pascal @.***> wrote:

Hello pyFAI team,

I am trying to use the API for some electron diffraction applications. I have noticed that the view of the calibrants looks odd for my wavelengths, almost like all rings blurred together. I am pretty sure my geometry is correct, and there should be rings.

Is this expected behaviour or did I hit some edge case?

Dear Elena,

I am sorry but I know nothing about electron microscopy ...

What you are seeing in actually all rings superimposed and concentrated close to the beam-center.

PyFAI has been developed at the European synchrotron for X-Ray applications. I know it has been adapted by (computer-) skilled scientists at the ILL neutron source, with longer wavelength

Electron wavelengths are much shorter than X-rays... but since you are playing with electrons, which are charged and easier to focus compared with photon/neutrons, I wonder if there is not a magnification factor. Try to divide your pixel size (or your distance) by this magnification factor (I thinks I have seen it in some images coming from electron microscope).

I will ask on the mailing list ...

Cheers,

Jerome

RGBYCP commented 3 years ago

I am also not an expert in electron diffraction, but an interesting question. Your energy is very high in comparison to standard X-ray experiments. Are Si, LaB6 used as calibration standards for electron diffraction? Can you or have you measured gold as calibration standard and tried with PyFAI? I found this document https://www.cambridge.org/core/services/aop-cambridge-core/content/view/744632B3939F76A84A780DDBC0B4EA2C/S1551929520001066a.pdf/recipes-for-consistent-selected-area-electron-diffraction-results-part-3-electron-diffraction-analysis-software.pdf The software looks a bit similar to PyFAI. Edit: I think Jerome made a good point with respect to the magnification factor.

@kif : The other day I thought about using pyFAI with neutrons. Where could I read more about this, please?

kif commented 3 years ago

@RGBYCP, I asked my contact at ILL if he is willing to exchange. He is on vacation for now. @elena-pascal, I got a positive feed-back on the official mailing list (pyFAI@esrf.fr, registration needed).

I suggested to the contact to come here and comment your issue

elena-pascal commented 3 years ago

@kif I did notice that pyFAI was developed for X-Rays. Feel free to move this to discussions.

There is a growing community of electron diffraction people applying X-Ray techniques to electrons. It almost works if we can ignore dynamical diffraction and diffuse scattering. The team at DIALS has also been looking for a while now at electron diffraction implementations. We are now interested in treating serial electron diffraction as virtual powder diffraction and see how far we can get. It seemed to me that pyFAI would work pretty much out of the box to do the azimuthal integration part. In fact I got beautiful 1D spectra for the real data of Al Debye–Scherrer rings even if the pyFAI Al calibrant looks blurry for what I think is same geometry. Link to that here .

I am still thinking about the magnification issue. Thank you for your help.

RGBYCP commented 3 years ago

Hi Elena, Thanks for the feedback. Just loud thinking, maybe I am wrong, could you correct me? I don't see why it would not work. Azimuthal integration is only a mathematical process, only later geometry aspects might play a role. Do you have a chance to use gold as calibrant in case it is not the magnification issue (the linked programme in the PDF mentions magnification as well, but shows an example with gold.)? Good luck, thanks for the update.

tjalb commented 3 years ago

Hi Elena, I used pyFAI for MeV-electron diffraction, so for even higher energies than you have. This worked well. However, I never tried to plot fake-calibration images.

The smeared rings in the fake images are related to the width of the peaks, I think. pyFAI.calibrant.ALL_CALIBRANTS("Al").fake_calibration_image has additional parameters "U, V, W" used to calculate the width. At the moment I have no time to look into it in detail but with W=0.000001 I get sharp rings. I hope this helps.

Best, Thies

elena-pascal commented 3 years ago

@RGBYCP Thank you for your suggestions. I've been trying to educate myself because I am not an expert either by any stretch. I actually don't know what standards are used for calibrating rings in the TEM. I do have some amorphous Gold data and I will have a look at that.

Thank you for the paper, looks like a good read. I am more interested in putting together a protocol of indexing more general electron diffraction patterns, rather than solving a specific structure, and for this reason I am looking primarily into open access, more copyleft licenced software. Python API definitely a plus. But it is worth having a look at the software presented there.

I don't see why it would not work. Azimuthal integration is only a mathematical process, only later geometry aspects might play a role.

Yes, this is also what I think.

elena-pascal commented 3 years ago

Hello Thies, Excellent news! The 'U, V, W' factors are exactly what I was wondering about, my naive attempts did not show much results but I think I did not go low enough. Thank you for the tip, I will try it out.

Thank you, Elena

tjalb commented 3 years ago

Related to the magnification: In a TEM you have various lenses. If you know the detector (pixel size, number of pixels) and the calibrant, shouldn't the lenses just change the "distance" between the sample and the detector? So, instead of the real distance, you get a "virtual" distance when calibrating with pyFAI.

elena-pascal commented 3 years ago

Al for W=0.000001

elena-pascal commented 3 years ago

Ok, regarding magnification, @tjalb is exactly right, and I learned some TEM optics today: the detector distance I used and refine for is the effective (or virtual if you will) camera length.

I'm happy to close the 'issue'.