cosmodesi / pyrecon

package for BAO reconstruction
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Wrapping for periodic boundary conditions #10

Closed seshnadathur closed 2 years ago

seshnadathur commented 2 years ago

I have added a new argument wrap to be provided when initialising the reconstruction instance (addressing #4). If it is True, periodic boundary conditions are assumed with the mesh boxsize and particle positions are wrapped around to remain inside the box. Input data positions get wrapped too (and input randoms if provided, though when wrapping is being used data will generally come from a simulation with uniform selection function so randoms are not necessary).

This removes a possible point of failure where input data contain positions that lie exactly on a box edge. Wrapping is checked and maintained throughout the reconstruction process. I have changed the standalone pyrecon code to accept wrap as a mesh input from the config file and to consistently wrap the output reconstructed positions as well.

adematti commented 2 years ago

Hi Sesh, this looks good, thank you very much! I may do some minor edits.