Commit a710f8bd authored by VAN CUYCK Mathilde's avatar VAN CUYCK Mathilde
Browse files

Update powspec.py

Correct cross_power_density : remove np.absolute
parent d7d24e0b
Pipeline #4808 passed with stage
in 2 minutes and 5 seconds
......@@ -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.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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment