Functions
gaussian_complex_fields (pm, linear_power, seed) |
Make a Gaussian realization of a overdensity field, \(\delta(x)\). |
gaussian_real_fields (pm, linear_power, seed) |
Make a Gaussian realization of a overdensity field in real-space \(\delta(x)\). |
lognormal_transform (density[, bias]) |
Apply a (biased) lognormal transformation of the density |
poisson_sample_to_points (delta, …[, bias, …]) |
Poisson sample the linear delta and displacement fields to points. |
nbodykit.mockmaker.
gaussian_complex_fields
(pm, linear_power, seed, unitary_amplitude=False, inverted_phase=False, compute_displacement=False)[source]¶Make a Gaussian realization of a overdensity field, \(\delta(x)\).
If specified, also compute the corresponding 1st order Lagrangian displacement field (Zel’dovich approximation) \(\psi(x)\), which is related to the linear velocity field via:
Notes
This computes the overdensity field using the following steps:
After step 2, the complex field has unity variance. This is equivalent to generating real-space normal variates with mean and unity variance, calling r2c() and dividing by \(N^3\) since the variance of the complex FFT (with no additional normalization) is \(N^3 \times \sigma^2_\mathrm{real}\).
Furthermore, the power spectrum is defined as V * variance. So a normalization factor of 1 / V shows up in step 2, cancels this factor such that the power spectrum is P(k).
The linear displacement field is computed as:
Note
To recover the linear velocity in proper units, i.e., km/s, from the linear displacement, an additional factor of \(f \times a \times H(a)\) is required
Parameters: |
|
---|---|
Returns: |
|
nbodykit.mockmaker.
gaussian_real_fields
(pm, linear_power, seed, unitary_amplitude=False, inverted_phase=False, compute_displacement=False)[source]¶Make a Gaussian realization of a overdensity field in real-space \(\delta(x)\).
If specified, also compute the corresponding linear Zel’dovich displacement field \(\psi(x)\), which is related to the linear velocity field via:
Notes
See the docstring for gaussian_complex_fields()
for the
steps involved in generating the fields.
Parameters: |
|
---|---|
Returns: |
|
nbodykit.mockmaker.
lognormal_transform
(density, bias=1.0)[source]¶Apply a (biased) lognormal transformation of the density field by computing:
where \(\delta\) is the initial overdensity field and the normalization \(N\) is chosen such that \(\langle F(\delta) \rangle = 1\)
Parameters: |
|
---|---|
Returns: | toret – the real field holding the transformed density field |
Return type: | RealField |
nbodykit.mockmaker.
poisson_sample_to_points
(delta, displacement, pm, nbar, bias=1.0, seed=None, comm=None)[source]¶Poisson sample the linear delta and displacement fields to points.
The steps in this function:
delta
fieldParameters: |
|
---|---|
Returns: |
|