ComputeGalSpectro#
- class cosmicjellyfish.LSSsurvey.spectro_obs.ComputeGalSpectro(cosmopars, fiducial_cosmopars=None, spectrobiaspars=None, IMbiaspars=None, spectrononlinearpars=None, PShotpars=None, fiducial_cosmo=None, bias_samples=None, use_bias_funcs=False, configuration=None)[source]#
Bases:
object- qparallel(z)[source]#
Function implementing q parallel of the Alcock-Paczynski effect
- Parameters:
z (
numpy.ndarray) – list of redshifts for which the q parallel should be computed- Returns:
redshift dependant value of q parallel
- Return type:
- qperpendicular(z)[source]#
Function implementing q perpendicular of the Alcock-Paczynski effect
- Parameters:
z (
numpy.ndarray) – list of redshifts for which the q perpendicular should be computed- Returns:
redshift dependant value of q perpendicular
- Return type:
- kpar(z, k, mu)[source]#
Computes the parallel projection of a wavevector. Takes into acount AP-effect
- Parameters:
z (
float,numpy.ndarray) – The redshift of interest.k (
float,numpy.ndarray) – wavenumbers at which to compute the power spectrum. Must be in units of Mpc^-1/h.mu (
float,numpy.ndarray) – cosine of the angel between the line of sight and the wavevector
- Returns:
Observed parallel projection of wavevector onto the line of sight with AP-effect corrected for
- kper(z, k, mu)[source]#
Computes the perpendicular projection of a wavevector. Takes into acount AP-effect
- Parameters:
z (
float,numpy.ndarray) – The redshift of interest.k (
float,numpy.ndarray) – wavenumbers at which to compute the power spectrum. Must be in units of Mpc^-1/h.mu (
float,numpy.ndarray) – cosine of the angel between the line of sight and the wavevector
- Returns:
Observed perpendicular projection of wavevector onto the line of sight with AP-effect corrected for
- k_units_change(k)[source]#
Function that rescales the k-array, when asked for. The code is defined everywhere in 0/Mpc so a rescaling would be wrong.
- Parameters:
k (
float,numpy.ndarray) – wavenumbers in units of h sample/Mpc to be rescaled- Returns:
wavenumbers in un units of h ref/Mpc
- Return type:
- kmu_alc_pac(z, k, mu)[source]#
Function rescaling k and mu with the Alcock-Paczynski effect
- Parameters:
z (
numpy.ndarray,float) – redshiftk (
numpy.ndarray,float) – wavevectormu (
numpy.ndarray,float) – cosine of angle between line of sight and the wavevector
- Return type:
Note
Implements the following equation:
\[ \begin{align}\begin{aligned}k^{obs} = k\, \sqrt{\left(q_\| \mu \right)^2 + \left(1-\mu^2\right)q_\perp^2}\\\mu^{obs} = \mu\,q_\|\, \sqrt{\left(q_\| \mu \right)^2 + \left(1-\mu^2\right)q_\perp^2}^{-1}\end{aligned}\end{align} \]
- spec_err_z(z, k, mu)[source]#
Function to compute the scale dependant suppression of the observed power spectrum due to the spectroscopic redshift error
- Parameters:
z (
float,numpy.ndarray) – The redshifts of interest.k (
float,numpy.ndarray) – wavenumbers at which to compute the power spectrum suppression.mu (
float,numpy.ndarray) – cosine of the angel between the line of sight and the wavevector.
- Returns:
Suppression of the observed power spectrum due to the error on spectroscopic redshift determination.
- Return type:
Note
Implements the following equation:
\[\mathrm{Err} = \exp\left[-\sigma^2_\|\, k^2\, \mu^2 -\sigma_\perp^2 \,k^2\,\left(1- \mu^2\right)\right].\]
- BAO_term(z)[source]#
Calculates the BAO term. This is the rescaling of the Fourier volume by the AP-effect
- Parameters:
z (
float,numpy.ndarray) – The redshifts of interest- Returns:
Value of BAO term at redshifts z
- Return type:
Note
Implements the following equation:
\[\mathrm{BAO} = q_\perp^2\,q_\|\]
- bterm_fid(z, k=None, bias_sample='g')[source]#
Calculate the fiducial bias term for galaxies or intensity mapping.
- Parameters:
z (
floatornumpy.ndarray) – Redshift value(s) at which to evaluate the bias term.k (
floatornumpy.ndarray, optional) – Wavenumber(s) at which to evaluate the bias term.bias_sample (
str, optional) – Type of bias to compute. Must be either: - ‘g’ for galaxy clustering bias (default) - ‘I’ for intensity mapping bias
- Returns:
The computed bias term at the specified z and k values.
- Return type:
Note
The total bias is computed as the product of a redshift-dependent term and a scale-dependent term: b_total = b(z) * b(k)
- kaiserTerm(z, k, mu, b_i=None, just_rsd=False, bias_sample='g')[source]#
Computes the Kaiser redshift-space distortion term.
- Parameters:
z (
float,numpy.ndarray) – Redshifts of interestk (
float,numpy.ndarray) – Wave numbers at which to calculate the linear RSDmu (
float,numpy.ndarray) – cosine of angles between line of sight and the wavevector.b_i (
float,numpy.ndarray, optional) – galaxy bias at Redshifts zjust_rsd (
bool, optional) – If True, returns only the RSD term. Otherwise, computes the full Kaiser term. Defaults to False.bias_sample (
str, optional) – Bias term to use from self.bterm_fid(). Possible values: ‘g’: galaxies, ‘I’: intensity mapping. Defaults to ‘g’.
- Returns:
The computed Kaiser term for redshift space distortions.
Note
Implements the following equation:
\[\mathrm{RSD} = \left(b_i+f\,\mu^2\right)\]
- FingersOfGod(z, k, mu, mode='Lorentz')[source]#
Calculates the Fingers of God effect in redshift-space power spectra.
- Parameters:
z (
float,numpy.ndarray) – The redshifts values of interest.k (
float) – The wavenumber for which the suppression should be computedmu (
float,numpy.ndarray) – The cosine of angle between the wavevector and the line-of-sight direction.mode (
str, optional) – A string parameter indicating the model to use. Defaults to ‘Lorentz’.
- Returns:
The calculated FoG term, which is 1 if either FoG_switch is False or linear_switch is True. Otherwise, it depends on the specified mode.
- Return type:
Note
If mode is “Lorentz” this implements following equation
..math:
\mathrm{FoG} = \frac{1}{1+\left[f\,\sigma_p\,\mu^2\right]^2}
- P_ThetaTheta_Moments(zz, moment=0)[source]#
Calculates the angular power spectrum moments of the velocity divergence field, also known as the Theta field.
- normalized_pdd(z, k)[source]#
This function normalizes the power spectrum to have a variance smoothed over 8 Mpc/h of 1. This is to cancel out possible terms with \(\sigma_8\) in the RSD. :type z: :param z: The redshift at which to compute the normalized power spectrum :type z:
float,numpy.ndarray:type k: :param k: Wavenumber at which to compute the normalized power spectrum :type k:float,numpy.ndarray- Returns:
The Normalized power spectrum
- Return type:
Note
This is not really a normalisation if there is no \(\sigma_8\) terms inside of the RSD (Kaiserterm). It is then canceled out automatically
- normalized_pnw(z, k)[source]#
This function normalizes the power spectrum with the BAO wiggles subtracted from to have a variance smoothed over 8 Mpc/h of roughly 1. This is to cancel out possible terms with \(\sigma_8\) in the RSD. :type z: :param z: The redshift at which to compute the normalized ‘no-wiggle’ power spectrum :type z:
float,numpy.ndarray:type k: :param k: Wavenumber at which to compute the normalized ‘no-wiggle’ power spectrum :type k:float,numpy.ndarray- Returns:
The Normalized ‘no-wiggle’ power spectrum
- Return type:
Note
This is not really a normalisation if there is no \(\sigma_8\) terms inside of the RSD (Kaiserterm). It is then canceled out automatically
- dewiggled_pdd(z, k, mu)[source]#
This function calculates the normalized dewiggled power spectrum.
- Parameters:
z (
float,numpy.ndarray) – The redshifts values of interest.k (
float) – The wavenumber for which the power spectrum should be computedmu (
float,numpy.ndarray) – The cosine of angle between the wavevector and the line-of-sight direction.
- Returns:
The the mildly non-linear (dewiggled) power spectrum.
- Return type:
Note
If the config asks for only linear spectrum this just returns the power spectrum normalized with either 1 or 1/sigma8^2
- observed_Pgg(z, k, mu, b_i=None)[source]#
This function calculates the observed galaxy power spectrum.
- Parameters:
z (
float,numpy.ndarray) – The redshifts values of interest.k (
float) – The wavenumber for which the power spectrum should be computedmu (
float,numpy.ndarray) – The cosine of angle between the wavevector and the line-of-sight direction.b_i (
float,numpy.ndarray, optional) – Redshift dependant values of the galaxy bias
- Returns:
The observed galaxy power spectrum
- Return type:
Note
In presence of all modeling terms, this function implements the following equation:
\[P^{obs}_{gg} = q_\perp^2 \, q_\| \, \mathrm{RSD}^2 \, \mathrm{FoG}\, \frac{P_{dw}^{obs}}{\sigma_8^2} \, \mathrm{Err} + P_{shot}\]
- lnpobs_gg(z, k, mu, b_i=None)[source]#
This function calculates the natural logarithm of the observed galaxy power spectrum.
- Parameters:
z (
float,numpy.ndarray) – The redshifts values of interest.k (
float) – The wavenumber for which the power spectrum should be computedmu (
float,numpy.ndarray) – The cosine of angle between the wavevector and the line-of-sight direction.b_i (
float,numpy.ndarray, optional) – Redshift dependant values of the galaxy bias
- Returns:
The observed galaxy power spectrums natural logarithm
- Return type: