How to compensate for window function when using ArrayMesh on a `numpy` array?
dpiras opened this issue · 3 comments
Hey, thank you for these amazing tools! I have the following question:
Describe the bug
I have a numpy
array that represents a density field already smoothed with either a CIC or a TSC window. I want to calculate its power spectrum, and while doing it, I'd like to compensate for the window function. How can I do it? Is it already implemented?
Steps To Reproduce
# load the file
smoothed_numpy_array = np.load('/path/to/my/file')
# create a mesh, as indicated in the documentation
field_mesh = ArrayMesh(smoothed_numpy_array , BoxSize=1000)
# calculate its PS; at this point, I'd like to tell FFTPower to correct for the window function
ps = FFTPower(field_mesh, mode='1d', kmin=1e-5, kmax=10)
Actual behaviour
When I do the above, I have reasons to believe that the power spectrum I calculate is not compensated, as power on small scales is much smaller than expected from just the limited resolution given by the mesh.
Expected behaviour
I'd like to know how to compensate for the window function, or whether this is already done. In general, if going from a Catalog to a Mesh this can be done easily using nbodykit
, but is it the same when loading data from a numpy
array?
Version
nbodykit == 0.3.15
Happy to provide additional information if needed. Thank you very much!
Hello @dpiras!
Did you solve this issue? I'm getting the same problem...
@Bruno-Bizarria unfortunately no, I just gave up :/