Fix an issue with the modulus projector, update test to catch that issue

This commit is contained in:
Abe Levitan
2019-03-28 15:56:48 -04:00
parent 7f31d402ff
commit 89f96b459e
2 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -32,9 +32,9 @@ def modulus(wavefront, intensities, mask = None):
projected = wavefront * (amplitudes / wavefront_mag)[...,None]
# Replace amplitude of wavefront with measured amplitude
if mask is not None:
selection = (mask == 0)
selection = mask == 0
# Apply the mask to replace unmasked pixels in the original wavefront
projected[selection] = wavefront[selection]
projected = projected.masked_scatter(selection, wavefront.masked_select(selection))
return projected