Skip to content

Commit

Permalink
Alignment: added initial support for finer configuration of the cross…
Browse files Browse the repository at this point in the history
…-correlation functions

Signed-off-by: Nicola VIGANO <[email protected]>
  • Loading branch information
Obi-Wan committed Sep 16, 2024
1 parent 61e7713 commit 1c12d5d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/corrct/alignment/shifts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
and ESRF - The European Synchrotron, Grenoble, France
"""

from typing import Dict, Optional, Tuple, Union
from collections.abc import Mapping
from typing import Optional, Union

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -490,7 +491,13 @@ def fit_u_360(self) -> float:

return float(cor)

def find_shifts_vu(self, data_dvwu: NDArrayFloat, proj_dvwu: NDArrayFloat, use_derivative: bool = False) -> NDArrayFloat:
def find_shifts_vu(
self,
data_dvwu: NDArrayFloat,
proj_dvwu: NDArrayFloat,
use_derivative: bool = False,
xc_opts: Mapping = dict(normalize_fourier=False),
) -> NDArrayFloat:
"""Find shifts between two images or sets of lines.
Parameters
Expand Down Expand Up @@ -522,7 +529,7 @@ def find_shifts_vu(self, data_dvwu: NDArrayFloat, proj_dvwu: NDArrayFloat, use_d
proj_vwu = np.diff(proj_vwu, axis=-1)

# Allow to choose different shift finding functions
shifts_vu = fitting.fit_shifts_vu_xc(data_vwu, proj_vwu, decimals=self.decimals)
shifts_vu = fitting.fit_shifts_vu_xc(data_vwu, proj_vwu, decimals=self.decimals, **xc_opts)
# shifts_vu = fitting.fit_shifts_u_sad(data_vwu, proj_vwu, decimals=self.decimals)

shifts_vu_all[ii_d] = _filter_shifts(shifts_vu, self.max_shifts)
Expand Down

0 comments on commit 1c12d5d

Please sign in to comment.