Random points (glass.points)#
The glass.points module provides functionality for simulating point
processes on the sphere and sampling random positions.
Sampling#
- glass.points.positions_from_delta(ngal, delta, bias=None, vis=None, *, bias_model='linear', remove_monopole=False, rng=None)#
Generate positions tracing a density contrast.
The map of expected number counts is constructed from the number density, density contrast, an optional bias model, and an optional visibility map.
If
remove_monopoleis set, the monopole of the computed density contrast is removed. Over the full sky, the mean number density of the map will then match the given number density exactly. This, however, means that an effectively different bias model is being used, unless the monopole is already zero in the first place.- Parameters:
- ngalfloat
Number density, expected number of points per arcmin2.
- deltaarray_like
Map of the input density contrast. This is fed into the bias model to produce the density contrast for sampling.
- biasfloat, optional
Bias parameter, is passed as an argument to the bias model.
- visarray_like, optional
Visibility map for the observed points. This is multiplied with the full sky number count map, and must hence be of compatible shape.
- bias_modelstr or callable, optional
The bias model to apply. If a string, refers to a function in the points module, e.g.
'linear'forglass.points.linear_biasor'loglinear'forglass.points.loglinear_bias.- remove_monopolebool, optional
If true, the monopole of the density contrast after biasing is fixed to zero.
- rng
Generator, optional Random number generator. If not given, a default RNG will be used.
- Returns:
- lon, latarray_like
Columns of longitudes and latitudes for the sampled points.
- glass.points.uniform_positions(ngal, *, rng=None)#
Generate positions uniformly over the sphere.
- Parameters:
- ngalfloat
Number density, expected number of positions per arcmin2.
- rng
Generator, optional Random number generator. If not given, a default RNG will be used.
- Returns:
- lon, latarray_like
Columns of longitudes and latitudes for the sampled points.
Bias#
- glass.points.effective_bias(z, bz, w)#
Effective bias parameter from a redshift-dependent bias function.
This function takes a redshift-dependent bias function \(b(z)\) and computes an effective bias parameter \(\bar{b}\) for a given window function \(w(z)\).
- Parameters:
- z, bzarray_like
Redshifts and values of the bias function \(b(z)\).
- w
RadialWindow The radial window function \(w(z)\).
- Returns:
- beffarray_like
Effective bias parameter for the window.
Notes
The effective bias parameter \(\bar{b}\) is computed using the window function \(w(z)\) as the weighted average
\[\bar{b} = \frac{\int b(z) \, w(z) \, dz}{\int w(z) \, dz} \;.\]
Bias models#
- glass.points.linear_bias(delta, b)#
linear bias model \(\delta_g = b \, \delta\)
- glass.points.loglinear_bias(delta, b)#
log-linear bias model \(\ln(1 + \delta_g) = b \ln(1 + \delta)\)