[WIP] Adding near field ptychography #31
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm starting some work to get a near-field ptychography model working. I thought about a few different ways to do it, and eventually I settled on the idea of making it just an option in fancy_ptycho. I think this has the main downside of making Fancy_ptycho more unwieldy, but it has many upsides:
The way that it works at present is that near-field can be turned on in the
FancyPtycho.from_dataset()factory function by setting thenear_fieldargument to True. In that case, the code will either set up:(1) Genuine near-field propagation with a 2-step Fresnel propagator if "propagation_distance" is set to 0
(2) Fresnel-scaling-theorem propagation with a 2-step Fresnel propagator if "propagation_distance" is finite
This meshes with "propagation_distance" being the initial guess of the illumination's propagation distance from focus. Essentially, if one has a reconstruction working in Far-field with a moderate "propagation_distance" argument, there's a chance you can just try turning on
near_field=Trueand the reconstruction will still work (even if far field is still the appropriate method).Right now, I've tested the Fresnel-scaling theorem part on some internal datasets that I unfortunately can't share here.
Todos