Skip to content

direct ptycho to-dos from Steph/Georgios notebooks #120

@bobleesj

Description

@bobleesj

Direct Ptycho #115 is merged.

@smribet shared a notebook and contained 5 to-do items:

  1. Use consistent angle/rad
direct_ptycho = em.diffractive_imaging.direct_ptychography.DirectPtychography.from_dataset4d(
    dc,
    energy=ENERGY,
    semiangle_cutoff=PROBE_SEMIANGLE,
    aberration_coefs={'C10':10}, # start close to focus
    device="gpu",
    rotation_angle=np.deg2rad(-169), # known rotation
    max_batch_size=32
)

direct ptycho uses angles in rad and iterative uses it in angles. @smribet prefers to have everything in angles.

  1. Add plotting function after direct pycho
todo add plotting funciton (something like this): 
initial_parallax = direct_ptycho.reconstruct(
    upsampling_factor=1,
    deconvolution_kernel='quadratic',
).visualize(
   show_fft = True

add .visualize

  1. Plot after fitting - show whole grid of outcomes and print error/parameters
# todo plotting. it should show the whole grid of outcomes and print error/parameters. 

direct_ptycho.grid_search_hyperparameters(
    aberration_coefs={
        "C10":-348,
        "C12":OptimizationParameter(0, 40, n_points=5),
        "phi12":OptimizationParameter(-np.pi/2, np.pi/2, n_points=5)
    },
    rotation_angle=np.deg2rad(-169),
    deconvolution_kernel='quadratic',
   
)

Pending after 1, 2, 3

  1. Optimization may need a bit more user-friendlyness
from quantem.diffractive_imaging.direct_ptychography import OptimizationParameter
direct_ptycho.optimize_hyperparameters(
    aberration_coefs={
        "C10":OptimizationParameter(-400,400),
        "C12":OptimizationParameter(0, 100),
        "phi12":OptimizationParameter(-np.pi/2, np.pi/2)
    },
    rotation_angle=OptimizationParameter(np.deg2rad(-180), np.deg2rad(-160)),
    deconvolution_kernel='quadratic',
)

5 Resolve ambiguity?

direct_ptycho.fit_hyperparameters(
    # bin_factors=(5,5,5,5,5,4,4,4,3,3,3,2,2,2,1,1,1,),
    # deconvolution_kernel='quadratic', # use parallax for post-fit reconstruction,
    # pair_connectivity = 8,
    # alignment_method = "reference",

)

some way to force rotation to deal with 180 degree ambiguity?

I will first go through 1-3 and bring up a discussion on 4-5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions