Observations¶
The following functions provide functionality for simulating observational effects of surveys.
Redshift distribution¶
- glass.gaussian_nz(z, mean, sigma, *, norm=None)[source]¶
Gaussian redshift distribution.
The redshift follows a Gaussian distribution with the given mean and standard deviation.
If
meanorsigmaare array_like, their axes will be the leading axes of the redshift distribution.- Parameters:
z (FloatArray) – Redshift values of the distribution.
mean (float | FloatArray) – Mean(s) of the redshift distribution.
sigma (float | FloatArray) – Standard deviation(s) of the redshift distribution.
norm (float | FloatArray | None) – If given, the normalisation of the distribution.
- Returns:
The redshift distribution at the given
zvalues.- Return type:
FloatArray
- glass.smail_nz(z, z_mode, alpha, beta, *, norm=None)[source]¶
Redshift distribution following Smail et al. (1994).
The redshift follows the Smail et al. [Smail94] redshift distribution.
- Parameters:
z (FloatArray) – Redshift values of the distribution.
z_mode (float | FloatArray) – Mode of the redshift distribution, must be positive.
alpha (float | FloatArray) – Power law exponent (z/z0)^alpha, must be positive.
beta (float | FloatArray) – Log-power law exponent exp[-(z/z0)^beta], must be positive.
norm (float | FloatArray | None) – If given, the normalisation of the distribution.
- Returns:
The redshift distribution at the given
zvalues.- Return type:
FloatArray
Notes
The probability distribution function \(p(z)\) for redshift \(z\) is given by Amara & Refregier [Amara07] as
\[p(z) \sim \left(\frac{z}{z_0}\right)^\alpha \exp\left[-\left(\frac{z}{z_0}\right)^\beta\right] \;,\]where \(z_0\) is matched to the given mode of the distribution.
- glass.fixed_zbins(zmin, zmax, *, nbins=None, dz=None, xp=None)[source]¶
Tomographic redshift bins of fixed size.
This function creates contiguous tomographic redshift bins of fixed size. It takes either the number or size of the bins.
- Parameters:
zmin (
float) – Extent of the redshift binning.zmax (
float) – Extent of the redshift binning.nbins (
Optional[int]) – Number of redshift bins. Only one ofnbinsanddzcan be given.dz (
Optional[float]) – Size of redshift bin. Only one ofnbinsanddzcan be given.xp (
Optional[ModuleType]) – The array library backend to use for array operations.
- Returns:
A list of redshift bin edges.
- Raises:
ValueError – If both
nbinsanddzare given.- Return type:
- glass.equal_dens_zbins(z, nz, nbins)[source]¶
Equal density tomographic redshift bins.
This function subdivides a source redshift distribution into
nbinstomographic redshift bins with equal density.- Parameters:
- Returns:
A list of redshift bin edges.
- Return type:
- glass.tomo_nz_gausserr(z, nz, sigma_0, zbins)[source]¶
Tomographic redshift bins with a Gaussian redshift error.
This function takes a _true_ overall source redshift distribution
z,nzand returns tomographic source redshift distributions for the tomographic redshift bins given byzbins. It is assumed that sources are assigned a tomographic redshift bin with a Gaussian error [Amara07]. The standard deviation of the Gaussian depends on redshift and is given bysigma(z) = sigma_0*(1 + z).- Parameters:
z (
Union[ndarray[tuple[Any,...],dtype[float64]],Array,Array]) – The true source redshift distribution. Must be one-dimensional.nz (
Union[ndarray[tuple[Any,...],dtype[float64]],Array,Array]) – The true source redshift distribution. Must be one-dimensional.sigma_0 (
float) – Redshift error in the tomographic binning at zero redshift.zbins (
list[tuple[float,float]]) – List of redshift bin edges.
- Returns:
The tomographic redshift bins convolved with a gaussian error. Array has a shape (nbins, z.shape[0])
- Return type:
Union[ndarray[tuple[Any,...],dtype[float64]],Array,Array]
See also
equal_dens_zbinsproduce equal density redshift bins
fixed_zbinsproduce redshift bins of fixed size
Visibility¶
- glass.vmap_galactic_ecliptic(nside, galactic=(30, 90), ecliptic=(20, 80), *, xp=None)[source]¶
Visibility map masking galactic and ecliptic plane.
This function returns a visibility map that blocks out stripes for the galactic and ecliptic planes. The location of the stripes is set with optional parameters.
- Parameters:
nside (
int) – The NSIDE parameter of the resulting HEALPix map.galactic (
tuple[float,float]) – The location of the galactic plane in the respective coordinate system.ecliptic (
tuple[float,float]) – The location of the ecliptic plane in the respective coordinate system.xp (
Optional[ModuleType]) – The array library backend to use for array operations.
- Returns:
A HEALPix visibility map.
- Raises:
- Return type:
Union[ndarray[tuple[Any,...],dtype[float64]],Array,Array]