update the requirements files and fix a bug that prevented install when not in developer mode

This commit is contained in:
Abe Levitan
2023-01-13 11:59:07 -08:00
parent a260168d9d
commit 9f341fb4bd
5 changed files with 25 additions and 11 deletions
+3
View File
@@ -146,6 +146,7 @@ class FancyPtycho(CDIModel):
randomize_ang=0,
padding=0,
n_modes=1,
n_obj_modes=1,
dm_rank=None,
translation_scale=1,
saturation=None,
@@ -240,6 +241,8 @@ class FancyPtycho(CDIModel):
probe = t.stack([probe, ] + probe_stack)
obj = t.exp(1j * randomize_ang * (t.rand(obj_size)-0.5))
if n_obj_modes != 1:
obj = t.stack([obj,] + [0.05*t.ones_like(obj),]*(n_obj_modes-1))
det_geo = dataset.detector_geometry
@@ -439,7 +439,7 @@ def ptycho_2D_sinc(probe, obj, translations, shift_probe=True, padding=10, multi
subpixel_translations = translations - integer_translations
integer_translations = integer_translations.to(dtype=t.int32)
if not polarized:
selections = t.stack([obj[tr[0]:tr[0]+probe.shape[-2],
selections = t.stack([obj[..., tr[0]:tr[0]+probe.shape[-2],
tr[1]:tr[1]+probe.shape[-1]]
for tr in integer_translations])
else:
@@ -474,9 +474,12 @@ def ptycho_2D_sinc(probe, obj, translations, shift_probe=True, padding=10, multi
shifted_probe = t.fft.ifft2(t.fft.ifftshift(shifted_fft_probe,
dim=(-1,-2)))
if not polarized:
if multiple_modes: # Multi-mode probe
# TODO This is a kludge, I will fix this. I need to handle
# multiple incoherently mixing polarized objects
if multiple_modes and len(selections.shape) == 3: # Multi-mode probe
output = shifted_probe * selections[...,None,:,:]
else:
# This will only work if the
output = shifted_probe * selections
# selections: Nx2x2xMxL
# probe: Nx(P)x2x1xMxL