Skip to content
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

How to compensate for window function when using ArrayMesh on a numpy array? #655

Open
dpiras opened this issue Apr 13, 2021 · 0 comments
Open

Comments

@dpiras
Copy link

dpiras commented Apr 13, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant