-
Notifications
You must be signed in to change notification settings - Fork 17
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
object initalization via STXM vs detector orientation #589
Comments
Just confirming that for me, locally, options 1-3 work. |
Binning seems to be accounted for fine. Once the cropped area on the detector contains any masked pixels, the STXM object initialization does not fail, but creates nonsense object inits. That might be connected to the very high value in the "to be masked pixels" in my data. |
replacing all usage of "pod.diff" in /utils/scripts.py with "(pod.diff * pod.mask)" takes care of the troubles when there are masked pixels. |
Hi @kahntm, many thanks for looking into this rarely-used and thus rarely-debugged feature! My slight preference is for your suggested solution number 3. If you can also implement the pod.mask trick in the same PR that would be great. |
I pushed the changes described above to a new separate branch ''debug_stxm_init". I did not yet make it a pull request, as I am still not sure if the fixing of the sign is just a thing for me or if I mess-up a working feature for everyone else. |
Hej Benedikt, thanks for checking. Then I can make that a PR. |
I recently took a ptycho scan near the focus.
Here a STXM-like map... the STXM signal (summed diffraction patterns as a function of position):
I tried initializing the sample using the 'stxm' option using these three lines:
Checking the initial dump file (...None_0000.ptyr) I noticed that there is a decently looking object amplitude, but the object phase is slightly wrong:
In the phase image, horizontal and vertical phase features have opposite signs, where they should have identical signs. Later iterations get it right, but ideally it would be right from the start.
The error as above can happen when either the vertical or the horizontal DPC map has the wrong sign.
I checked my detector orientation and it has been what it always has been.
When wrongfully setting it to (False, False, False), I get the correct looking amplitude and phase in the initial object:
But of course the later iterations result in wrong reconstructions, as the diffraction patterns are used the wrong way around.
As changing the detector orientation clearly affected the object that was created, the given orientation is taken into account and the DPC is calculated from "pre-processed" diffraction patterns.
Assuming there is nothing else funky with my installation or the NanoMAX class, the error must be in the DPC calculation.
Looking at the code in question (/core/sample.py) I see three ways of fixing this:
Before changing anything anywhere, it would be good if someone else could confirm with their data that this is a systematic error. Option 5 is the most flexible, but also the one that allows for the most errors when using it.
The text was updated successfully, but these errors were encountered: