rmjarvis / TreeCorr

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

Fix a bug when running with Rlens metric using patches #130

Closed rmjarvis closed 2 years ago

rmjarvis commented 2 years ago

@marina_ricci ran into a bug when using the Rlens metric with patches when one of the catalogs used distances and the other one didn't (i.e. just ra, dec, which is allowed for Rlens).

It turns out there was an error in some of the logic about how the metric is checked, so I fixed that.

But then when writing the unit test to confirm the fix, I also discovered another issue with this use case where it would erroneously think patch pairs had no overlap because the one with only ra, dec are placed on the unit sphere, and that was considered too far away from the objects in the other catalog to have any overlap. So I fixed that error too.

Anyway, I think this use case should now work correctly. But Marina, please do let me know if you run into any more problems, as this use case apparently has some subtleties that don't apply to most uses, so it's possible I've still overlooked something.