Skip to content

Commit

Permalink
Set iw_type
Browse files Browse the repository at this point in the history
  • Loading branch information
jmp1985 committed Nov 22, 2024
1 parent 60a58fc commit 3cb05b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/parakeet/simulate/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import logging
import numpy as np
import warnings
from math import sqrt, pi, floor
from math import sqrt, floor
from collections.abc import Iterable


Expand Down Expand Up @@ -249,6 +249,7 @@ def _create_input_multislice(
if microscope.beam.incident_wave is not None:
assert microscope.beam.incident_wave.shape[0] == input_multislice.ny
assert microscope.beam.incident_wave.shape[1] == input_multislice.nx
input_multislice.iw_type = "User_Define_Wave"
input_multislice.iw_psi = microscope.beam.incident_wave.T.flatten()

# Return the input multislice object
Expand Down Expand Up @@ -354,8 +355,8 @@ def _create_input_multislice_diffraction(
input_multislice.cond_lens_outer_aper_ang = microscope.lens.outer_aper_ang

# Do we have a phase plate
if microscope.phase_plate:
input_multislice.phase_shift = pi / 2.0
# if microscope.phase_plate:
# input_multislice.phase_shift = pi / 2.0

# defocus spread function
input_multislice.obj_lens_ti_sigma = multem.iehwgd_to_sigma(
Expand All @@ -381,6 +382,7 @@ def _create_input_multislice_diffraction(
if microscope.beam.incident_wave is not None:
assert microscope.beam.incident_wave.shape[0] == input_multislice.ny
assert microscope.beam.incident_wave.shape[1] == input_multislice.nx
input_multislice.iw_type = "User_Define_Wave"
input_multislice.iw_psi = microscope.beam.incident_wave.T.flatten()

# Return the input multislice object
Expand Down

0 comments on commit 3cb05b1

Please sign in to comment.