Skip to content

Commit

Permalink
enforcing masks to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed Sep 20, 2024
1 parent 50d0cee commit c89b16d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

if gaussian_filter_sigma_m is None:
gaussian_filter_sigma_m = gaussian_filter_sigma_e
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/magnetic_ptychography.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

if gaussian_filter_sigma_m is None:
gaussian_filter_sigma_m = gaussian_filter_sigma_e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

# main loop
for a0 in tqdmnd(
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/mixedstate_ptychography.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

# main loop
for a0 in tqdmnd(
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/multislice_ptychography.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

# main loop
for a0 in tqdmnd(
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/ptychographic_tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

# main loop
for a0 in tqdmnd(
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/singleslice_ptychography.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp._bool)

# main loop
for a0 in tqdmnd(
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/xray_magnetic_ptychography.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ def reconstruct(
detector_fourier_mask = xp.asarray(detector_fourier_mask)

if virtual_detector_masks is not None:
virtual_detector_masks = xp.asarray(virtual_detector_masks)
virtual_detector_masks = xp.asarray(virtual_detector_masks).astype(xp.bool_)

if gaussian_filter_sigma_m is None:
gaussian_filter_sigma_m = gaussian_filter_sigma_e
Expand Down

0 comments on commit c89b16d

Please sign in to comment.