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

Computing "scaled counts-in-spheres" #148

Closed felipeavila331 closed 1 year ago

felipeavila331 commented 1 year ago

I have been using the TreeCorr code for a few years. At the moment I need to do a count in spheres for a radius r, for both the galaxy catalog and the random ones, and get the ratio between the two, N_cat(r) / N_rand(r). Is this possible with TreeCorr?

This ratio, in general, can be obtained from the volumetric integral of the correlation function. However, this integral seems to be very sensitive to binning and minimum separation in the correlation function. So I would like to calculate this ratio directly from the data.

rmjarvis commented 1 year ago

Is this what you want? https://rmjarvis.github.io/TreeCorr/_build/html/field.html#treecorr.Field.get_near

rmjarvis commented 1 year ago

Also, https://rmjarvis.github.io/TreeCorr/_build/html/field.html#treecorr.Field.count_near, which just counts points.

felipeavila331 commented 1 year ago

Yes, I think that solves my problem, thank you.

rmjarvis commented 1 year ago

OK. Closing this issue, but please feel free to reopen if that turns out not quite to do what you need or if you have problems using them.