Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement per-axis periodicity and box size #276

Merged
merged 20 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
664ceb9
Implement non-cubic periodic box for theory.DD
lgarrison May 24, 2022
3442cd5
Use boxsize tuple when calling low-level python bindings
lgarrison May 24, 2022
b928d13
Changelog
lgarrison May 24, 2022
95f43a9
pep8
lgarrison May 24, 2022
4e5e9bc
Fix gridlink for non-cubic
lgarrison May 25, 2022
d983c24
Implement turning off periodicity per-dimension by specifying boxsize…
lgarrison May 31, 2022
8624910
Change binsize calculation to use particle extent, not periodic wrap
lgarrison Jun 3, 2022
1dc3392
Port per-dimension periodicity and boxsize to other modules
lgarrison Jun 21, 2022
4034c6c
Fix calling CPython modules
lgarrison Jun 21, 2022
ebca116
Extend simple boxsize tests to other modules
lgarrison Jun 21, 2022
036c98a
pep8
lgarrison Jun 21, 2022
8b367f2
Only apply minimum cell criterion in a dimension when the periodic wr…
lgarrison Jun 24, 2022
720f983
Assign particles to cell 0 when they are all in a plane
lgarrison Jun 24, 2022
17ee311
Add warning when all particles fall in a plane
lgarrison Jul 13, 2022
c3e260d
Add comments and parens. More explicit particle positions in narrow e…
lgarrison Jul 19, 2022
23453ae
WIP: enable larger Rmax (up to half the box size) (#277)
lgarrison Oct 7, 2022
99c302c
Fix missing docstring escapes
lgarrison Oct 31, 2022
d30e59a
Add tests for anisotropic boxes against brute-force. Allow more boxsi…
lgarrison Oct 31, 2022
68830b7
Fix Rmax>L/2 for non-periodic. Greatly expand brute-force tests. Fix …
lgarrison Nov 3, 2022
d425d3a
Merge branch 'master' into boxsize-per-dim
manodeep Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ New features
2.5.0 (upcoming)
================

Enhancements
------------
- Allow user to specify periodicity and box size per dimension [#276]
- Allow larger Rmax (up to half the boxsize) [#277]

Changes
-------
- Add Corrfunc/tests.py to CI testing [#260]
Expand Down
12 changes: 6 additions & 6 deletions Corrfunc/mocks/DDrppi_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def DDrppi_mocks(autocorr, cosmology, nthreads, pimax, binfile,
c_api_timer=False, isa=r'fastest', weight_type=None):
"""
Calculate the 2-D pair-counts corresponding to the projected correlation
function, :math:`\\xi(r_p, \pi)`. Pairs which are separated by less
function, :math:`\\xi(r_p, \\pi)`. Pairs which are separated by less
than the ``rp`` bins (specified in ``binfile``) in the
X-Y plane, and less than ``pimax`` in the Z-dimension are
counted. The input positions are expected to be on-sky co-ordinates.
Expand All @@ -41,10 +41,10 @@ def DDrppi_mocks(autocorr, cosmology, nthreads, pimax, binfile,


.. note:: that this module only returns pair counts and not the actual
correlation function :math:`\\xi(r_p, \pi)` or :math:`wp(r_p)`. See the
correlation function :math:`\\xi(r_p, \\pi)` or :math:`wp(r_p)`. See the
utilities :py:mod:`Corrfunc.utils.convert_3d_counts_to_cf` and
:py:mod:`Corrfunc.utils.convert_rp_pi_counts_to_wp` for computing
:math:`\\xi(r_p, \pi)` and :math:`wp(r_p)` respectively from the
:math:`\\xi(r_p, \\pi)` and :math:`wp(r_p)` respectively from the
pair counts.


Expand All @@ -63,8 +63,8 @@ def DDrppi_mocks(autocorr, cosmology, nthreads, pimax, binfile,
indicate that the co-moving distance conversion has already been done.

Choices:
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\Lambda=0.698`
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\\Lambda=0.698`

To setup a new cosmology, add an entry to the function,
``init_cosmology`` in ``ROOT/utils/cosmology_params.c`` and re-install
Expand Down Expand Up @@ -229,7 +229,7 @@ def DDrppi_mocks(autocorr, cosmology, nthreads, pimax, binfile,
If ``output_ravg`` is not set, then ``rpavg`` will be set to 0.0 for
all bins; similarly for ``weightavg``. ``npairs`` contains the number
of pairs in that bin and can be used to compute the actual
:math:`\\xi(r_p, \pi)` or :math:`wp(rp)` by combining with
:math:`\\xi(r_p, \\pi)` or :math:`wp(rp)` by combining with
(DR, RR) counts.

api_time : float, optional
Expand Down
16 changes: 8 additions & 8 deletions Corrfunc/mocks/DDsmu_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,
c_api_timer=False, isa='fastest', weight_type=None):
"""
Calculate the 2-D pair-counts corresponding to the projected correlation
function, :math:`\\xi(s, \mu)`. The pairs are counted in bins of
function, :math:`\\xi(s, \\mu)`. The pairs are counted in bins of
radial separation and cosine of angle to the line-of-sight (LOS). The
input positions are expected to be on-sky co-ordinates. This module is
suitable for calculating correlation functions for mock catalogs.
Expand All @@ -38,9 +38,9 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,


.. note:: This module only returns pair counts and not the actual
correlation function :math:`\\xi(s, \mu)`. See the
correlation function :math:`\\xi(s, \\mu)`. See the
utilities :py:mod:`Corrfunc.utils.convert_3d_counts_to_cf`
for computing :math:`\\xi(s, \mu)` from the pair counts.
for computing :math:`\\xi(s, \\mu)` from the pair counts.

.. versionadded:: 2.1.0

Expand All @@ -59,8 +59,8 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,
indicate that the co-moving distance conversion has already been done.

Choices:
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\Lambda=0.698`
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\\Lambda=0.698`

To setup a new cosmology, add an entry to the function,
``init_cosmology`` in ``ROOT/utils/cosmology_params.c`` and re-install
Expand All @@ -77,12 +77,12 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,
represent the vectors to each point constituting the pair, then
:math:`s := v_1 - v_2` and :math:`l := 1/2 (v_1 + v_2)`.

Note: Only pairs with :math:`0 <= \cos(\\theta_{LOS}) < \mu_{max}`
Note: Only pairs with :math:`0 <= \\cos(\\theta_{LOS}) < \\mu_{max}`
are counted (no equality).

nmu_bins: int
The number of linear ``mu`` bins, with the bins ranging from
from (0, :math:`\mu_{max}`)
from (0, :math:`\\mu_{max}`)

binfile: string or an list/array of floats
For string input: filename specifying the ``s`` bins for
Expand Down Expand Up @@ -231,7 +231,7 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,
being the upper limit of the ``mu`` bin. If ``output_savg`` is not
set, then ``savg`` will be set to 0.0 for all bins; similarly for
``weightavg``. ``npairs`` contains the number of pairs in that bin
and can be used to compute the actual :math:`\\xi(s, \mu)` by
and can be used to compute the actual :math:`\\xi(s, \\mu)` by
combining with (DR, RR) counts.

api_time: float, optional
Expand Down
8 changes: 4 additions & 4 deletions Corrfunc/mocks/DDtheta_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def DDtheta_mocks(autocorr, nthreads, binfile,


.. note:: This module only returns pair counts and not the actual
correlation function :math:`\\omega(\theta)`. See
correlation function :math:`\\omega(\\theta)`. See
:py:mod:`Corrfunc.utils.convert_3d_counts_to_cf` for computing
:math:`\\omega(\theta)` from the pair counts returned.
:math:`\\omega(\\theta)` from the pair counts returned.


Parameters
Expand Down Expand Up @@ -122,7 +122,7 @@ def DDtheta_mocks(autocorr, nthreads, binfile,
Boolean flag to control output of informational messages

output_thetaavg : boolean (default false)
Boolean flag to output the average ``\theta`` for each bin. Code will
Boolean flag to output the average ``\\theta`` for each bin. Code will
run slower if you set this flag.

If you are calculating in single-precision, ``thetaavg`` will
Expand Down Expand Up @@ -415,7 +415,7 @@ def find_fastest_DDtheta_mocks_bin_refs(autocorr, nthreads, binfile,
Boolean flag to control output of informational messages

output_thetaavg : boolean (default false)
Boolean flag to output the average ``\theta`` for each bin. Code will
Boolean flag to output the average ``\\theta`` for each bin. Code will
run slower if you set this flag.

If you are calculating in single-precision, ``thetaavg`` will
Expand Down
4 changes: 2 additions & 2 deletions Corrfunc/mocks/vpf_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def vpf_mocks(rmax, nbins, nspheres, numpN,
indicate that the co-moving distance conversion has already been done.

Choices:
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\Lambda=0.698`
1. LasDamas cosmology. :math:`\\Omega_m=0.25`, :math:`\\Omega_\\Lambda=0.75`
2. Planck cosmology. :math:`\\Omega_m=0.302`, :math:`\\Omega_\\Lambda=0.698`

To setup a new cosmology, add an entry to the function,
``init_cosmology`` in ``ROOT/utils/cosmology_params.c`` and re-install
Expand Down
Loading