API¶
Top level user functions to compute power spectra:
GalaxySpectrum ([fog_model, use_so_correction]) |
The model for the galaxy redshift space power spectrum |
GalaxySpectrum.initialize () |
Initialize the underlying splines, etc of the model |
GalaxySpectrum.power (k, mu[, flatten]) |
The total redshift-space galaxy power spectrum at k and mu |
GalaxySpectrum.poles (k, ells[, Nmu]) |
The multipole moments of the redshift-space power spectrum |
GalaxySpectrum.from_transfer |
Loading GalaxySpectrum objects from and saving to pickle files:
GalaxySpectrum.to_npy (filename) |
Save to a .npy file by calling numpy.save() |
GalaxySpectrum.from_npy (filename) |
Load a model from a .npy file |
Generating the default set of parameters for fitting the
GalaxySpectrum
to data:
GalaxySpectrum.default_params () |
A GalaxyPowerParameters object holding the default model parameters |
Evaluating power spectra with an additional transfer function, i.e., on
a discrete (k
, mu
) grid or convolved with a window:
PkmuGrid |
|
PkmuTransfer |
|
PolesTransfer |
|
pyRSD.rsd.window.WindowTransfer |
The GalaxySpectrum Class¶
-
class
pyRSD.rsd.
GalaxySpectrum
(fog_model='modified_lorentzian', use_so_correction=False, **kwargs)¶ The model for the galaxy redshift space power spectrum
Parameters: kmin : float, optional
The minimum wavenumber to compute the power spectrum at [units: \(h/\mathrm{Mpc}\)]; default is 1e-3
kmax : float, optional
The maximum wavenumber to compute the power spectrum at [units: \(h/\mathrm{Mpc}\)]; default is 0.5
Nk : int, optional
The number of log-spaced bins to use as the underlying domain for splines; default is 200
z : float, optional
The redshift to compute the power spectrum at. Default = 0.
params :
Cosmology
, strEither a
Cosmology
instance or the name of a file to load parameters from; see the ‘data/params’ directory for examplesinclude_2loop : bool, optional
If True, include 2-loop contributions in the model terms. Default is False.
transfer_fit : str, optional
The name of the transfer function fit to use. Default is CLASS and the options are {CLASS, EH, EH_NoWiggle, BBKS}, or the name of a data file holding (k, T(k))
max_mu : {0, 2, 4, 6, 8}, optional
Only compute angular terms up to mu**(
max_mu
). Default is 4.interpolate: bool, optional
Whether to return interpolated results for underlying power moments
k0_low : float, optional (5e-3)
below this wavenumber, evaluate any power in “low-k mode”, which essentially just uses SPT at low-k
linear_power_file : str, optional (None)
string specifying the name of a file which gives the linear power spectrum, from which the transfer function in
cosmo
will be initializedPdv_model_type : {‘jennings’, ‘sim’, None}, optional
The type of model to use to evaluate Pdv
fog_model : str, optional
the string specifying the FOG model to use; one of [‘modified_lorentzian’, ‘lorentzian’, ‘gaussian’]. Default is ‘modified_lorentzian’
use_so_correction : bool, optional
Boost the centrals auto spectrum with a correction accounting for extra structure around centrals due to SO halo finders; default is False
-
power
(k, mu, flatten=False)¶ The total redshift-space galaxy power spectrum at
k
andmu
Parameters: k : float, array_like
The wavenumbers to evaluate the power spectrum at, in h/Mpc
mu : float, array_like
The cosine of the angle from the line of sight. If a float is provided, the value is used for all input k values. If array-like and mu has the same shape as k, the power at each (k,mu) pair is returned. If mu has a shape different than k, the returned power has shape
(len(k), len(mu))
.flatten : bool, optional
If True, flatten the return array, which will have a length of len(k) * len(mu)
-
default_params
()¶ A GalaxyPowerParameters object holding the default model parameters
The model associated with the parameter is
self
-
poles
(k, ells, Nmu=40)¶ The multipole moments of the redshift-space power spectrum
Parameters: k : float, array_like
The wavenumbers to evaluate the power spectrum at, in h/Mpc
ells : int, array_like
The ell values of the multipole moments
Nmu : int, optional
the number of
mu
bins to use when performing the multipole integrationReturns: poles : array_like
returns tuples of arrays for each ell value in
poles
-