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

Add .to_pyfai_detector() method #139

Merged
merged 11 commits into from Mar 2, 2022
Merged

Add .to_pyfai_detector() method #139

merged 11 commits into from Mar 2, 2022

Conversation

takluyver
Copy link
Member

Convert EXtra-geom objects to PyFAI detector instances. Use like this:

lpd_pyfai = geom.to_pyfai_detector()  # 

import pyFAI.azimuthalIntegrator

ai = pyFAI.azimuthalIntegrator.AzimuthalIntegrator(
    detector=lpd_pyfai,
    dist=0.2,
    wavelength=12.3984 / 9.3 * 1e-10
)
rint, I = ai.integrate1d(
    frame.reshape(16*256, 256),
    npt=300,
    unit="r_mm",
)

AGIPD, LPD, DSSC are done here. PyFAI partly supports DSSC's hexagonal pixels, and full pixel-splitting support is planned.

It should in principle be easy to extend this to other detectors, but I wanted to make sure it works for these ones first. I also need to ask about how to handle detectors with variable numbers of modules, like Jungfrau.

@takluyver
Copy link
Member Author

I have tried this manually with LPD:

image

DSSC (centre is off - not a problem with this method):

image

and AGIPD 1M:

image

@tmichela
Copy link
Member

nice, that's easier than I would have thought.

LGTM

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@takluyver
Copy link
Member Author

I added several packages used in the tests to the constraints.txt file to control the version used by the CI. It's not all the packages that are getting installed - it's quite a long list because of all the Jupyter stuff nbval pulls in, and I couldn't be bothered to add them all, so I tried to focus on things we use directly, where changes are most likely to cause issues.

@takluyver takluyver added this to the 1.7 milestone Feb 24, 2022
@takluyver takluyver merged commit ad62783 into master Mar 2, 2022
@takluyver takluyver deleted the pyfai-det-ai branch March 2, 2022 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants