Start to make the lab bragg ptycho code sane, and fix the bug with probe bases when using probe fourier crop

This commit is contained in:
Abe Levitan committed 2024-02-11 17:32:41 -05:00
1 parent 44a6fac37a
commit dd30f58d2d
11 files changed
+348 -242

No files matched your search

+4 -8
View File
@@ -10,18 +10,14 @@ def test_exit_wave_geometry():
shape = t.Size([73,56])
wavelength = 1e-9
distance = 1.
rs_basis, full_shape, det_slice = \
initializers.exit_wave_geometry(basis, shape, wavelength,
distance)
assert full_shape == shape
assert t.ones(full_shape)[det_slice].shape == shape
rs_basis = initializers.exit_wave_geometry(basis, shape, wavelength, distance)
assert t.allclose(rs_basis[0,1],t.Tensor([-8.928571428571428e-07]))
assert t.allclose(rs_basis[1,0],t.Tensor([-4.5662100456621004e-07]))
# Then test it's padding function
rs_basis, full_shape, det_slice = \
initializers.exit_wave_geometry(basis, shape, wavelength,
distance, padding=2)
rs_basis = initializers.exit_wave_geometry(basis, shape, wavelength,
distance, padding=2)
exp_shape = t.Size([77,60])
assert full_shape == exp_shape
assert t.ones(full_shape)[det_slice].shape == shape