cosmicpy.survey – Galaxy survey representation

survey([nuisances]) Contains all the parameters corresponding to a survey.
redshift_bin(surv, **kwargs) Represents a redshift bin
nuisance(name, function, Nx, Ny, xlim, ylim) Generic nuisance representation of a 2D function
grid_nuisance(name, function, Nx, Ny, xlim, ylim) Generic nuisance parametrisation on a grid
class cosmicpy.survey.grid_nuisance(name, function, Nx, Ny, xlim, ylim)[source]

Bases: cosmicpy.survey.nuisance

Generic nuisance parametrisation on a grid

class cosmicpy.survey.nuisance(name, function, Nx, Ny, xlim, ylim)[source]

Bases: object

Generic nuisance representation of a 2D function

Np[source]

Number of nuisance parameters

__call__(x, y)[source]

Evaluates the function for the given set of nuisance parameters

update(**kwargs)[source]

Update the nuisance parameters

class cosmicpy.survey.redshift_bin(surv, **kwargs)[source]

Bases: object

Represents a redshift bin

kmax_lin[source]

Maximum linear scale at the median redshift in h^-1 Mpc

ngal[source]

Returns the number of galaxies in this photo-z bin in steradian

norm[source]

Normalisation of the distribution

nz_unorm(z)[source]

Computes the un-normalized n(z)

phi(cosmo, chi)[source]

Computes the normalised selection function for the bin at a given comoving distance.

Parameters:
  • cosmo (cosmology) – Cosmology object required to convert comoving distances.
  • chi (array_like) – Comoving distance.
Returns:

phi – Normalised selection function of the bin.

Return type:

ndarray, or float if input is scalar

Notes

The normalised survey selection function \(\phi\) verifies:

\[\int d^3 r \phi (r) = 1\]
subdivide(nbins, bintype='eq_dens')[source]

Divide this redshift bins into sub-bins nbins : Number of bins to generate bintype : ‘eq_dens’ or ‘eq_size’

zmean[source]

Mean of the distribution

zmed[source]

Median of the redshift distribution

class cosmicpy.survey.survey(nuisances=, []**kwargs)[source]

Bases: object

Contains all the parameters corresponding to a survey.

Parameters:
  • nzparams (dict, optional) – Dictionary containing the parameters of the desired redshift distribution.
  • nzbins (int, optional) – Number of redshift bins in the survey (def: 1).
  • bintype (str, optional) – Type of redshift binning. Either ‘eq_dens’ or ‘eq_size’ (def: ‘eq_dens’).
  • ngal (float, optional) – Number of galaxies per square arcmins (def: 40).
  • zmin (float, optional) – Minimum redshift considered in the survey (def: 0).
  • zmax (float, optional) – Maximum redshift considered in the survey (def: 5).
  • chicut (float, optional) – Level of the cut to apply to the selection function, relative to the maximum of the selection fuction. If 0, \(\chi_\max\) is set to \(\chi(z_\max)\) (def : 1e-5).
  • zphot_sig (float, optional) – Standard variation of photometric redshift errors (def: 0.05).
  • zphot_bias (float, optional) – Bias of photometric redshift errors (def: 0).
  • fsky (float, optional) – Sky fraction covered by the survey (def: 0.4848).
  • biastype (str, optional) – Type of galaxy bias. Either ‘constant’ or ‘sqrt’ (def: ‘sqrt’)

Notes

Several parametrisations for the redshifts can be specified:
  • ‘smail’ : n(z) = z^a exp( - (z/z0)^b)
  • ‘gaussian’ : n(z) = exp(-(r/r0)^2) * r ^2 * dr/dz
addNuisance(params)[source]

Adds nuisance parameters to the survey params is of the form {‘name’:’bias’, ‘type’:’grid’, ‘Nx’:3,’Ny’:4,’xlim’:[0.001,1],’ylim’:[0.001,0.1]}

bias(z, k)[source]

Galaxy bias b(z,k)

Parameters:z (array_like) – Redshift
Returns:b – Galaxy bias evaluated at the specified redshift
Return type:ndarray, or float if input is scalar

Notes

The galaxy bias follows the

chimax(cosmo)[source]

Computes the maximum comoving distance for the survey by corresponding to the point where the selection function reaches the cut level.

Parameters:
  • cosmo (cosmology) – Cosmology object required to convert comoving distances.
  • cut (float, optional) – Level of the cut to apply to the selection function, relative to the maximum of the selection fuction (def : 1e-5)
Returns:

chi – Maximum survey comoving distance

Return type:

float

norm[source]

Normalisation factor of the redshift distribution

nz(z)[source]

Computes the normalized n(z)

Parameters:z (array_like) – Redshift
Returns:n – Normalised redshift distribution evaluated at the specified redshift
Return type:ndarray, or float if input scalar

See also

nz_unorm()
Non normalised n(z)
nz_unorm(z)[source]

Computes the non normalized n(z)

Parameters:z (array_like) – Redshift
Returns:n – Non normalised redshift distribution evaluated at the specified redshift
Return type:ndarray, or float if input scalar
phi(cosmo, chi)[source]

Computes the normalised survey selection function at a given comoving distance.

Parameters:
  • cosmo (cosmology) – Cosmology object required to convert comoving distances.
  • chi (array_like) – Comoving distance.
Returns:

phi – Normalised selection function of the survey.

Return type:

ndarray, or float if input is scalar

Notes

The survey selection function \(\phi\) verifies:

\[\int d^3 r \phi (r) = V\]

where \(V\) is a characteristic volume of the survey chosen such that \(\phi \rightarrow 1\) as \(V \rightarrow \infty\).

Warning

This function returns the selection function scaled by the survey volume i.e. \(\frac{\phi}{V}\)

update(**kwargs)[source]

Updates the survey after parameters have been modified.

Parameters:
  • nzparams (dict, optional) – Dictionary containing the parameters of the desired redshift distribution.
  • nzbins (int, optional) – Number of redshift bins in the survey.
  • bintype (str, optional) – Type of redshift binning. Either ‘eq_dens’ or ‘eq_size’.
  • ngal (float, optional) – Number of galaxies per square arcmins.
  • zmin (float, optional) – Minimum redshift considered in the survey.
  • zmax (float, optional) – Maximum redshift considered in the survey.
  • chicut (float, optional) – Level of the cut to apply to the selection function, relative to the maximum of the selection fuction. If 0, \(\chi_\max\) is set to \(\chi(z_\max)\) (def : 1e-5).
  • zphot_sig (float, optional) – Standard variation of photometric redshift errors.
  • zphot_bias (float, optional) – Bias of photometric redshift errors.
  • fsky (float, optional) – Sky fraction covered by the survey.
  • biastype (str, optional) – Type of galaxy bias. Either ‘constant’ or ‘sqrt’.
zmean[source]

Mean of the redshift distribution.

zmed[source]

Median of the redshift distribution.

zmin[source]

Minimun Redshift