Skip to content

Commit

Permalink
versions to 0.14.9
Browse files Browse the repository at this point in the history
  • Loading branch information
bsavitzky committed Nov 8, 2023
1 parent 7d1fb84 commit ea1e7ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions py4DSTEM/preprocess/electroncount.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Electron counting
#
# Includes functions for electron counting on either the CPU (electron_count) or the GPU
# (electron_count_GPU). For GPU electron counting, pytorch is used to interface between
# numpy and the GPU, and the datacube is expected in numpy.memmap (memory mapped) form.
# Includes functions for electron counting on either the CPU (electron_count)
# or the GPU (electron_count_GPU). For GPU electron counting, pytorch is used
# to interface between numpy and the GPU, and the datacube is expected in
# numpy.memmap (memory mapped) form.

import numpy as np
from scipy import optimize
Expand All @@ -25,17 +26,17 @@ def electron_count(
Performs electron counting.
The algorithm is as follows:
From a random sampling of frames, calculate an x-ray and background threshold value.
In each frame, subtract the dark reference, then apply the two thresholds. Find all
local maxima with respect to the nearest neighbor pixels. These are considered
electron strike events.
Thresholds are specified in units of standard deviations, either of a gaussian fit to
the histogram background noise (for thresh_bkgrnd) or of the histogram itself (for
thresh_xray). The background (lower) threshold is more important; we will always be
missing some real electron counts and incorrectly counting some noise as electron
strikes - this threshold controls their relative balance. The x-ray threshold may be
set fairly high.
From a random sampling of frames, calculate an x-ray and background
threshold value. In each frame, subtract the dark reference, then apply the
two thresholds. Find all local maxima with respect to the nearest neighbor
pixels. These are considered electron strike events.
Thresholds are specified in units of standard deviations, either of a
gaussian fit to the histogram background noise (for thresh_bkgrnd) or of
the histogram itself (for thresh_xray). The background (lower) threshold is
more important; we will always be missing some real electron counts and
incorrectly counting some noise as electron strikes - this threshold
controls their relative balance. The x-ray threshold may be set fairly high.
Args:
datacube: a 4D numpy.ndarray pointing to the datacube. Note: the R/Q axes are
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.14.8"
__version__ = "0.14.9"

0 comments on commit ea1e7ed

Please sign in to comment.