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

Issue on get_azimuthal_integral for MIB data format #97

Open
AZangiabadi opened this issue Oct 9, 2024 · 4 comments
Open

Issue on get_azimuthal_integral for MIB data format #97

AZangiabadi opened this issue Oct 9, 2024 · 4 comments

Comments

@AZangiabadi
Copy link

Hi,
I noticed Pyxem versions 0.18.0 and 0.19.0 are not able to process u2 dtype during the azimuthal integration in example 7. Version 0.17.0 doesn't have this error.
Link to the raw mib data: Nano Diamond Diffraction Pattern
See below for more details:
calib = 0.00785
integration = dp.get_azimuthal_integral1d(npt=512)
integration2d = dp.get_azimuthal_integral2d(npt=512)

image

@CSSFrancis
Copy link
Member

@AZangiabadi Thanks for the bug report! The azimuthal integration code changed from 0.17.0 to 0.18.0 so we are using some internal code. Unfortunately that introduced some errors appearently.

The issue is the same as hyperspy/hyperspy#2668 or numba/numba#2243.

For now you should be able to do s.data = s.data.astype(np.unit16) I think which should switch the endianess to little endian.

@CSSFrancis
Copy link
Member

Just a further note that you should look at https://pyxem.readthedocs.io/en/stable/examples/processing/azimuthal_integration.html#sphx-glr-examples-processing-azimuthal-integration-py for more information about how to use the new azimuthal integration :)

@AZangiabadi
Copy link
Author

For now you should be able to do s.data = s.data.astype(np.unit16) I think which should switch the endianess to little endian.

Thank You @CSSFrancis !
the uint16 twists the data in a strange way. I am guessing the header information maybe is getting lost.
This is how it looks like after azimuthal integration.
For now I'll use the v0.17.0.

Also thank you for referring me to the new user guide.

image

@CSSFrancis
Copy link
Member

@AZangiabadi I think that the distortion is actually a result of using the .ai object which is deprecated (although maybe the warning isn't showing up?).

Following the user guide should help you calibrate the dataset in a way such that the azimuthal integral gives you what you would expect.

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

No branches or pull requests

2 participants