Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CONCERTO
powspec
Commits
a710f8bd
Commit
a710f8bd
authored
Apr 07, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
powspec/powspec.py
View file @
a710f8bd
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment