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

New TIKE functionality for missing measurement regions on detector and Poisson noise model for exitwave update #273

Merged
merged 44 commits into from
Jul 24, 2023

Conversation

a4894z
Copy link
Contributor

@a4894z a4894z commented Jun 20, 2023

Purpose

This pull request adds the following features to TIKE:

  1. Uses a binary mask to define unmeasured pixels from a ptycho imaging experiment and then only performs exitwave updates in Fourier space at the measured pixels and leaves unconstrained the unmeasured regions.

  2. Introduces the option of using the Poisson noise model for the exitwave update, and performs step length computations using a) the method from ptychoshelves (which only computed steplengths for the dominant exitwave mode and uses that steplength for all the less dominant modes), or b) uses a similar method as ptychoshelves but computing steplengths for each mode individually.

I probably should have split this into two pull requests, but we’re at where we’re at.

Approach

For the unmeasured pixels part, I use a binary array that is loaded from an external source (if not found, we default to assuming no unmeasured pixels) which is then used to define regions where the exitwave gradients are defined and used in the exitwave updates, and regions where the gradient is undefined I leave unconstrained.

For the Poisson noise model exitwave updates, I implement the step length computation as we have discussed during our regular TIKE meetings...in a nutshell: I introduce two methods for computing steplengths for exitwave updates, 1) using the method found in ptychoshelves which only uses the dominant mode for steplength computation and a method I developed which does a vectorized computation of steplength for each exitwave mode separately.

Pre-Merge Checklists

Submitter

  • Write a helpfully descriptive pull request title.
  • Organize changes into logically grouped commits with descriptive commit messages.
  • Document all new functions.
  • Click 'details' on the readthedocs check to view the updated docs.
  • Write tests for new functions or explain why they are not needed.
  • Address any complaints from pep8speaks.

Reviewer

  • Actually read all of the code.
  • Run the new code yourself; the included tests should make this easy.
  • Write a summary of the changes as you understand them.
  • Thank the submitter.

@a4894z a4894z requested a review from carterbox June 20, 2023 13:57
src/tike/ptycho/exitwave.py Outdated Show resolved Hide resolved
src/tike/ptycho/exitwave.py Outdated Show resolved Hide resolved
src/tike/ptycho/exitwave.py Outdated Show resolved Hide resolved
src/tike/ptycho/solvers/options.py Outdated Show resolved Hide resolved
src/tike/ptycho/solvers/lstsq.py Outdated Show resolved Hide resolved
carterbox and others added 2 commits June 22, 2023 14:03
…unction arguments, renamed some functions to be more obvious as to what they're doing
@a4894z a4894z requested a review from carterbox June 27, 2023 19:37
Copy link
Contributor

@carterbox carterbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the docstrings! Please respond to the unaddressed comments above.

@a4894z a4894z requested a review from carterbox June 28, 2023 18:36
Copy link
Contributor Author

@a4894z a4894z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see new commit, I think I'm caught up on the issues you raised?

@a4894z a4894z requested a review from carterbox June 29, 2023 18:27
@a4894z a4894z requested a review from carterbox July 7, 2023 20:45
Copy link
Contributor

@carterbox carterbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that there's no axis reordering, it's a lot more readable. Thanks!

src/tike/ptycho/solvers/lstsq.py Outdated Show resolved Hide resolved
@a4894z a4894z merged commit a745c6e into AdvancedPhotonSource:main Jul 24, 2023
3 of 6 checks passed
@a4894z a4894z deleted the poisson_unmeaspixels branch July 24, 2023 17:51
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.

2 participants