pyFAI icon indicating copy to clipboard operation
pyFAI copied to clipboard

Create option to apply polarization directly (i.e. not a weighted average)

Open kif opened this issue 2 years ago • 2 comments

For more details, see the discussion with the AzInt team on the pyFAI mailing list.

  • [ ] implement in preprocess python
  • [ ] implement in preprocess cython
  • [ ] implement in preprocess opencl
  • [ ] wire in azimuthal integrator as opt-in (i.e. new kwarg option)
  • [ ] non regression test

kif avatar Nov 20 '23 07:11 kif

Hi Jerome, I have been in contact with MAX IV scientist trying to understand this, but I don't quite fully grasp this yet, so I'd like to kindly ask a few questions about it.. From azint code I saw they apply all the corrections to each individual pixel of the data after polar transformation to radial and azimuthal angle, and then they perform the sparse matrix multiplication using CSR method.

  • Now, for pyFAI, is the normalization (which includes polarization, solid angle and flat) applied after binning (radially and, in case of 2D integration, azimuthally)? this is what I think I understood from the CSR engine and the python implementation of preproc. Also, correct me if I'm wrong, but if we set split_result to False, are the corrections done pixel wise? In case I'm right, then is it necessary to apply polarization correction on raw, if we can just NOT split_results?
  • Is preproc done on the original image, or does one have to apply a polar transformation to the raw image before passing it as arg?
  • Even if, in the case of the CSR_integrator, which does split_result=4, do we expect a significant difference if we apply polarization correction to raw data instead of having it as part of normalization? is this difference in intensity, error? Sorry if any of those sounds silly.. I am just starting to try and understand the algorithm (: (I hadn't joined the mailing list in November 2023, so I am not fully aware of what was discussed then)

emilymassahud avatar Apr 03 '24 07:04 emilymassahud

Contribution from the MaxIV diffraction & scattering group errorPropAziInt.pdf

kif avatar Apr 10 '24 16:04 kif

This is all done now. See the documentation in https://github.com/silx-kit/pyFAI/tree/main/doc/source/usage/tutorial/Variance/Unweighted.ipynb

kif avatar May 18 '24 16:05 kif