Skip to content

Commit

Permalink
add: detd to to_cxy
Browse files Browse the repository at this point in the history
  • Loading branch information
szsdk committed Aug 4, 2024
1 parent 3039d12 commit f07007f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion emcfile/_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f07007f

Please sign in to comment.