manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
166 stars 51 forks source link

Improve the gridding for DDrppi_mocks #98

Open manodeep opened 7 years ago

manodeep commented 7 years ago

Currently DDrppi_mocks converts all the positions into Cartesian co-ordinates and then grids with an rmax = sqrt( rpmax^2 + pimax^2). This increases the volume for each cell significantly and consequently, the runtime.

Previous implementations had spherical gridding in dcomoving, dec, ra (in that order, the last two enabled by the options link_in_dec and link_in_ra). However, such a gridding could easily fail for arbitrary values of (rpmax, pimax). That's why the gridding was switched to the Cartesian style.

A best of both worlds approach can be used; where, for typical values of (rpmax, pimax) the spherical gridding is used; and the Cartesian gridding is used for all other cases.

In practice, this means that the new implementation should try to spherically grid the data and fallback to Cartesian gridding on failure.