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

Testing out Some Caking Methods #989

Open
Tracked by #991
CSSFrancis opened this issue Jan 22, 2024 · 0 comments
Open
Tracked by #991

Testing out Some Caking Methods #989

CSSFrancis opened this issue Jan 22, 2024 · 0 comments

Comments

@CSSFrancis
Copy link
Member

Is your feature request related to a problem? Please describe.

I think PyFAI is a great thing to have available but as there aren't people (to my knowledge) using pyxem for analyzing x-ray data it might be better to have that as an optional dependancy. This requires that we:

  1. Rewrite our own Azimuthal Integrator class
  2. Write an efficient caking algorithm

Describe the solution you'd like
The nice this about doing this is that we can make this GPU (cuda) accelerated which should be fairly fast and work inline with the template matching code (the main reason for this rewrite).

I've been playing around with a method that first takes a set of control points which define the azimuthal pixels as polygons. It then overlays the cartesian pixel array over the polygons and determines how much of each pixel lies in each polygon. This defines a ragged array of factors to multiply vs slices of the data. The nice thing is that this takes most of the time and can be precomputed.

The array is then sliced many times for each pixel and the slices are multiplied by the pre-computed factors. It's a pretty embarrassingly parallel problem/ would work very well with a GPU. It's also about 2 times faster than the warp_polar function with the added benefit that the total intensity is conserved. I was going to try it out using a GPU and see what if any gains there are from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants