-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFTPower mu-edges #663
Comments
Thanks for the reports. Yes I agree there seems to be a NaN problem. Do you have a simple notebook to reproduce this? For a fix, perhaps this line: 6ab5a06#diff-bf846022d2da880aa1441037073fa99e26bdde9b7b720c4cc2e15504a3d95aa4R571 shall used y3d.compressed instead of False. If compressed is True then there is no mu < 0 values, and we shall use the hermitian symmetric block. Setting it to False regardless of the input is compressed was incorrect. The 'symmetric' vs 'anti-symmetric' treatment you are probably referring to this? Round off errors(f8): That's reasonable. Could you file a Pull request? Offset of half of grid: Indeed that shift is weird. I agree with you that eliminating it makes sense. Did you check how much eliminating the shift affects the results? |
Sorry for the delay, The line you quote (6ab5a06#diff-bf846022d2da880aa1441037073fa99e26bdde9b7b720c4cc2e15504a3d95aa4R571) has been reverted back in ede93aa. The issue is shown by this code snippet:
For the 'symmetric' vs 'anti-symmetric' treatment, this is indeed linked to 6ab5a06. nbodykit/nbodykit/algorithms/convpower/fkp.py Line 635 in 4aec168
for odd poles X_ell(-k) = - X_ell(k)*. Actually, casting coordinates to double precision here: nbodykit/nbodykit/algorithms/fftpower.py Line 570 in 4aec168
solves only ~ half of the wrong bin assignments. I guess that should be done when computing these coordinates, within pmesh itself? About the shifts in ConvolvedFFTPower, it's a typical ~ 5% effect for the quadrupole, in the test case of https://github.com/bccp/nbodykit/blob/master/nbodykit/algorithms/tests/test_conv_power.py |
Hi, I just arrived to the same issue. I am not sure if just by editing this line would be enough |
- Related to this bccp#663
Hi,
I think there is an issue with current FFTPower implementation (0.3.16dev0);
muedges (now) range from -1 to 1 as set in:
nbodykit/nbodykit/algorithms/fftpower.py
Line 298 in 4aec168
In most cases one will paint positions and weights on a real mesh
nbodykit/nbodykit/base/catalog.py
Line 787 in 4aec168
Hence, hermitian symmetry is exploited to use only kz >= 0 modes.
When line-of-sight is z, mu obtained by
nbodykit/nbodykit/algorithms/fftpower.py
Line 620 in 4aec168
will always be > 0. Hence wedges at mu < 0 are empty (NaN power).
I guess one could either (by order of increased code changes):
a) drop Hermitian symmetry by defaulting to complex field as has been done for FKPCatalog, but this is overkill
b) revert to muedges in [0, 1], and take abs(mu) in case of Hermitian symmetry
c) keep muedges in [-1, 1], and create mu < 0 modes on-the-fly in project_to_basis.
Note: about odd poles in FKP estimator, instead of switching to full complex field, one can just use Hermitian antisymmetry in project_to_basis.
Note: in case single precision is used, some (k, mu) modes fall in the wrong bin. Casting slab coordinates to 'f8' around here:
nbodykit/nbodykit/algorithms/fftpower.py
Line 608 in 4aec168
resolves this problem and increases accuracy in the estimated power spectrum at low memory cost.
Another, quite unrelated question: I though that, within pmesh, a particles are "painted" on the mesh nodes,
i.e. not in cell centers. So I do not understand that extra half-cell shift (
0.5*pm.BoxSize / pm.Nmesh
) here:nbodykit/nbodykit/algorithms/convpower/fkp.py
Line 457 in 4aec168
Thanks!
The text was updated successfully, but these errors were encountered: