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

error when using the abtem.reconstruct.MultislicePtychographicOperator #135

Open
Hansen311 opened this issue Dec 21, 2023 · 1 comment
Open

Comments

@Hansen311
Copy link

Hi, I got a error when I trying to using the MultislicePtychographicOperator. The code are list below:

ptycho_operator=MultislicePtychographicOperator(measurements,energy=300e3,num_slices=3,slice_thicknesses=10.0)
ptycho_operator.preprocess()
rpie_objects, rpie_probes, rpie_positions, rpie_sse = ptycho_operator.reconstruct(
max_iterations=5, return_iterations=True, random_seed=1, verbose=True
)

The error reported are listed below:

AttributeError Traceback (most recent call last)
Cell In[14], line 1
----> 1 rpie_objects, rpie_probes, rpie_positions, rpie_sse = ptycho_operator.reconstruct(
2 max_iterations=5, return_iterations=True, random_seed=1, verbose=True
3 )

File C:\ProgramData\anaconda3\Lib\site-packages\abtem\reconstruct.py:4843, in MultislicePtychographicOperator.reconstruct(self, max_iterations, return_iterations, fix_com, random_seed, verbose, parameters, measurement_output_view, functions_queue, **kwargs)
4829 fix_probe = (
4830 global_iteration_i
4831 < self._reconstruction_parameters[
4832 "pre_probe_correction_update_steps"
4833 ]
4834 )
4836 (
4837 _overlap_projection,
4838 _fourier_projection,
4839 _update_function,
4840 _position_correction,
4841 ) = update_step
-> 4843 self._probes, exit_wave = _overlap_projection(
4844 self._objects,
4845 self._probes,
4846 position,
4847 old_position,
4848 propagator=propagator,
4849 slice_thicknesses=self._slice_thicknesses,
4850 sampling=self.sampling,
4851 wavelength=wavelength,
4852 xp=xp,
4853 )
4855 modified_exit_wave, self._sse = _fourier_projection(
4856 exit_wave, diffraction_pattern, self._sse, xp=xp
4857 )
4859 (
4860 self._objects,
4861 self._probes,
(...)
4878 xp=xp,
4879 )

File C:\ProgramData\anaconda3\Lib\site-packages\abtem\reconstruct.py:4342, in MultislicePtychographicOperator._overlap_projection(objects, probes, position, old_position, propagator, slice_thicknesses, sampling, wavelength, xp, **kwargs)
4340 exit_waves[s] = objects[s][object_indices] * probes[s]
4341 if s + 1 < num_slices:
-> 4342 probes[s + 1] = _propagate_array(
4343 propagator,
4344 exit_waves[s],
4345 sampling,
4346 wavelength,
4347 slice_thicknesses[s],
4348 overwrite=False,
4349 xp=xp,
4350 )
4352 return probes, exit_waves

File C:\ProgramData\anaconda3\Lib\site-packages\abtem\reconstruct.py:160, in _propagate_array(propagator, waves_array, sampling, wavelength, thickness, overwrite, xp)
126 def _propagate_array(
127 propagator: FresnelPropagator,
128 waves_array: np.ndarray,
(...)
133 xp=np,
134 ):
135 """
136 Propagates complex wave function array through free space distance dz.
137
(...)
158 Propagated array
159 """
--> 160 propagator_array = propagator._evaluate_propagator_array(
161 waves_array.shape, sampling, wavelength, thickness, None, xp
162 )
163 return fft2_convolve(waves_array, propagator_array, overwrite_x=overwrite)

AttributeError: 'FresnelPropagator' object has no attribute '_evaluate_propagator_array'

It seems there is no _evaluate_propagator_array function in the FresnelProgagator.

Thank you very much in advance for your help.

@jacobjma
Copy link
Member

jacobjma commented Jan 8, 2024

Thank you for making us aware of this issue. It may take a little time to solve.

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

No branches or pull requests

2 participants