Skip to content

Commit

Permalink
Flexible cross-correlation alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
HanHsuanWu committed Oct 31, 2023
1 parent 300e9c2 commit 5f42c3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions exspy/signals/eels.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ def align_zero_loss_peak(
also_align=[],
print_stats=True,
subpixel=True,
left=-3.0,
right=3.0,
mask=None,
signal_range=None,
show_progressbar=None,
Expand All @@ -335,7 +337,8 @@ def align_zero_loss_peak(
"""Align the zero-loss peak.
This function first aligns the spectra using the result of
`estimate_zero_loss_peak_centre` and afterward, if subpixel is True,
`estimate_zero_loss_peak_centre` which finds the maximum in the
given energy range, then if subpixel is True,
proceeds to align with subpixel accuracy using `align1D`. The offset
is automatically correct if `calibrate` is True.
Expand All @@ -355,6 +358,12 @@ def align_zero_loss_peak(
subpixel : bool
If True, perform the alignment with subpixel accuracy
using cross-correlation.
left : float
When subpixel is True, left is the start of energy range used
in cross-correlation in whichever unit the energy axis is in.
right : float
When subpixel is True, right is the end of energy range used
in cross-correlation in whichever unit the energy axis is in.
mask : Signal1D of bool data type or bool array.
It must have signal_dimension = 0 and navigation_shape equal to
the shape of the current signal. Where mask is True the shift is
Expand Down Expand Up @@ -450,7 +459,7 @@ def estimate_zero_loss_peak_centre(s, mask, signal_range):

if subpixel is False:
return
left, right = -3.0, 3.0
left, right = left, right
if calibrate is False:
left += mean_
right += mean_
Expand Down

0 comments on commit 5f42c3e

Please sign in to comment.