The galprops Module
The galprops module is designed to support adding new properties to
simulation halo catalogs. This is done by defining functions which take a given
(existing) set of halo properties, and returns values for a new property derived
from those values. For example a function could return a star formation rate
based on the redshift and dark matter halo mass already in the catalog.
A number of such functions have been implemented and included in SimIM as defaults. It is also possible to define new functions and add them.
Functions defined in the galprops module can either be used in a standalone
fashion, or can be wrapped using the Prop and MultiProp classes then
wrap these functions with instructions that allow SimHandler,
SnapHandler, and LCHandler instances to easily apply them to galaxy
catalogs.
Prop and GalProp Classes
- class simim.galprops.Prop(prop_name, prop_function, kwargs, give_args_in_h_units=False, function_return_in_h_units=False, units='None', h_dependence=0)
Class that describes how to add a single property to a lightcone or snapshot.
- Parameters:
- prop_namestr
The name of the property
- prop_functionfunction
A function that given a set of arguments (specified by kwargs) will return the values of the property for each halo.
- kwargslist
The names of the keyword arguments for prop_function. These will correspond to properties already associated with the light cone/ snapshot. A special case is “cosmo” which will retreive the cosmology metadata
- give_args_in_h_unitsbool
If False, all properties used as inputs to the prop_function call will be converted to units free of little h (ie Msun instead of Msun/h). Default if False.
- function_return_in_little_hbool
If False, all properties returned by the function will be converted into little h units using the h_dependence parameter
- unitsstr
The units of the property.
- h_dependencefloat
The h dependence of the property. The dependence should be specified in powers of h, ie a quantity with units Mpc/h will have h_dependence = -1, a quantity with no h in the units will have h_dependence = 0, etc.
Methods
evaluate(target[, use_all_inds, kw_remap])Apply the property to a target object.
evaluate_all(target[, use_all_inds, ...])Apply the properties to a target object.
- evaluate(target, use_all_inds=False, kw_remap={})
Apply the property to a target object.
- Parameters:
- targetlightcone.handler.handler or siminterface.simhandler.SnapHandler class
The lightcone or snapshot to evaluate the property for
- use_all_indsbool
If True values will be assigned for all halos, otherwise only active halos will be evaluated, and others will be assigned nan.
- kw_remapdict, optional
A dictinary remaping kwargs of the property generating function to different properties of the lightcone. By default if the function has kwarg ‘x’ it will be evaluated on lightcone property ‘x’, but passing the dictionary {‘x’:’y’} will result in lightcone the function being evaluated on lightcone property ‘y’.
- Returns:
- valsfloat or array
The values of the property assigned to each halo.
- class simim.galprops.MultiProp(prop_names, prop_function, kwargs, give_args_in_h_units=False, function_return_in_h_units=False, units=['None'], h_dependence=[0], wrap=True)
Class that describes how to add properties to a lightcone or snapshot
- Parameters:
- prop_nameslist
A list containing the names of the properties in order
- prop_functionfunction
A function that given a set of arguments (specified by kwargs) will return a list containing the values for each property as separate elements. The order of the list must match the order in prop_names.
- kwargslist
The names of the keyword arguments for prop_function. These will correspond to properties already associated with the light cone/ snapshot. A special case is “cosmo” which will retreive the cosmology metadata
- give_args_in_h_unitsbool
If False, all properties used as inputs to the prop_function call will be converted to units free of little h (ie Msun instead of Msun/h). Default if False.
- function_return_in_little_hbool
If False, all properties returned by the function will be converted into little h units using the h_dependence parameter
- unitslist
A list containing the units of the properties. It should either be of length one (if all properties have the same units) or should match the length of prop_names and have the same order.
- h_dependencelist
A list containing the h dependence of the properties. It should either be of length one (if all properties have the same dependence) or should match the length of prop_names and have the same order. The dependence should be specified in powers of h, ie a quantity with units Mpc/h will have h_dependence = -1, a quantity with no h in the units will have h_dependence = 0, etc.
- wrapbool
If a function returns a single set of property values instead of a list of values for many properties (ie if only one property is returned), this should be set to True - or just use the prop class
Methods
evaluate(target[, use_all_inds, kw_remap, ...])See evaluate_all - identical functionality.
evaluate_all(target[, use_all_inds, ...])Apply the properties to a target object.
- evaluate_all(target, use_all_inds=False, kw_remap={}, kw_arguments={})
Apply the properties to a target object.
- Parameters:
- targetlightcone.handler.handler or siminterface.simhandler.SnapHandler class
The lightcone or snapshot to evaluate the property for
- use_all_indsbool
If True values will be assigned for all halos, otherwise only active halos will be evaluated, and others will be assigned nan.
- kw_remapdict, optional
A dictinary remaping kwargs of the property generating function to different properties of the lightcone. By default if the function has kwarg ‘x’ it will be evaluated on lightcone property ‘x’, but passing the dictionary {‘x’:’y’} will result in lightcone the function being evaluated on lightcone property ‘y’.
- kw_argumentsdict, optional
A list of additional keyword arguments to be passed to the property function call
- Returns:
- valslist
A list containing the values of each property assigned.
- evaluate(target, use_all_inds=False, kw_remap={}, kw_arguments={})
See evaluate_all - identical functionality. This is just a wrapper to match the prop subclass
Pre-Packaged Galaxy Properties
A number prescriptions for assigning galaxy properties - most often SFR, stellar mass, or luminosity - are built into SimIM. These are drawn from various literature sources. If these models are used in published work, please make appropriate reference to the original source - noted in the documentation for each model.
The prescriptions are implemented both as standalone functions, and as Prop instances.
The Prop instances are automatically available within the simim.galprops module.
Functional versions must be imported from appropriate sub-modules.
Stellar Masses and Star Formation Rates
- class simim.galprops.sfr_behroozi13.behroozi13_base(warn=False)
Class implementing the best fitting SFR(Mhalo) relation from Behroozi et al. 2013
Methods
plot_grid([prop])Plot the grid.
sfr(redshift, mass[, scatter, ...])Function to assign star formation rates based on the model from Behroozi et al. 2013.
stellarmass(redshift, mass[, scatter, ...])Function to assign stellar masses based on the model from Behroozi et al. 2013.
Initialize class - if running for the first time, this will set up and cache some files for interpolating within the value grid provided in the public data release from https://www.peterbehroozi.com/uploads/6/5/4/8/6548418/sfh_z0_z8.tar.gz
- Parameters:
- warnbool
Toggles whether a warning will be shown for masses or redshifts parameter range covered in the underlying data outside the default range
Methods
plot_grid([prop])Plot the grid.
sfr(redshift, mass[, scatter, ...])Function to assign star formation rates based on the model from Behroozi et al. 2013.
stellarmass(redshift, mass[, scatter, ...])Function to assign stellar masses based on the model from Behroozi et al. 2013.
- plot_grid(prop='sfr')
Plot the grid.
- Parameters:
- prop‘sfr’ or ‘stellar’
The property to show
- sfr(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44DD20)
Function to assign star formation rates based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- sfrfloat or array
The assigned SFRs in Msun/yr
- stellarmass(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E500)
Function to assign stellar masses based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- stellarfloat or array
The assigned stellar mass in Msun
- simim.galprops.sfr_behroozi13.sfr(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E6C0)
Function to assign star formation rates based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- sfrfloat or array
The assigned SFRs in Msun/yr
- simim.galprops.sfr_behroozi13.stellarmass(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E420)
Function to assign stellar masses based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- stellarfloat or array
The assigned stellar mass in Msun
- class simim.galprops.sfr_bethermin17.bethermin17_base(sim, sm_comp=False, sm_remake=False, sm_haloprop='auto', sm_halomassmin=10000000000.0, sffrac_fq00=0.1017, sffrac_gamma=-1.039, sffrac_logmt0=10.53, sffrac_alpha1=0.2232, sffrac_alpha2=0.0913, sffrac_sigsf0=0.8488, sffrac_beta1=0.0418, sffrac_beta2=-0.0159, sfms_m0=0.5, sfms_m1=0.36, sfms_a0=1.5, sfms_a1=0.3, sfms_a2=2.5, sfms_correztlowz=True, sfms_sigma=0.3, sfms_msoffset=0.87, sfms_sboffset=5.3, sf_sflimit=10000.0)
Code to implement the Bethermin et al. 2017 (SIDES) prescription for SFR and stellar mass. Note that this implementation does not include scatter when performing abundance matching, this will produce result in a different relation between halo and galaxy properties, but the same stellar mass function and star formation rate distribution function.
When initializing a simulation must be provided as the base for abundance matching. This should match the underlying simulation being used for model construction (or at least have a similar cosmology).
Abundance matching results are cached for later use.
Methods
b17_sbfrac(m_stars, z)Compute starburts fraction given stellar mass and redshift
b17_sffrac(m_stars, z)Compute star forming fraction given stellar mass and redshift
b17_sfms(m_stars, z)Compute main sequence given stellar mass and redshift
b17_sfr(m_stars, z[, rng, return_fracs])Compute SFR given stellar mass and redshift
b17_smfpars(z, cosmo)Update parameters to a chosen cosmology
stellarmass(haloprop, redshift)Compute stellar mass given haloprop (either mass or vmax) and redshift
- Parameters:
- simstring
Name of simulation - should correspond to a SimIM formatted halo catalog, used to perform the abundance matching.
- sm_compbool, default is False
If set to True, will carry out abundance matching to determine the halo-stellar mass connection if the basic files cannot be loaded
- sm_haloprop‘vmax’, ‘mass’, or ‘auto’
Halo property to abundance match to stellar mass function - vmax for peak rotational velocity, mass for halo mass. auto will check if vmax is present in the catalog and use this, or use mass otherwise. Ignored if sm_comp==False
- sm_halomassminfloat
Minimum halo mass to consider when abundance matching in units of Msun, defaults to 10^10 Msun. Ignored if sm_comp==False
- sm_remakebool
Rerun the abundance matching when initializing. Ignored if sm_comp==False
- sffrac_fq00, sffrac_gamma, sffrac_logmt0, sffrac_alpha1, sffrac_alpha2, sffrac_sigsf0, sffrac_beta1, sffrac_beta2float
Parameters controling the fraction of galaxies considered star forming - Equation 2 of Bethermin 17. Defaults are the values from the paper
- sfms_m0, sfms_m1, sfms_a0, sfms_a1, sfms_a2float
Parameters controlling the star forming main sequence parameterization - Equation 6 of Bethermin 17. Defaults are the values from the paper
- sfms_correztlowzbool
Toggle whether the main-sequence fudge factor is applied at z<1 (see Bethermin 17 Appendix B). Default is True, as in the Bethermin paper
- sfms_sigma, sfms_msoffset, sfms_sboffset, sf_sflimitfloat
Parameters controlling the assignment of SFRs, see Bethermin 17 section 2.5. Defaults match the paper
Methods
b17_sbfrac(m_stars, z)Compute starburts fraction given stellar mass and redshift
b17_sffrac(m_stars, z)Compute star forming fraction given stellar mass and redshift
b17_sfms(m_stars, z)Compute main sequence given stellar mass and redshift
b17_sfr(m_stars, z[, rng, return_fracs])Compute SFR given stellar mass and redshift
b17_smfpars(z, cosmo)Update parameters to a chosen cosmology
stellarmass(haloprop, redshift)Compute stellar mass given haloprop (either mass or vmax) and redshift
- b17_smfpars(z, cosmo)
Update parameters to a chosen cosmology
- b17_sffrac(m_stars, z)
Compute star forming fraction given stellar mass and redshift
- b17_sfms(m_stars, z)
Compute main sequence given stellar mass and redshift
- b17_sbfrac(m_stars, z)
Compute starburts fraction given stellar mass and redshift
- b17_sfr(m_stars, z, rng=Generator(PCG64) at 0x78410A4CEDC0, return_fracs=False)
Compute SFR given stellar mass and redshift
- stellarmass(haloprop, redshift)
Compute stellar mass given haloprop (either mass or vmax) and redshift
- class simim.galprops.sfr_ir.g13irlf_base(sim, comp=False, remake=False, haloprop='auto', halomassmin=10000000000.0, lirmin=316227766.01683795, lf_alpha0=1.2, lf_sigma0=0.5, lf_lstar0=8912509381.33744, lf_phistar0=0.005623413251903491, lir_to_sfr=1e-10)
SFRs based on abundance matching Gruppioni et al. IR luminosity functions
Methods
get_irlf_pars(z[, alpha0, sigma0, lstar0, ...])Use the redshift scaling from Gruppioni et al. 2013 to get IRLF parameters.
lir(haloprop, redshift)Compute IR luminosity given haloprop (either mass or vmax) and redshift
sfr(haloprop, redshift[, lir_to_sfr])Compute SFR given haloprop (either mass or vmax) and redshift
- Parameters:
- simstring
Name of simulation - should correspond to a SimIM formatted halo catalog, used to perform the abundance matching.
- compbool, default is False
If set to True, will carry out abundance matching to determine the halo-LIR connection if the basic files cannot be loaded
- haloprop‘vmax’, ‘mass’, or ‘auto’
Halo property to abundance match to IR LF - vmax for peak rotational velocity, mass for halo mass. auto will check if vmax is present in the catalog and use this, or use mass otherwise. Ignored if comp==False
- halomassminfloat
Minimum halo mass to consider when abundance matching in units of Msun, defaults to 10^10 Msun. Ignored if comp==False
- lirminfloat
Minimum IR luminosity to consider when abundance matching
- remakebool
Rerun the abundance matching when initializing. Ignored if comp==False
- lf_alpha0, lf_sigma0, lf_lstar0, lf_phistar0float
Redshift 0 LF parameters passed to G13 scaling
- lir_to_sfrfloat, optional
Sets the conversion between SFR and IR luminosity (default is 1e-10, correct for Chambrier IMF)
Methods
get_irlf_pars(z[, alpha0, sigma0, lstar0, ...])Use the redshift scaling from Gruppioni et al. 2013 to get IRLF parameters.
lir(haloprop, redshift)Compute IR luminosity given haloprop (either mass or vmax) and redshift
sfr(haloprop, redshift[, lir_to_sfr])Compute SFR given haloprop (either mass or vmax) and redshift
- get_irlf_pars(z, alpha0=1.2, sigma0=0.5, lstar0=8912509381.33744, phistar0=0.005623413251903491)
Use the redshift scaling from Gruppioni et al. 2013 to get IRLF parameters
- lir(haloprop, redshift)
Compute IR luminosity given haloprop (either mass or vmax) and redshift
- sfr(haloprop, redshift, lir_to_sfr=None)
Compute SFR given haloprop (either mass or vmax) and redshift
Spectral Line Luminosities
Carbon Monoxide
- simim.galprops.line_co.keating16(mass, m_min=10000000000.0, A=6.3e-07, scatter_lco=True, sig_lco=0.3, rng=Generator(PCG64) at 0x78410B478E40)
Compute CO luminosities based on the simple model of Keating et al. 2016. Note that scatter does not preseve the linear mean here (preserves the median instead).
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- m_minfloat
The minimum mass for a halo to emit CO
- Afloat
Used in converting mass to luminosity: L_co = A*mass
- scatter_lcobool, optional
Toggles scattering on or off, default is on (True)
- sig_lcofloat, optional
The scatter in dex to add around the mean CO luminosity.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_cofloat or array
The assigned CO luminosities in Lsun
- simim.galprops.line_co.li16(sfr, d_mf=1.0, a=1.37, b=-1.74, nu_rest=115271201800.0, scatter_lco=True, sig_lco=0.3, rng=Generator(PCG64) at 0x78410B478F20)
Compute CO luminosities based on Li et al. 2016 model.
See equations 1, 2, and 4 along with the steps outlined on page 4 of the Li et al. 2016 paper. We assign a CO luminosity based on a galaxy’s SFR. Scatter can be introduced using a lognormal distribution.
- Parameters:
- sfrfloat or array
The star formation rate of the halo(s), in Msun/yr
- d_mffloat, optional
Sets the conversion between SFR and IR luminosity (default is 1.0, correct for Chambrier IMF)
- a, bfloats, optional
The slope and intercept of the integrated KS law (defaults are 1.37 and -1.74, taken for Li et al.’s fit to a collection of literature values)
- nu_restfloat, optional
The rest frequency of the emission line in GHz (default is for CO(1-0)).
- scatter_lcobool, optional
Toggles scattering on or off, default is on (True)
- sig_lcofloat, optional
The scatter in dex to add around the mean CO luminosity, linear mean will be preserved.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_cofloat or array
The assigned CO luminosities in Lsun
- simim.galprops.line_co.pullen13(mass, redshift, cosmo, rand_f_duty=True, sf_length=0.1, rng=Generator(PCG64) at 0x78410A44D540)
Compute CO luminosities based on Pullen et al. 2013’s Model A.
We assign a CO luminosity based on a galaxy’s mass. See equation 5 of Pullen. Note that the Pullen model includes a duty cycle in which only a fraction of the halos are assigned this luminosity and the rest are assigned 0 luminosity.
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- redshiftfloat or array
The redshift(s) of the halo(s)
- cosmoastropy.cosmology.flatlambdacdm instance
The cosmology to use when calculating the age of the universe
- sf_lengthfloat
The length of star formation events for a galaxy, in Gyr. Used in computing the fraction of halos that are on. Default is 0.1 Gyr.
- rand_f_dutybool, optional
If True, a random set of galaxies will be turned on (with probability equal to f_duty). If False, all galaxies will be assigned f_duty times the computed L_co to provide the correct total luminosity but individual luminosities that are too low (on average). Default is True.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_cofloat or array
The assigned CO luminosities in Lsun
- simim.galprops.line_co.lidz11(mass, f_duty=0.1, rand_f_duty=True, rng=Generator(PCG64) at 0x78410A44C740)
Compute CO luminosities based on the prescription of Lidz et al. 2011.
We assign a CO luminosity based on a galaxy’s mass. See equation 12 of Lidz. Note that the model includes a duty cycle in which only a fraction of the halos are assigned this luminosity and the rest are assigned 0 luminosity. If the argument rand_f_duty is set to False, instead of selecting a random set of halos to be “on”, all halos will be given f_duty * L_co as their final luminosity, resulting in a correct total luminosity, but individual galaxy luminosities that are too low.
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- f_dutyfloat, optional
The fraction of galaxies which should be luminous at a given time. The default is 0.1. The Lids model is optimized for a universe ~10^9 years old and a star formation timescale of ~10^8 years, which gives 0.1
- rand_f_dutybool, optional
If True, a random set of galaxies will be turned on (with probability equal to f_duty). If False, all galaxies will be assigned f_duty times the computed L_co to provide the correct total luminosity but individual luminosities that are too low (on average)
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_cofloat or array
The assigned CO luminosities in Lsun
- simim.galprops.line_co.kamenetzky16(sfr, lines=array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]), d_mf=1.0, fircor=0.6, scatter_lco=True, sig_lco=0.3, break_ulirgs=False, rng=Generator(PCG64) at 0x78410A44D9A0)
Compute CO luminosities based on the SLEDs of Kamenetzky et al. 2016.
We assign a CO luminosity based on a galaxy’s SFR. Scatter can be introduced using a lognormal distribution.
- Parameters:
- sfrfloat or array
The star formation rate of the halo(s), in Msun/yr
- lineslist of ints
The J-upper values for the transitions to generate. 1-0 through 13-12 are available
- break_ulirgsbool
If True, galaxies with L_ir > 6e10 will be treated differently from those with a lower L_ir.
- d_mffloat, optional
Sets the conversion between SFR and IR luminosity (default is 1.0, correct for Chambrier IMF)
- fircorfloat, optional
Sets the conversion between IR and FIR luminosity. Defaults to L_FIR = 0.6 * L_IR
- scatter_lcobool, optional
Toggles scattering on or off, default is on (True)
- sig_lcofloat, optional
The scatter in dex to add around the mean CO luminosity, linear mean is not preserved.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_cofloat or array
The assigned CO luminosities in Lsun
- simim.galprops.line_co_dutycycle.f_duty(sf_length, redshift, cosmo)
Compute the fraction of star formating galaxies given a star formation lifetime and some cosmological information. Model assumes a single starburst (ie each galaxy forms stars only once) - giving sf_length = n*starburst_length allows an arbitrary number of star formation events
- Parameters:
- sf_lengthfloat or array
The length of star formation events, in Gyr
- redshiftfloat or array
The redshift of the galaxies in question
- cosmoastropy.cosmology.flatlambdacdm instance
The cosmology to use when calculating the age of the universe
- Returns:
- fractionarray
The fraction of the time during which a galaxy forms stars
HCN
- simim.galprops.line_densegas.hcn_gao(sfr, d_mf=1.0, a=1.0, b=2.9, nu_rest=88630000000.0, scatter_lhcn=True, sig_lhcn=0.3, rng=Generator(PCG64) at 0x78410A44DA80)
Compute the HCN(1-0) luminosity based on Chung et al. 2017’s implementation of the Gao and Solomon 2004 fit.
- Parameters:
- sfrfloat or array
The star formation rate of the halo(s), in Msun/yr
- d_mffloat, optional
Sets the conversion between SFR and IR luminosity (default is 1.0, correct for Chambrier IMF)
- a, bfloats, optional
The slope and intercept of the power law relating L_IR to L’_HCN. (defaults are 1.0 and 2.9, based on Gao and Solomon’s fit
- nu_restfloat, optional
The rest frequency of the emission line in GHz (default is for HCN(1-0)).
- scatter_lhcnbool, optional
Toggles scattering on or off, default is on (True)
- sig_lhcnfloat, optional
The scatter in dex to add around the mean HCN luminosity, linear mean will be preserved.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_hcnfloat or array
The assigned HCN luminosities in Lsun
- simim.galprops.line_densegas.hcn_breysse(mass, f_duty=0.1, rand_f_duty=True, rng=Generator(PCG64) at 0x78410A44E260)
Compute the HCN(1-0) luminosity based on Breysse et al.’s prescription.
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- f_dutyfloat, optional
The fraction of galaxies which should be luminous at a given time. The default is 0.1.
- rand_f_dutybool, optional
If True, a random set of galaxies will be turned on (with probability equal to f_duty). If False, all galaxies will be assigned f_duty times the computed L_co to provide the correct total luminosity but individual luminosities that are too low (on average)
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_hcnfloat or array
The assigned HCN luminosities in Lsun
Far-Infrared
- simim.galprops.line_fir.delooze14(sfr, line='[CII]', set=None, scatter=True, fix_scatter=None, rng=Generator(PCG64) at 0x78410A44DC40)
Compute FIR line luminosities based on the fits from De Looze et al. 2014.
- Most lines and galaxy subsets are included. Options for line are:
‘[CII]’, ‘[OI]’, and ‘[OIII]’
- Options for galaxy sets are
None, ‘DGS’, ‘dwarfs’, ‘starbursts’, ‘comp/agn’
For line=’[CII]’ you can also select the galaxy set ‘high z’.
- Parameters:
- sfrfloat or array
The star formation rage of the halo(s), in Msun/yr
- line‘[CII]’, ‘[OI]’, or ‘[OIII]’
The line for which the luminosity should be computed, default is [CII]
- scatterbool, optional
Toggles scattering on or off, default is on (True). Scatter is determined based on the fits provided.
- fix_scatterNone or float, optional
If scatter is True, the default behavior is to use the intrinsic scatter from the delooze et al. fits to determine the width of the scatter applied. Alternatively the fix_scatter parameter can be set to a different scatter value. The value should be specified in dex.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linearray
The assigned line luminosity in Lsun
- simim.galprops.line_fir.uzgil14(sfr, d_mf=1.0, line='[CII]', set=None, scatter=True, sig_scatter=0.4, rng=Generator(PCG64) at 0x78410A44DB60)
Compute FIR line luminosities based on the fits used by Uzgil et al. 2014. Note that these fits were incorrect, this function is here for historical comparison. Use the spinoglio12 function for the corrected fits.
- The lines available are:
‘[CII]’, ‘[NII]’, ‘[OI]’, ‘[OIII]88um’, ‘[OIII]52um’, ‘[SiII]’, ‘[SiIII]33um’, ‘[SiIII]19um’, ‘[NeII]’, and ‘[NeIII]’
- Parameters:
- sfrfloat or array
The star formation rate of the halo(s), in Msun/yr
- d_mffloat, optional
Sets the conversion between SFR and IR luminosity (default is 1.0, correct for Chambrier IMF)
- linesee above
The line for which the luminosity should be computed, default is [CII]
- scatterbool, optional
Toggles scattering on or off, default is on (True)
- sig_scatterfloat, optional
The scatter in dex to add around the mean luminosity, linear mean is not preserved. The default is 0.4 based on the scatter found by DeLooze et al. 2014 for [CII]
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linefloat or array
The assigned line luminosities in Lsun
- simim.galprops.line_fir.spinoglio12(sfr, d_mf=1.0, line='[CII]', set=None, scatter=True, sig_scatter=0.4, rng=Generator(PCG64) at 0x78410A44E180)
Compute FIR line luminosities based on the fits used of Spinoglio et al. 2012, updated to account for the erratum published in 2014.
- The lines available are:
‘[CII]’, ‘[NII]’, ‘[OI]’, ‘[OIII]88um’, ‘[OIII]52um’, ‘[SiII]’, ‘[SiIII]33um’, ‘[SiIII]19um’, ‘[NeII]’, and ‘[NeIII]’
- Parameters:
- sfrfloat or array
The star formation rate of the halo(s), in Msun/yr
- d_mffloat, optional
Sets the conversion between SFR and IR luminosity (default is 1.0, correct for Chambrier IMF)
- linesee above
The line for which the luminosity should be computed, default is [CII]
- scatterbool, optional
Toggles scattering on or off, default is on (True)
- sig_scatterfloat, optional
The scatter in dex to add around the mean luminosity, linear mean is not preserved. The default is 0.4 based on the scatter found by DeLooze et al. 2014 for [CII]
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linefloat or array
The assigned line luminosities in Lsun
- simim.galprops.line_fir.schaerer20(sfr, set=None, scatter=True, sig_scatter=0.4, rng=Generator(PCG64) at 0x78410A44DE00)
Compute CII line luminosities based on the fits from Schaerer et al. 2020 (ALPINE).
- Parameters:
- sfrfloat or array
The star formation rage of the halo(s), in Msun/yr
- set‘ALPINE-uvir’,’ALPINE-sed’,’ALPINE-uvirx’,’high z-uvirx’
The fit which should be used (see Schaerer’s table A.1). All implemented fits are for the 3sigma limits. Default is ‘ALPINE-uvirx’.
- scatterbool, optional
Toggles scattering on or off, default is on (True). Scatter is determined based on the fits provided.
- sig_scatterfloat, optional
The scatter in dex to add around the mean luminosity, linear mean is not preserved. The default is 0.4 based on the scatter found by DeLooze et al. 2014 for [CII]
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linearray
The assigned line luminosity in Lsun
- simim.galprops.line_fir.zhao13(sfr, d_mf=1.0, scatter=True, sig_scatter=0.4, rng=Generator(PCG64) at 0x78410A44E0A0)
Compute NII 205um line luminosities based on the fits from Zhao et al. 2013.
- Parameters:
- sfrfloat or array
The star formation rage of the halo(s), in Msun/yr
- d_mffloat (default = 1.0)
The relation between IR luminosity and SFR is taken to be SFR=d_mf*L_IR/1e10. 1 is the apropriate value for a Chambrier IMF. 1.7 is apropriate for a Salpeter IMF.
- scatterbool, optional
Toggles scattering on or off, default is on (True). Scatter is determined based on the fits provided.
- sig_scatterfloat, optional
The scatter in dex to add around the mean luminosity, linear mean is not preserved. The default is 0.4 based on the scatter found by DeLooze et al. 2014 for [CII]
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_niiarray
The assigned line luminosity in Lsun
- simim.galprops.line_fir.padmanabhan19(mass, redshift, m1=2.39e-05, b=0.49, n1=419000000000.0, a=1.79, scatter=False, sig_scatter=None, rng=Generator(PCG64) at 0x78410A44DFC0)
Compute CII luminosities based on the model of Padmanabhan et al. 2019.
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- redshiftfloat or array
The redshift of the halo(s)
- m1, b, n1, afloat
Model parameters (see Padmanabhan et al. 2019 equation 7). Defaults are the best fitting values, fits provided in P19 are m1 = (2.39 pm 1.86)E-5, b = 0.49 pm 0.38, N1 = (4.19 pm 3.27)E11, a = 1.79 pm 0.30
- scatterbool, optional
Toggles scattering on or off, default is off (False) as the P19 paper does not include it. If turned on, a lognormal scatter of width sig_scatter will be applied. The scatter is implemented so that the mean L_CII(M,z) is unchanged.
- sig_scatterfloat, optioal
If scatter is True, this is the width (in dex) of a lognormal distribution that will be used to apply scatter.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linefloat or array
The assigned line luminosities in Lsun
- simim.galprops.line_fir_yang.yang22(mass, redshift, line='CII', fduty=True, scatter=True, fix_scatter=None, rng=Generator(PCG64) at 0x78410A44DEE0)
Compute CII, CI, and CO luminosities based on the fits of Yang et al. 2022.
- Parameters:
- massfloat or array
The mass of the halo(s), in Msun
- redshiftfloat or array
The redshift of the halo(s)
- line: str
One of ‘CII’, ‘CI1-0’, ‘CI2-1’, ‘CO1-0’, ‘CO2-1’, ‘CO3-2’, ‘CO4-3’, ‘CO5-4’
- fdutybool, optional
Toggles duty fraction on or off, default is on (True)
- scatterbool, optional
Toggles scattering on or off, default is on (True)
- fix_scatterNone or float, optional
If scatter is True, the default behavior is to use the scatter from Yang et al. model to determine the width of the scatter applied. Alternatively the fix_scatter parameter can be set to a different scatter value. The value should be specified in dex.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- L_linefloat or array
The assigned line luminosities in Lsun
Star Formation Rates and Stellar Masses
- class simim.galprops.sfr_behroozi13.behroozi13_base(warn=False)
Class implementing the best fitting SFR(Mhalo) relation from Behroozi et al. 2013
Methods
plot_grid([prop])Plot the grid.
sfr(redshift, mass[, scatter, ...])Function to assign star formation rates based on the model from Behroozi et al. 2013.
stellarmass(redshift, mass[, scatter, ...])Function to assign stellar masses based on the model from Behroozi et al. 2013.
Initialize class - if running for the first time, this will set up and cache some files for interpolating within the value grid provided in the public data release from https://www.peterbehroozi.com/uploads/6/5/4/8/6548418/sfh_z0_z8.tar.gz
- Parameters:
- warnbool
Toggles whether a warning will be shown for masses or redshifts parameter range covered in the underlying data outside the default range
Methods
plot_grid([prop])Plot the grid.
sfr(redshift, mass[, scatter, ...])Function to assign star formation rates based on the model from Behroozi et al. 2013.
stellarmass(redshift, mass[, scatter, ...])Function to assign stellar masses based on the model from Behroozi et al. 2013.
- plot_grid(prop='sfr')
Plot the grid.
- Parameters:
- prop‘sfr’ or ‘stellar’
The property to show
- sfr(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44DD20)
Function to assign star formation rates based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- sfrfloat or array
The assigned SFRs in Msun/yr
- stellarmass(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E500)
Function to assign stellar masses based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- stellarfloat or array
The assigned stellar mass in Msun
- simim.galprops.sfr_behroozi13.sfr(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E6C0)
Function to assign star formation rates based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- sfrfloat or array
The assigned SFRs in Msun/yr
- simim.galprops.sfr_behroozi13.stellarmass(redshift, mass, scatter=True, sigma_scatter=0.3, rng=Generator(PCG64) at 0x78410A44E420)
Function to assign stellar masses based on the model from Behroozi et al. 2013.
- Parameters:
- redshiftfloat or array
The redshift(s) of the halo(s)
- massfloat or array
The mass(es) of the halo(s) in Msun
- scatterbool
If True, a lognormal scatter will be added around the mean SFR assigned. Default is True
- sigma_scatterfloat
The scatter, in dex, to add around the mean. Default is 0.3
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- stellarfloat or array
The assigned stellar mass in Msun
Helper Functions
- simim.galprops.log10normal.log10normal(x, dex, preserve_linear_mean=False, rng=Generator(PCG64) at 0x78410B478AC0)
Helper function for introducing a log normal scatter. Can be set to preserve linear mean if desired
- Parameters:
- xfloat or array
The linear mean of the distribution (the scatter will be added around log10(x)).
- dexfloat
The scale parameter for the distribution, in log10 units
- preserve_linear_meanbool, default=True
Determines whether the scatter should preserve the (linear) mean value or not.
- rngoptional, numpy.random.Generator object
Can be used to specify an rng, useful if you want to control the seed
- Returns:
- x_scatteredarray
The scattered values