From 2774953c2aaae948ad1b61d00daab2a4a289cc02 Mon Sep 17 00:00:00 2001 From: Abe Levitan Date: Mon, 15 Mar 2021 18:55:05 -0400 Subject: [PATCH] Fix a bug in the incoherent probe mode update --- CDTools/models/fancy_ptycho.py | 3 ++- CDTools/models/multislice_2d_ptycho.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CDTools/models/fancy_ptycho.py b/CDTools/models/fancy_ptycho.py index f075ecd..683a320 100644 --- a/CDTools/models/fancy_ptycho.py +++ b/CDTools/models/fancy_ptycho.py @@ -286,7 +286,8 @@ class FancyPtycho(CDIModel): if len(self.weights[0].shape) == 0: # If a purely stable coherent illumination is defined - prs = cmath.cmult(Ws[...,None,None,None,:],basis_prs) + # No cmult because Ws is real in this case + prs = Ws[...,None,None,None,None] * basis_prs else: # If a frame-by-frame weight matrix is defined # This takes the dot product of all the weight matrices with diff --git a/CDTools/models/multislice_2d_ptycho.py b/CDTools/models/multislice_2d_ptycho.py index 02cd397..9ec50e4 100644 --- a/CDTools/models/multislice_2d_ptycho.py +++ b/CDTools/models/multislice_2d_ptycho.py @@ -300,7 +300,8 @@ class Multislice2DPtycho(CDIModel): if len(self.weights[0].shape) == 0: # If a purely stable coherent illumination is defined - prs = cmath.cmult(Ws[...,None,None,None,:],basis_prs) + # No cmult because Ws is real in this case + prs = Ws[...,None,None,None,None] * basis_prs else: # If a frame-by-frame weight matrix is defined # This takes the dot product of all the weight matrices with