Calculate the size of a galaxy based on halo mass, stellar mass,
redshift, and cosmology, optionally including scatter.
Parameters:
mh (float, np.ndarray, list) – The halo mass or masses at which to compute the galaxy size in units of M_sol/h
mstar (float, np.ndarray, list) – The stellar mass or masses in units of M_sol/h
z (float) – The redshift at which to compute the galaxy size.
cosmo_col (Class (e.g., colossus.cosmology)) – An instance of a cosmology class to calculate angular diameter distances.
q_out (str) – The desired output quantity (‘tb’ for theta_b in arcsec or ‘rb’ for r_b in kpc/h).
model (str) – The name of the model used to calculate galaxy size (‘oguri20’ is default).
scatter (bool) – Whether to include scatter in the galaxy size calculation.
sig_tb (float) – The standard deviation of lognormal scatter if scatter is included for oguri20 model
Returns:
Galaxy effective radius calculated according to the specified model and parameters.
Units are either in arcseconds (if q_out=’tb’) or kpc/h (if q_out=’rb’), np.ndarray or float
This function supports multiple galaxy size models which may depend on different combinations
of halo mass, stellar mass, and redshift. It can also apply lognormal scatter to the sizes.
The fitting parameters for calculating stellar-mass-halo-mass function of P. Behroozi et al. 2019.
arXiv: 1806.07893
Parameters:
TYPE_SMHM (str) – “true” and “obs” are for quiescent galaxies but “true_all” is for all galaxies
in [“true”, “obs”, “true_all”]
Returns:
paramc, params. list. The fitting parameters for central galaxies and satellite galaxies
For the meaning of each parameters, please see the Notes in p_smhm.__init__
The following values are summarized in Table J1 of P. Behroozi et al. 2019 (arXiv: 1806.07893)
The values with TYPE_SMHM == “true” show the true values for quenched galaxies from Markov Chain Monte Carlo calculation in P. Behroozi et al. 2019
The values with TYPE_SMHM == “obs” show the values from observations for quenched galaxies
The values with TYPE_SMHM == “true_all” show the true values for all galaxies including star-forming and quenched galaxies
The galaxy-size model of T. Karmakar et al 2023.
arXiv: 2301.10409
We here adopt the following double-power-law fitting function as one of simple fitting functions,
The following values of a_z and b_z are determined by applying the curve_fit function in scipy.optimize
to the ratio between \(r_e\) and \(R_\mathrm{vir}\) for the data at four redshifts (z=0, 1, 2, 3) in T. Karmakar et al. (2023)
with the above fitting function and then applying numpy.polyfit at a linear level as functions of z.
mstar (ndarray) – satellite or central galaxy mass [Msun/h]; can be a number or a numpy array.
NOTICE: this mstar is based on Chabrier IMF. Then we use mstar_cor = mstar_chab/frac_SM_IMF as an input param
z (float) – redshift; can be a number or a numpy array.
Returns:
rb. ndarray or a number. The galaxy size, has the dimensions as 1.0e-3 * mass_so.M_to_R(mh, z, ‘vir’) i.e. [Mpc/h].
The following list of c_vdW50 shows [Gamma, lpha, eta, delta] appeared in the above equation.
These values are determined by applying the curve_fit function in scipy.optimize to the stellar half-mass radii data
of the 50% percentile in Table 5 of van der Wel et al. 2023 (arXiv: 2307.03264),
which is for quiescent galaxies at 0.5 < z < 1.0.
Generate a log-normal distribution of the scaling relation parameter based on
halo mass and redshift from T. Karmakar et al 2023.
arXiv: 2301.10409
We here adopt the following double-power-law fitting function as one of simple fitting functions,
The following values of a_z, b_z, c_z, and d_z are determined by applying the curve_fit function in scipy.optimize
to the ratio between \(r_e\) and \(R_\mathrm{vir}\) for the data at four redshifts (z=0, 1, 2, 3) in T. Karmakar et al. (2023)
with the above fitting function and then applying numpy.polyfit at a linear level as functions of z.
d is in units of M_sol/h
The following lists of c_vdW84 and c_vdW16 show [Gamma, lpha, eta, delta] appeared in the above equation.
These values are determined by applying the curve_fit function in scipy.optimize to the stellar half-mass radii data
of the 84% and 16% percentiles in Table 5 of van der Wel et al. 2023 (arXiv: 2307.03264), which are for quiescent galaxies at 0.5 < z < 1.0.
mstar_cor is defined to prevent the scatter from becoming too small or negative at the high mass end considering the fitting function.
The criteria mass of 10**11.4 mostly corresponds the maximum limit of data sets in van der Wel et al. 2023.
Set the galaxy parameters based on the halo position angle.
Parameters:
pol_halo (list or numpy.array) – Array or list of halo position angle values.
Returns:
elip_gal and polar_gal. An array of galaxy ellipticities
generated for each halo and an array of galaxy position anglen
angles derived from the halo position angle
Calculate the stellar mass of a galaxy from its halo mass using an empirical relation.
see P. Behroozi et al. 2019. for detail
arXiv: 1806.07893
Parameters:
Mh (float) – Halo mass of the galaxy in units of M_sol/h
z (float) – The redshift at which the stellar mass is calculated.
pa (object) – Parameter set for the stellar-mass halo-mass relation.
frac_SM_IMF (float) – Fraction of the stellar mass due to the initial mass function (IMF) against Chabrier IMF.
Default value is set to 1.715, coming from Salpeter IMF. (set to 1.0 for Chabrier IMF)
Returns:
stellar_mass. float. The estimated stellar mass of the galaxy in units of M_sol/h
deflector_type: type of the foreground/ deflector, e.g., ‘elliptical’
type: string
lsst_mags: a 2D array of the lsst magnitudes of the deflector with multi-band magnitudes
along the row, and different deflector along the column.
type: a 2D array of floats.
lsst_errs: a 2D array of the lsst magnitude errors of the deflector with multi-band errors
along the row, and different deflector along the column.
type: a 2D array of floats.
redshift: a 1D array of the redshifts
type: a 1D array of floats
cosmo: cosmology defined
type: astropy.cosmology
bands: bands for which you’re providing the magnitudes,
type: a list of strings e.g., [‘u’, ‘g’, ‘r’, ‘i’, ‘z’ ]
This function identifies potential lensing galaxies (deflectors) from
the LSST DP0.2 object catalogs or any other catalog, based on the
morphology, and provides their lens model parameters using the light-to-
mass function in SLSim.
: param DP0_table: the foreground galaxy catalog extracted from DP0.2 Object catalog
having the g, r, i, z, y bands cModel, deVaucouleur, and exponential fluxes and errors,
the true/ or photometric redshift,
redshift, gmag, rmag, imag, zmag, ymag, err-g, err-r, err-i, err-z, err-y
Please check the query in ‘extract_catalogs_DP0.py’ to extract the required parameters
from DP0.2 Object Catalogs
NOTE: the input catalog should have column names, as returned from DP0.2 Object catalogs’
: type DP0_table: astropy table
: param fracDev_limit: the fracDev limit above which a galaxy is considered to be an elliptical galaxy
(default is 0.8)
: type fracDev_limit: float
: param magnitude_cut_massive: absolute magnitude cut for selecting massive (luminous) galaxies
: type magnitude_cut_massive: float
: param pixel_scale: pixel scale for the LSST
: type pixel_scale: float
: param cosmo: the cosmology model used
: type cosmo: astropy.cosmology
: param parallel: will be set to True only if you are running the code in parallel
default is False
Returns: An output catalog (astropy table) of all the massive ellipticals selected from the input catalog
having the same columns as in the input catalog, with additional columns added for
velocity dispersion, position angle, axis ratio, half light radius (in arcsec), ellipticity.
Sample redshifts from a comoving density function. We took this function
is from SkyPy package but we have modified it to make suitable for the
constant comoving number density.
Sample galaxy redshifts such that the resulting distribution matches a past
lightcone with comoving galaxy number density density at redshifts
redshift. The comoving volume sampled corresponds to a sky area sky_area
and transverse comoving distance given by the cosmology cosmology.
If the noise parameter is set to true, the number of galaxies has Poisson
noise. If noise is false, the expected number of galaxies is used.
The inverse cumulative distribution function is approximated from the
number density and comoving volume calculated at the given redshift
values. The user must choose suitable redshift values to satisfy their
desired numerical accuracy.
Sample redshifts and stellar masses from a Schechter mass function.
Sample the redshifts and stellar masses of galaxies following a Schechter
mass function with potentially redshift-dependent parameters, limited
by maximum and minimum masses m_min, m_max, for a sky area sky_area.
Effectively calls ~skypy.galaxies.redshift.schechter_smf_redshift and
~skypy.galaxies.stellar_mass.schechter_smf_mass internally and returns
the tuple of results.
Sample the redshifts of velocity dispersion following a Schechter function
with potentially redshift-dependent parameters, limited by velocity dispersion
vd_max and vd_min, for a sky area sky_area.
where \(\\Gamma\) is the gamma function, \(\\sigma_*\) is the
characteristic velocity dispersion, \(\\phi_*\) is
number density and
\(\\alpha\) and \(\beta\) are free parameters.
where \(\Gamma\) is the gamma function, \(\sigma_*\) is the
characteristic velocity dispersion, \(\phi_*\) is
number density of all spiral galaxies and
\(\alpha\) and \(\beta\) are free parameters.
Calculates the velocity dispersion from the steller mass. The routine
uses abundance matching between stellar mass and velocity dispersion taking
the sample drawn from z=0 to z_max (which can be still at low redshift
where there is data on the velocity dispersion function)
Parameters:
galaxy_list (Table object) – list of galaxies with stellar masses given
z_max – maximum redshift to which the abundance matching with the SDSS
velocity dispersion function is valid
cosmo – astropy.cosmology instance
sky_area (~astropy.units.Quantity) – Sky area over which galaxies are sampled. Must be in units of solid
angle.
Returns:
interpolation function f; f(stellar_mass) -> vel_disp
Computes the luminosity weighted velocity dispersion for a deflector
with a stellar Hernquist profile and a NFW halo profile, assuming isotropic
anisotropy.
Parameters:
r – radius of the luminosity-weighted velocity dispersion
[arcsec]
Computes the average line-of-sight velocity dispersion in an aperture r
for a deflector with a NFW halo profile, assuming isotropic anisotropy
(beta = 0).
where \(\Gamma\) is the gamma function, \(\sigma_*\) is the
characteristic velocity dispersion, \(\phi_*\) is
number density and
\(\alpha\) and \(\beta\) are free parameters.