Commit 84e6428f authored by Alexandre Beelen's avatar Alexandre Beelen
Browse files

Merge branch 'mvancuyck-master-patch-70815' into 'master'

fix(cross) Cross power spectra now return the real part of the cross, not the absolute

See merge request !2
parents d7d24e0b 72e945b9
Pipeline #5785 passed with stage
in 1 minute and 26 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.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)
......
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