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

This winter solstice, we celebrate the wonders of the parallax effect #591

Merged
merged 61 commits into from
Jan 6, 2024

Conversation

gvarnavi
Copy link
Member

Various updates and new functionality to parallax.
Notably:

  • Realspace mask during preprocess
parallax.preprocess(
    realspace_mask = mask,
    apply_realspace_mask_to_stack=True, # default
)
  • Explicit bin setting during reconstruct
parallax.reconstruct(
    alignment_bin_values = [32,16,8,8,4,4,2,2,2,2]
)
  • Improvements to aberration fitting:

    • force_rotation_deg
    • explicitly setting aberrations to include in fit
    parallax.aberration_fit(
        fit_BF_shifts=True,
        fit_aberrations_mn = [[1,0,0],[2,1,0],[2,1,1]], # defocus and coma only
    )
    • convert fitted aberrations to polar dictionary for use in ptycho
    ptycho = py4DSTEM.process.phase.SingleslicePtychographicReconstruction(
        polar_parameters = parallax.aberration_dict_polar
    )
  • Improvements to upsampling interpolation methods

    • Correct DF and BF warning limits
    • Bilinear interpolation (default)
    • Lanczos interpolation
    parallax.subpixel_alignment(
        lanczos_interpolation_order = 2
    )
    • Nearest-neighbor rolling
    parallax.subpixel_alignment(
        integer_pixel_rolling_alignment = True
    )
  • Probe position refinement

Fixed-step gradient descent or "checker-boarding" algorithm with initial_step_size, decreasing geometrically by step_size_factor up to a minimum step of min_step_size.

parallax.subpixel_alignment(
    position_correction_num_iter = 2,
    position_correction_checkerboard_steps = False, # default
    position_correction_initial_step_size=0.125,
    position_correction_min_step_size=0.1,
    position_correction_step_size_factor=0.75,
    position_correction_butterworth_q_lowpass = (0.05,0.05),
    position_correction_butterworth_q_highpass = (0.005,0.005),
    position_correction_butterworth_order = (4,4),
)

Probe-position refinement results can be inspected using

parallax.show_probe_position_shifts(
     # vmin=-0.5,
     # vmax=0.5,
)

@gvarnavi gvarnavi requested a review from smribet December 22, 2023 01:26
Copy link
Member

@sezelt sezelt left a comment

Choose a reason for hiding this comment

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

All looks good, mostly just highlighted a few missing/incomplete docstring things

py4DSTEM/io/filereaders/read_arina.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/utils.py Outdated Show resolved Hide resolved
py4DSTEM/process/phase/iterative_parallax.py Show resolved Hide resolved
@gvarnavi gvarnavi merged commit b167640 into dev Jan 6, 2024
10 checks passed
bsavitzky pushed a commit to bsavitzky/py4DSTEM that referenced this pull request Mar 12, 2024
This winter solstice, we celebrate the wonders of the parallax effect

Former-commit-id: b167640
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.

4 participants