Skip to content
Snippets Groups Projects
Commit a2f9001e authored by Egor Sobolev's avatar Egor Sobolev Committed by spbonc
Browse files

Use fftconvolve

parent f3828578
No related branches found
No related tags found
1 merge request!70Autocorrelation addon
......@@ -44,14 +44,14 @@ class Autocorrelation(BaseCorrectionAddon):
def post_correction(self, processed_data, cell_table, pulse_table, output_hash):
"""Called directly after correction has happened. Processed data will still be
on GPU if the correction device is generally running in GPU mode."""
from cupyx.scipy.signal import fftconvolve
data = processed_data.copy()
data[np.isnan(data)] = 0.0
# zero pad ???
g = np.fft.fft2(data)
autocorr_sum = np.fft.ifft2((g * g.conj()).sum(axis=0)).real
autocorr_sum = fftconvolve(
data, data[:, ::-1, ::-1], 'same', axes=(-2, -1)
).sum(axis=0)
frames_sum = data.sum(axis=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment