galsbi.ucat.galaxy_population_models package
galsbi.ucat.galaxy_population_models.galaxy_light_profile module
Created 2021
author: Tomasz Kacprzak
-
galsbi.ucat.galaxy_population_models.galaxy_light_profile.sample_sersic_berge(numgalaxies, int_mag, par)[source]
Sample the Sersic index-distribution parametrized as described in (Berge et al.
2013)
- Parameters:
numgalaxies – number of galaxies, i.e. number of samples
int_mag – intrinsic, unmagnified magnitude of all galaxies
par – ctx.parameters; part of ctx containing parameters
- Returns:
Sersic index
-
galsbi.ucat.galaxy_population_models.galaxy_light_profile.sample_sersic_betaprime(n_gal, mode, size, alpha=0, z=0.0, min_n=0.2, max_n=5.0)[source]
Sample the Sersic index-distribution parametrized as described in (Moser et al.
2024). The parameter mode corresponds to the mode of the distribution, the size
parameter is responsible for the scatter (with larger size the distribution becomes
tighter). The alpha parameter is responsible for the redshift dependence of the
mode. This was first introduced in Fischbacher et al. 2024.
- Parameters:
n_gal – number of galaxies, i.e. number of samples
mode – mode of the distribution
size – size of the distribution (with larger size the distribution becomes
tighter)
alpha – redshift dependence of the mode
z – redshift
min_n – minimum Sersic index, raise exception if the sampled value is below
this value
max_n – maximum Sersic index, raise exception if the sampled value is above
this value
- Returns:
Sersic index
-
galsbi.ucat.galaxy_population_models.galaxy_light_profile.sample_sersic_for_galaxy_type(n_gal, galaxy_type, app_mag, par, z=0.0)[source]
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function module
Created on Sept 2021
author: Tomasz Kacprzak
using code from: Joerg Herbel
-
class galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.LuminosityFunction(name, lum_fct_parametrization, m_star_slope, m_star_intcpt, phi_star_amp, phi_star_exp, z_const, alpha, cosmo, pixarea, galaxy_type, seed_ngal, z_res=0.001, m_res=0.001, z_max=inf, m_max=2, z_m_intp=None, ngal_multiplier=1)[source]
Bases: object
Luminosity function
-
sample_z_mabs_and_apply_cut(seed_ngal, seed_lumfun, n_gal_max=inf, size_chunk=10000)[source]
This function gets the abs mag and z using chunking, which uses less memory than
the original method. It does not give exactly the same result as before due to
different order of random draws in z_mabs_sampler, but it’s the same sample.
-
class galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.NumGalCalculator(z_max, m_max, parametrization, z_const, alpha, m_star_par, phi_star_par, cosmo, pixarea, ngal_multiplier=1)[source]
Bases: object
Computes galaxy number counts by integrating the galaxy luminosity function.
The integral over absolute magnitudes can be done analytically, while the integral
over redshifts is computed numerically. See also
docs/jupyter_notebooks/sample_redshift_magnitude.ipynb.
-
class galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.RedshiftAbsMagSampler(z_res, z_max, m_res, m_max, parametrization, z_const, alpha, m_star_par, phi_star_par, cosmo)[source]
Bases: object
Samples redshifts and absolute magnitudes from the galaxy luminosity function.
The sampling is done by first drawing redshifts from the redshift-pdf obtained by
integrating out absolute magnitudes. Then, we sample absolute magnitudes from the
conditional pdfs obtained by conditioning the luminosity function on the sampled
redshifts (the conditional pdf is different for each redshift). See also
docs/jupyter_notebooks/sample_redshift_magnitude.ipynb and
docs/jupyter_notebooks/test_self_consistency.ipynb.
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.find_closest_ind(grid, vals)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.initialize_luminosity_functions(par, pixarea, cosmo, z_m_intp=None)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.m_star_lum_fct(z, parametrization, z_const, slope, intercept)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.maximum_redshift(z_m_intp, m_max, z_max, parametrization, z_const, alpha, m_star_par, seed_ngal)[source]
Computes the maximum redshift up to which we sample objects from the luminosity
function. The cutoff is based on the criterion that the CDF for absolute magnitudes
is larger than 1e-5, i.e. that there is a reasonable probability of actually
obtaining objects at this redshift and absolute magnitude which still pass the cut
on par.gals_mag_max.
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.phi_star_lum_fct(z, parametrization, amplitude, exp)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_luminosity_function.upper_inc_gamma(a, x)[source]
galsbi.ucat.galaxy_population_models.galaxy_position module
Created 2021
author: Tomasz Kacprzak
-
galsbi.ucat.galaxy_population_models.galaxy_position.sample_position_uniform(numobj, w, pixel_index, nside)[source]
Sample a Healpix pixel uniformly
- Parameters:
numobj – Number of uniform samples
w – wcs-object containing all the relevant wcs-information
pixel_index – Index of the Healpix pixels sampled
nside – NSIDE of the Healpix map
- Returns:
Uniformly drawn x-coordinate (in pixels)
- Returns:
Uniformly drawn y-coordinate (in pixels)
galsbi.ucat.galaxy_population_models.galaxy_sed module
Created 2021
author: Tomasz Kacprzak
-
galsbi.ucat.galaxy_population_models.galaxy_sed.dirichlet_alpha_ev(z, alpha0, alpha1, z1)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_sed.draw_dirichlet_add_weight(alpha, weight)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_sed.sample_template_coeff_dirichlet(z, alpha0, alpha1, z1, weight)[source]
Samples template coefficients from redshift-dependent Dirichlet distributions.
See also docs/jupyter_notebooks/coeff_distribution_dirichlet.ipynb.
-
galsbi.ucat.galaxy_population_models.galaxy_sed.sample_template_coeff_dirichlet__alpha_mode(z, amode0, amode1, z1, weight, alpha0_std, alpha1_std)[source]
Samples template coefficients from redshift-dependent Dirichlet distributions.
See also docs/jupyter_notebooks/coeff_distribution_dirichlet.ipynb.
Then the alpha0 and alpha1 will be scaled such that std(alpha)=alpha_std,
for a equal alphas. alpha_std is also interpolated between redshifts.
-
galsbi.ucat.galaxy_population_models.galaxy_sed.sample_template_coeff_lumfuncs(par, redshift_z, n_templates)[source]
galsbi.ucat.galaxy_population_models.galaxy_shape module
Created 2021
author: Tomasz Kacprzak
-
galsbi.ucat.galaxy_population_models.galaxy_shape.backwards_compatibility(par)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_shape.distortion_to_shear(distortion_x)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_shape.pe_bulge(ngal, b=2.368, c=6.691)[source]
From miller2013.
-
galsbi.ucat.galaxy_population_models.galaxy_shape.pe_disc(ngal, log_a=-1.3708147902715042, emax=0.8, emin=0.0256, pow_alpha=1)[source]
From miller2013.
-
galsbi.ucat.galaxy_population_models.galaxy_shape.sample_ellipticities_beta(n_gal, par)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_shape.sample_ellipticities_beta_mode(n_gal, ell_beta_ab_sum, ell_beta_mode, ell_beta_emax)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_shape.sample_ellipticities_for_galaxy_type(n_gal, galaxy_type, par)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_shape.sample_ellipticities_gaussian(numgalaxies, e1_mean, e2_mean, e1_sigma, e2_sigma)[source]
Sample Gaussian distributions for the intrinsic e1 and e2 while enforcing that
e1**2 + e2**2 <= 1
- Parameters:
numgalaxies – number of galaxies, i.e. number of samples
par – ctx.parameters; part of ctx containing parameters
- Returns:
e1 values
- Returns:
e2 values
galsbi.ucat.galaxy_population_models.galaxy_size module
Created 2021
author: Tomasz Kacprzak
-
galsbi.ucat.galaxy_population_models.galaxy_size.apply_pycosmo_distfun(dist_fun, z)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_size.backwards_compatibility(par)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_size.r50_phys_to_ang(r50_phys, cosmo, z, pixscale)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_size.sample_r50_for_galaxy_type(z, abs_mag, cosmo, par, galaxy_type)[source]
-
galsbi.ucat.galaxy_population_models.galaxy_size.sample_r50_phys(abs_mag_shift, logr50_phys_std, logr50_phys_mean_slope, logr50_phys_mean_intcpt, logr50_alpha=0.0, z=0.0)[source]