Skip to content
Snippets Groups Projects
Commit 72e945b9 authored by VAN CUYCK Mathilde's avatar VAN CUYCK Mathilde
Browse files

Update powspec.py, remplacer np.absolute par np.real l250 dans cross_spectral_density

parent d7d24e0b
No related branches found
No related tags found
1 merge request!2fix(cross) Cross power spectra now return the real part of the cross, not the absolute
Pipeline #5783 passed
......@@ -247,7 +247,7 @@ def cross_spectral_density(img1, img2, res=1, bins=100, range=None, apod_size=No
# https://en.wikipedia.org/wiki/Spectral_density
# Note that the factor 2 is accounted for the fact that we count each
# frequency twice...
pow_sqr = np.absolute(np.fft.fft2(img1) * np.conjugate(np.fft.fft2(img2)) * res ** 2 / (npix_x * npix_y))
pow_sqr = np.real(np.fft.fft2(img1) * np.conjugate(np.fft.fft2(img2)) * res ** 2 / (npix_x * npix_y))
# Define corresponding fourier modes
u_freq = np.fft.fftfreq(npix_x, d=res)
......
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