Skip to content

Fix diffraction (#1)#2

Merged
Baharis merged 1 commit into
masterfrom
fix-diffraction
Apr 15, 2026
Merged

Fix diffraction (#1)#2
Baharis merged 1 commit into
masterfrom
fix-diffraction

Conversation

@Baharis

@Baharis Baharis commented Apr 15, 2026

Copy link
Copy Markdown
Member

The original emulator code was developed by @viljarjf based on the assumption that the Diffsims PR #232, pyxem/diffsims#232, will be merged into the main branch. Unfortunately, this has not come to fruition in the last year, and it unlikely to do so at all. This is a shame, because introducing changes from this PR #232 would improve simulation time by a factor of 2 to 3. Unfortunately, I do not have the time right now to take care of said PR.

With the changes to diffsims not pushed to the main branch, the code for simulating diffraction patterns in the emulator was left unusable. It imported objects and used methods that were defined only on said branch. Consequently, switching to diffraction mode at any time crashed the emulator.

image

This small patch reverts or at least prevents some of the 232-based changes from running, unless the functionality is available. Consequently, if diffsims PR 232 ever comes to be included in any form, the speed of the simulations will improve. For the time being, the speed stays underwhelming and may be an issue when trying to collect images fast, but the server does not crash and displays some visualization of the reciprocal space properly.

Note: This is just a mirror of #1, just this time to the main branch (previously merged to side branch because I'm dumb)

* Simple but slow fix to allow observing diffraction mode again

* Tried to introduce some optimizations but couldn't, current version is good-enough
@Baharis
Baharis merged commit 8fc6966 into master Apr 15, 2026
@Baharis
Baharis deleted the fix-diffraction branch April 15, 2026 15:46
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.

1 participant