-
Notifications
You must be signed in to change notification settings - Fork 14
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
probe options and object options now include relevant Fresnel spectrum propagation multislice parameters and are used in the fwd and adj operators #331
Conversation
…l spectrum propagation to the function so that the defaults aren't used
… multislice prop distance, wavelength)
Hello @a4894z! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
self.pixel_size, | ||
self.probe_FOV, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have replaced pixel_size
with probe_FOV
in all cases, so you can completely remove it from the API.
self.propagation = propagation( | ||
detector_shape=detector_shape, | ||
norm = norm, | ||
probe_shape=probe_shape, | ||
wavelength=probe_wavelength, | ||
probe_FOV=probe_FOV_lengths, | ||
distance=multislice_propagation_distance, | ||
**kwargs, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't need to explicitly pass all of these variables down the stack because keyword arguments are implicitly passed to the component classes using **kwargs
.
probe_photons=self.probe_photons, | ||
probe_wavelength=self.probe_wavelength, | ||
probe_FOV_lengths=self.probe_FOV_lengths, | ||
force_orthogonality=self.force_orthogonality, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use caution when handling unit sizes in the resample functions. I think this might not be correct because when you resample the grid, the real unit sizes of one pixel will change.
Purpose
Previously the multislice class and resulting forward and adjoint operators didn't use the specified parameters (e.g. probe wavelength, probe field of view (FOV), and multislice propagation distance), and instead always used the defaults.
Now, these parameters are explicitly passed into the multislice class.
Also, I now use the same propagator that fold_slice uses, not the one without phase prefactors and with the square root taylor expansion.
Approach
The probe wavelength and probe field of view (FOV) are now part of probe_options and multislice propagation distance is part of object options.
These parameters are then used in the multislice class for a composite operator which uses fresnel spectrum propagation of the type fold_slice uses.
Pre-Merge Checklists
Submitter
Reviewer