From f07007f09e343efa2ea2c50fd15aee2fbca69d66 Mon Sep 17 00:00:00 2001 From: Zhou Shen <342067275@qq.com> Date: Sun, 4 Aug 2024 09:37:19 +0200 Subject: [PATCH] add: detd to to_cxy --- emcfile/_detector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emcfile/_detector.py b/emcfile/_detector.py index be1686a..e4b19b7 100644 --- a/emcfile/_detector.py +++ b/emcfile/_detector.py @@ -631,9 +631,12 @@ def render(self, raw_img: npt.NDArray[Any]) -> npt.NDArray[np.float64]: return cast(npt.NDArray[np.float64], img / self._count) def to_cxy(self, xyz: npt.NDArray[Any]) -> npt.NDArray[np.float64]: - return xyz_to_cxy(xyz, self._det.ewald_rad, self.direction) + cxy = xyz_to_cxy(xyz, self._det.ewald_rad, self.direction) + cxy *= self._det.detd / self._det.ewald_rad + return cxy def to_xyz(self, cxy: npt.NDArray[Any]) -> npt.NDArray[np.float64]: + cxy = cxy * self._det.ewald_rad / self._det.detd return cxy_to_xyz(cxy, self._det.ewald_rad, self.direction) def frame_extent(