Skip to content

Commit

Permalink
Merge pull request #23 from sezelt/dev
Browse files Browse the repository at this point in the history
Fix for calculation of circular and annular detectors
  • Loading branch information
sezelt authored Aug 9, 2024
2 parents 1d48384 + c56cb61 commit 329ccf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "py4D_browser"
version = "1.1.1"
version = "1.1.2"
authors = [
{ name="Steven Zeltmann", email="[email protected]" },
]
Expand Down
16 changes: 8 additions & 8 deletions src/py4D_browser/update_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from PyQt5.QtWidgets import QApplication, QToolTip
from PyQt5 import QtCore
from PyQt5.QtGui import QCursor
import os

from py4D_browser.utils import pg_point_roi, make_detector, complex_to_Lab

Expand Down Expand Up @@ -64,8 +65,8 @@ def update_real_space_view(self, reset=False):
elif detector_shape == "Circle":
R = self.virtual_detector_roi.size()[0] / 2.0

x0 = self.virtual_detector_roi.pos()[0] + R
y0 = self.virtual_detector_roi.pos()[1] + R
x0 = self.virtual_detector_roi.pos()[1] + R
y0 = self.virtual_detector_roi.pos()[0] + R

self.diffraction_space_view_text.setText(
f"Detector Center: ({x0:.0f},{y0:.0f}), Radius: {R:.0f}"
Expand All @@ -78,8 +79,8 @@ def update_real_space_view(self, reset=False):
inner_pos = self.virtual_detector_roi_inner.pos()
inner_size = self.virtual_detector_roi_inner.size()
R_inner = inner_size[0] / 2.0
x0 = inner_pos[0] + R_inner
y0 = inner_pos[1] + R_inner
x0 = inner_pos[1] + R_inner
y0 = inner_pos[0] + R_inner

outer_size = self.virtual_detector_roi_outer.size()
R_outer = outer_size[0] / 2.0
Expand Down Expand Up @@ -113,10 +114,9 @@ def update_real_space_view(self, reset=False):
raise ValueError("Detector shape not recognized")

if mask is not None:
# For debugging masks:
# self.diffraction_space_widget.setImage(
# mask.T, autoLevels=True, autoRange=True
# )
if "MASK_DEBUG" in os.environ:
self.set_diffraction_image(mask.astype(np.float32), reset=reset)
return
mask = mask.astype(np.float32)
vimg = np.zeros((self.datacube.R_Nx, self.datacube.R_Ny))
iterator = py4DSTEM.tqdmnd(self.datacube.R_Nx, self.datacube.R_Ny, disable=True)
Expand Down

0 comments on commit 329ccf7

Please sign in to comment.