rmjarvis / TreeCorr

Code for efficiently computing 2-point and 3-point correlation functions. For documentation, go to
http://rmjarvis.github.io/TreeCorr/
Other
98 stars 37 forks source link

Problem with NN_correlation when setting low_mem=True #144

Closed chto closed 2 years ago

chto commented 2 years ago

Hi,

I find that the result of NN_correlation when setting low_mem=True depends on whether the catalog is saved in the unit of radian or degrees. Specifically, I find that when saving the catalog in the unit of radian, the npairs of NN_correlation result does not depend on whether low_mem is set to True or False. download (20)

But, if the catalog is saved in the unit of degree, NN_correlation result depends on low_mem. download (21)

Here is a simple colab example to demonstrate this, https://colab.research.google.com/drive/1CnFyKpjQVK7Vw64r5u-sj6c3rRIQVAcH?usp=sharing The treecorr version used is 4.2.8.

Upon further investigation, I believe the problem is at this line, https://github.com/rmjarvis/TreeCorr/blob/234b90ed4b02350e4e0064d890f2a8b3cbd2edf5/treecorr/catalog.py#L2012 I think it assumes that all the saved patch files are in the unit of radian.

download (21)

rmjarvis commented 2 years ago

Thanks Chun-Hao. I've fixed this in #145. Thanks so much for reporting the error!