diff --git a/abacusnbody/analysis/power_spectrum.py b/abacusnbody/analysis/power_spectrum.py index c8ed608..918162c 100644 --- a/abacusnbody/analysis/power_spectrum.py +++ b/abacusnbody/analysis/power_spectrum.py @@ -16,11 +16,11 @@ from .cic import cic_serial -__all__ = ['pk_to_xi', - 'calc_power', +__all__ = ['calc_power', + 'calc_pk_from_deltak', + 'pk_to_xi', 'project_3d_to_poles', 'get_k_mu_edges', - 'calc_pk_from_deltak', ] MAX_THREADS = numba.config.NUMBA_NUM_THREADS @@ -1093,8 +1093,8 @@ def calc_power(pos, Returns ------- power : astropy.Table - The power spectrum in an astropy Table of length ``nbins_k``. - The columns are: + The power spectrum in an astropy Table of length ``nbins_k``. The columns are: + - ``k_mid``: arithmetic bin centers of the k wavenumbers, shape ``(nbins_k,)`` - ``k_avg``: mean wavenumber per (k, mu) wedge, shape ``(nbins_k,nbins_mu)`` - ``mu_mid``: arithmetic bin centers of the mu angles, shape ``(nbins_k,nbins_mu)`` @@ -1102,6 +1102,7 @@ def calc_power(pos, - ``N_mode``: number of modes per (k, mu) wedge, shape ``(nbins_k,nbins_mu)`` If multipoles are requested via ``poles``, the table includes: + - ``poles``: mean Legendre multipole coefficients, shape ``(nbins_k,len(poles))`` - ``N_mode_poles``: number of modes per pole, shape ``(nbins_k,len(poles))`` diff --git a/abacusnbody/analysis/tpcf_corrfunc.py b/abacusnbody/analysis/tpcf_corrfunc.py index 19bf26a..9a88719 100644 --- a/abacusnbody/analysis/tpcf_corrfunc.py +++ b/abacusnbody/analysis/tpcf_corrfunc.py @@ -38,24 +38,32 @@ def tpcf_multipole(s_mu_tcpf_result, mu_bins, order=0): Examples -------- For demonstration purposes we create a randomly distributed set of points within a - periodic cube of length 250 Mpc/h. - >>> Npts = 100 - >>> Lbox = 250. - >>> x = np.random.uniform(0, Lbox, Npts) - >>> y = np.random.uniform(0, Lbox, Npts) - >>> z = np.random.uniform(0, Lbox, Npts) + periodic cube of length 250 Mpc/h.:: + + >>> Npts = 100 + >>> Lbox = 250. + >>> x = np.random.uniform(0, Lbox, Npts) + >>> y = np.random.uniform(0, Lbox, Npts) + >>> z = np.random.uniform(0, Lbox, Npts) + We transform our *x, y, z* points into the array shape used by the pair-counter by taking the transpose of the result of `numpy.vstack`. This boilerplate transformation - is used throughout the `~halotools.mock_observables` sub-package: - >>> sample1 = np.vstack((x,y,z)).T + is used throughout the `~halotools.mock_observables` sub-package: :: + + >>> sample1 = np.vstack((x,y,z)).T + First, we calculate the correlation function using - `~halotools.mock_observables.s_mu_tpcf`. - >>> from halotools.mock_observables import s_mu_tpcf - >>> s_bins = np.linspace(0.01, 25, 10) - >>> mu_bins = np.linspace(0, 1, 15) - >>> xi_s_mu = s_mu_tpcf(sample1, s_bins, mu_bins, period=Lbox) - Then, we can calculate the quadrapole of the correlation function: - >>> xi_2 = tpcf_multipole(xi_s_mu, mu_bins, order=2) + `~halotools.mock_observables.s_mu_tpcf`.:: + + >>> from halotools.mock_observables import s_mu_tpcf + >>> s_bins = np.linspace(0.01, 25, 10) + >>> mu_bins = np.linspace(0, 1, 15) + >>> xi_s_mu = s_mu_tpcf(sample1, s_bins, mu_bins, period=Lbox) + + Then, we can calculate the quadrapole of the correlation function: :: + + >>> xi_2 = tpcf_multipole(xi_s_mu, mu_bins, order=2) + """ # process inputs