Physical functions (input)¶
SFR, AVR, IMF, and AMR¶
-
class
jjmodel.funcs.AMR[source]¶ Collection of methods which are used to define age-metallicity relation (AMR) and work with metallicities in the model and data.
-
amrd_global_sj22(t, t01, t02, r1, r2, alpha_w, FeH_0, FeH_p)[source]¶ Thin-disk AMR from Sysoliatina and Just (2022), Eq. (22) and (23). All parameters must correspond to the same Galactocentric distance (but not necessarily to the Solar radius
p.Rsun).- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
t01 (scalar) -- Time-scale parameter of the first tanh term, Gyr.
t02 (scalar) -- Time-scale parameter of the second tanh term, Gyr.
r1 (scalar) -- Power index of the first tanh term.
r2 (scalar) -- Power index of the second tanh term.
FeH_0 (scalar) -- Initial metallicity of the thin disk.
FeH_p (scalar) -- Present-day metallicity of the thin disk.
- Returns
Metallicities of the thin-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrd_global_sj22_custom(t, R, p)[source]¶ Thin-disk AMR from Sysoliatina and Just (2022), Eq. (22) and (23), calculated for the specified Galactocentric distance. Extension of the local parameters to an arbitrary radius is done as explained in Table 2 in Sysoliatina and Just (2022).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
R (scalar) -- Galactocentric distance for which AMR has to be calculated, kpc. Note that the recommended range is 4-14 kpc (see the paper).
p (namedtuple) -- Set of model parameters from the parameter file.
- Returns
Metallicities of the thin-disk populations born at Galactic times t.
- Return type
float or ndarray
-
amrd_global_sj22_default(t, R, p)[source]¶ Thin-disk AMR from Sysoliatina and Just (2022), Eq. (22) and (23), calculated for the specified Galactocentric distance with the best parameters (Table 2).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
R (scalar) -- Galactocentric distance for which AMR has to be calculated, kpc. Note that the recommended range is 4-14 kpc (see the paper).
p (namedtuple) -- Set of model parameters from the parameter file.
- Returns
Metallicities of the local thin-disk populations born at Galactic times t.
- Return type
float or ndarray
-
amrd_jj10(t, tp, q, r, FeH_0, FeH_p)[source]¶ Thin-disk AMR from Just and Jahreiss (2010), Eq.(31).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
tp (scalar) -- Present-day age of the MW disk (present-day Galactic time), Gyr.
q (scalar) -- AMR parameter.
r (scalar) -- AMR power index.
FeH_0 (scalar) -- Initial metallicity of the thin disk in the Solar neighbourhood.
FeH_p (scalar) -- Present-day metallicity of the thin disk in the Solar neighbourhood.
- Returns
Metallicities of the local thin-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrd_jj10_default(t, **kwargs)[source]¶ Thin-disk AMR from Just and Jahreiss (2010), Eq.(31), calculated with the best parameters (model A).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
stretch (boolean) -- Optional. If True, an extended (relative to model A) time scale is used - a present-day MW disk age is set to tp = 13 Gyr. By default is False, tp = 12 Gyr, as in Just and Jahreiss (2010).
- Returns
Metallicities of the local thin-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrd_sj21(t, tp, q, r, FeH_0, FeH_p)[source]¶ Thin-disk AMR from Sysoliatina and Just (2021), Eq. (21) and (22).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
tp (scalar) -- Present-day age of the MW disk (present-day Galactic time), Gyr.
q (scalar) -- AMR parameter (impacts the function shape).
r (scalar) -- AMR power index.
FeH_0 (scalar) -- Initial metallicity of the thin disk in the Solar neighbourhood.
FeH_p (scalar) -- Present-day metallicity of the thin disk in the Solar neighbourhood.
- Returns
Metallicities of the local thin-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrd_sj21_default(t)[source]¶ Thin-disk AMR from Sysoliatina and Just (2021), Eq. (21) and (22), calculated with the best parameters (Table 3).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Metallicities of the local thin-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrr(p, a)[source]¶ Thin-disk AMR across the disk. If
p.fehkey=0, AMR is from Sysoliatina and Just (2021), and AMR parameters are assumed to be linear functions of Galactocentric distance (old version of the AMR generalization). Ifp.fehkey=1orp.fehkey=2, AMR and its extension approach are as in Sysoliatina and Just (2022). In case ofp.fehkey=1, parameters are taken from the parameter file (i.e., custom), and whenp.fehkey=2, parameters are default (best from Sysoliatina and Just 2022).- Parameters
p (namedtuple) -- Set of model parameters from the parameter file.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
- Returns
Thin-disk AMR calculated for the Galactocentric distances
a.R, array size is(a.Rbins,a.jd).- Return type
2d-array
-
amrt_sj21(t, t0, r, FeH_0, FeH_p)[source]¶ Thick-disk AMR from Sysoliatina and Just (2021), Eq. (21) and (22). Applicable to the Solar neighbourhood and other Galactocentric distances (AMR of the thick disk is assumed to be inpedended of radius).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
t0 (scalar) -- Time-scale parameter, Gyr.
r (scalar) -- Power index.
FeH_0 (scalar) -- Initial metallicity of the thick disk in the Solar neighbourhood.
FeH_p (scalar) -- Present-day metallicity of the thick disk in the Solar neighbourhood.
- Returns
Metallicities of the thick-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrt_sj21_default(t)[source]¶ Thick-disk AMR from Sysoliatina and Just (2021), Eq. (21) and (22), calculated with the best parameters (Table 3).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Metallicities of the thick-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrt_sj22(t, t0, r, FeH_0, FeH_p)[source]¶ Thick-disk AMR from Sysoliatina and Just (2021), Eq. (22) and (23). Difference from SJ21 is normalization (impact negligible).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
t0 (scalar) -- Time-scale parameter, Gyr.
r (scalar) -- Power index.
FeH_0 (scalar) -- Initial metallicity of the thick disk in the Solar neighbourhood.
FeH_p (scalar) -- Present-day metallicity of the thick disk in the Solar neighbourhood.
- Returns
Metallicities of the thick-disk populations born at Galactic times t.
- Return type
float or array-like
-
amrt_sj22_default(t)[source]¶ Thick-disk AMR from Sysoliatina and Just (2021), Eq. (22) and (23), calculated with the best parameters (Table 2). Independent of radius, applicable for Galactocentric distances R = 4-14 kpc.
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Metallicities of the local thick-disk populations born at Galactic times t.
- Return type
float or array-like
-
chemical_disks(tab, feh_br, alpha_br)[source]¶ Method used to separate two populations in \(\mathrm{[Fe/H]}\text{-}\mathrm{[{\alpha}/Fe]}\) plane. Shape of the separating border was chosed based on the APOGEE Red Clump data (may be not optimal for other data samples). Equation defining the border between high-\(\alpha\) and low-\(\alpha\) populations has the form: \(\mathrm{[\alpha/Fe]} = \mathrm{[\alpha/Fe]}_1, \ \text{if} \ \mathrm{[Fe/H]} < \mathrm{[Fe/H]}_1\), \(\mathrm{[\alpha/Fe]} = k \mathrm{[Fe/H]} + b, \ \text{if} \ \mathrm{[Fe/H]}_1 < \mathrm{[Fe/H]} < \mathrm{[Fe/H]}_2\), \(\mathrm{[\alpha/Fe]} = \mathrm{[\alpha/Fe]}_2, \ \text{if} \ \mathrm{[Fe/H]} > \mathrm{[Fe/H]}_2\)
- Parameters
tab (list[array-likes]) -- \(\mathrm{[Fe/H]}\) and \(\mathrm{[\alpha/Fe]}\) data columns.
feh_br (list) -- Break points \(\mathrm{[Fe/H]}_1\) and \(\mathrm{[Fe/H]}_2\).
alpha_br (list) -- Parameters \(\mathrm{[\alpha/Fe]}_1\) and \(\mathrm{[\alpha/Fe]}_2\).
- Returns
Arrays with indices of tab rows corresponding to the low- and high-\(\alpha\) populations.
- Return type
list[1d-array]
-
chemical_disks_mg(tab)[source]¶ Same as
jjmodel.funcs.AMR.chemical_disks(), but for \(\mathrm{[Fe/H]}\text{-}\mathrm{[Mg/Fe]}\) plane. Separating border is adapted for the RAVE DR5, may be not optimal for other data samples.- Parameters
tab (list[array-likes]) -- \(\mathrm{[Fe/H]}\) and \(\mathrm{[Mg/Fe]}\) data columns.
- Returns
Arrays with indices of tab rows corresponding to the low- and high-\(\alpha\) populations.
- Return type
list[1d-array]
-
chemical_disks_sj21(tab)[source]¶ Same as
jjmodel.funcs.AMR.chemical_disks(), but with the specified separating border location (for the APOGEE RC DR14). Can be not optimal for other data samples (also for other releases of the RC catalogue).- Parameters
tab (list[array-likes]) -- \(\mathrm{[Fe/H]}\) and \(\mathrm{[\alpha/Fe]}\) data columns.
- Returns
Arrays with indices of tab rows corresponding to the low- and high-\(\alpha\) populations.
- Return type
list[1d-array]
-
conv(x, k, b, sigma)[source]¶ Analytical convolution of the linear function \((k*x + b)\) with a Gaussian kernel. See Eq.(20) in Sysoliatina and Just (2022).
- Parameters
x (array-like) -- x-coordinates.
k (scalar) -- Slope of the linear function.
b (scalar) -- Intercept of the linear function.
sigma (scalar) -- Standard deviation of the kernel, same units as for x.
- Returns
y-coordinates of the convolution corresponding to x grid.
- Return type
1d-array
-
fe2z(FeH)[source]¶ Function to convert abundance \(\mathrm{[Fe/H]}\) into mass fraction of metals Z. Formulae are taken from Choi et al. (2016). The approach adopts a primordial helium abundance Yp = 0.249 (Planck Collaboration et al. 2015) determined by combining the Planck power spectra, Planck lensing, and a number of 'external data' such as baryonic acoustic oscillations. In the equations below, a linear enrichment law to the protosolar helium abundance, Y_protosolar = 0.2703 (Asplund et al.2009), is assumed.
- Parameters
FeH (scalar or array-like) -- Chemical abundance of metals, dex.
- Returns
Mass fraction of metals in a star.
- Return type
float or array-like
-
get_amr(fe_ax, nfe_cum, t_ax, nt_cum, a)[source]¶ Reconstructs AMR from a normalized cumulative metallicity distribution function (CMDF) and a normalized cumulative age distribution function (CADF). The first can be taken from some observational data, the latter is modeled. Both CMDF and CADF correspond to the same stellar population. See Sysoliatina and Just (2021) and Sysoliatina and Just (2022) for the approach description.
- Parameters
fe_ax (array-like) -- Bin centers of the CMDF metallicity grid, dex.
nfe_cum (array-like) -- CMDF y-values corresponding to fe_ax.
t_ax (array-like) -- Bin centers of CADF (Galactic time, not age!), Gyr. Length of t_ax does not need to be the same as of fe_ax.
nt_cum (array-like) -- CADF y-values corresponding to t_ax.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
- Returns
Metallicity as a function of Galactic time, array corresponds to the time array
a.t.- Return type
1d-array
-
get_convolved(x, ycum, sigma, y_linpart)[source]¶ Convolution of the normalized cumulative metallicity distribution function (CMDF) with a Gaussian kernel based on
jjmodel.funcs.AMR.conv(). Only the upper part of CMDF (ycum > 0.5) is convolved.- Parameters
x (array-like) -- x-coordinates of CMDF (centers of metallicity bins).
ycum (array-like) -- y-coordinates of CMDF corresponding to x.
sigma (scalar) -- Standard deviation of the kernel, same units as for x.
- Returns
y-coordinates of the convolved CMDF corresponding to x grid.
- Return type
1d-array
-
get_deconvolved(x, ycum, y_linpart)[source]¶ Reconstructs 'true' normalized cumulative metallicity distribution function (CMDF) assuming that the observed CMDF is a convolution of the 'true' distribution with a Gaussian kernel (e.g. related to observational errors). See Sysoliatina and Just (2021) and Sysoliatina and Just (2022) for details.
- Parameters
x (array-like) -- x-coordinates of CMDF (centers of metallicity bins).
ycum (array-like) -- y-coordinates of CMDF corresponding to x.
y_linpart (list[scalar]) -- y-values of the input CMDF giving the range where the distribution is approximately linear.
- Returns
Output is the list (ycum_deconvolved,ycum_convolved,sigma). ycum_deconvolved contains y-coordinates of the reconstructed 'true' CMDF. ycum_convolved is a convolution of ycum_deconvolved with a kernel with the standard deviation sigma. Should reasonably reproduce the input CMDF.
- Return type
list[1d-array,1d-array,float]
-
get_metcum(Rlim, zlim, tab, a, **kwargs)[source]¶ Calculates normalized cumulative metallicity distribution function (CMDF) from the data.
- Parameters
Rlim (list[scalar]) -- Range of Galactocentric distances, same units as for Galactocentric distance column R in the input data tab.
zlim (list[scalar]) -- Range of heights above the Galactic plane, same units as for column z in the input data tab.
tab (ndarray) -- Array of the shape (n,4), where n is an arbitrary length of all columns. Columns order is (R,D,z,Fe). R and D are Galactocentric and heliocentric distances (both in the same units, pc or kpc). z is distance from the Galactic plane (can be also just absolute value). Fe is metallicity.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
Dmax (scalar) -- Optional, maximal heliocentric distance, same units as in column D in tab.
- Returns
The output list consists of (FeH_bins, Ncum, Ncum_err, FeH_mean). FeH_bins is the metallicity grid with bin centers. Ncum contains CMDF y-values corresponding to FeH_bins. Ncum_err is a column of y-errors (Poisson noise in bins). FeH_mean is a mean metallicity of the selected sample.
- Return type
list[1d-array,1d-array,1d-array,float]
-
mass_loss(t, FeH)[source]¶ Mass loss for an arbitrary AMR (IMF is a four-slope broken power law from Sysoliatina and Just 2021).
- Parameters
t (array-like) -- Galactic time, Gyr.
FeH (array-like) -- Metallicity of stellar populations born at Galactic time t.
- Returns
Mass loss function (fraction in stars and remnants) as a function of time t.
- Return type
1d-array
-
mass_loss_jj10_default()[source]¶ Thin-disk mass loss function calculated with the Chempy code consistent with the three-slope broken power-law IMF from Rybizki and Just (2015) and AMR from Just and Jahreiss (2010). This mass loss function is close to the one used in Just and Jahreiss (2010).
- Returns
Mass loss as a function of Galactic time
a.t.- Return type
1d-array
-
mass_loss_sj21_default()[source]¶ Thin-disk mass loss function calculated with the Chempy code consistent with the four-slope broken power-law IMF and AMR from Sysoliatina and Just (2021).
- Returns
Thin-disk mass loss as a function of Galactic time
a.tand thick-disk mass loss as a function of Galactic timea.t[:a.jt].- Return type
list[1d-array]
-
z2fe(Z)[source]¶ Function to convert mass fraction of metals Z into abundance \(\mathrm{[Fe/H]}\). Formulae are taken from Choi et al. (2016). The approach adopts a primordial helium abundance Yp = 0.249 (Planck Collaboration et al. 2015) determined by combining the Planck power spectra, Planck lensing, and a number of 'external data' such as baryonic acoustic oscillations. In the equations below, a linear enrichment law to the protosolar helium abundance, Y_protosolar = 0.2703 (Asplund et al.2009), is assumed. Once Y is computed for a desired value of Z, X and \(\mathrm{[Fe/H]}\) is trivial to compute.
- Parameters
Z (scalar or array-like) -- Mass fraction of metals in a star.
- Returns
Chemical abundance of metals, dex.
- Return type
float or array-like
-
-
class
jjmodel.funcs.AVR[source]¶ Collection of methods to work with the age-velocity dispersion relation (AVR). Here velocity dispersion is \(\sigma_\mathrm{W}\), the vertical component.
-
avr_jj10(t, tp, sigma_e, tau0, alpha)[source]¶ Thin-disk AVR in the Solar neighbourhood as defined in Just and Jahreiss (2010).
- Parameters
t (float or array-like) -- Galactic time, Gyr.
tp (scalar) -- Present-day age of the MW disk (i.e., present-day Galactic time), Gyr.
sigma_e (float) -- AVR scaling factor, W-velocity dispersion of the oldest thin-disk stellar population in the Solar neighbourhood, \(\mathrm{km \ s^{-1}}\).
tau0 (scalar) -- AVR parameter, Gyr.
alpha (scalar) -- AVR power index.
- Returns
Present-day W-velocity dispersion of the thin-disk populations at time t, \(\mathrm{km \ s^{-1}}\).
- Return type
float or array-like
-
avr_jj10_default(t, **kwargs)[source]¶ Thin-disk AVR in the Solar neighbourhood as defined in Just and Jahreiss (2010) calculated with the best parameters (model A).
- Parameters
t (float or array-like) -- Galactic time, Gyr.
stretch (boolean) -- Optional. If True, uses an extended (relative to model A) time scale by setting a present-day age of the MW disk to tp = 13 Gyr. By default is False, tp = 12 Gyr, as in Just and Jahreiss (2010).
- Returns
Present-day W-velocity dispersion of the thin-disk populations at time t, \(\mathrm{km \ s^{-1}}\).
- Return type
float or array-like
-
-
class
jjmodel.funcs.IMF(mlow, mup)[source]¶ Class for defining the initial mass function (IMF).
-
BPL_4slopes(a0, a1, a2, a3, m1, m2, m3)[source]¶ A four-slope broken power-law (BPL) IMF.
- Parameters
a0 (scalar) -- First IMF slope.
a1 (scalar) -- Second IMF slope.
a2 (scalar) -- Third IMF slope.
a3 (scalar) -- Fourth IMF slope.
m1 (scalar) -- First break point (slopes a0-a1), \(\mathrm{M_\odot}\).
m2 (scalar) -- Second break point (slopes a1-a2), \(\mathrm{M_\odot}\).
m3 (scalar) -- Third break point (slopes a2-a3), \(\mathrm{M_\odot}\).
- Returns
Linear mass grid from mlow to mup (in \(\mathrm{M_\odot}\)) and probabilities corresponding to these mass intervals.
- Return type
2d-array
-
BPL_4slopes_rj15_default()[source]¶ A four-slope broken power-law (BPL) IMF from Rybizki and Just (2015) and Rybizki (2018) (
jjmodel.funcs.IMF.BPL_4slopes()) calculated with the best parameters.- Returns
Linear mass grid from mlow to mup (in \(\mathrm{M_\odot}\)) and probabilities corresponding to these mass intervals.
- Return type
2d-array
-
BPL_4slopes_sj21_default()[source]¶ A four-slope broken power law (BPL) IMF from Sysoliatina and Just (2021) (
jjmodel.funcs.IMF.BPL_4slopes()) calculated with the best parameters (MCMC1 run).- Returns
Linear mass grid from mlow to mup (in \(\mathrm{M_\odot}\)) and probabilities corresponding to these mass intervals.
- Return type
2d-array
-
Chabrier03()[source]¶ A lognormal + power-law IMF from Chabrier (2003).
- Returns
Linear mass grid from mlow to mup (in \(\mathrm{M_\odot}\)) and probabilities corresponding to these mass intervals.
- Return type
2d-array
-
KTG93()[source]¶ A three-slope broken power law (BPL) IMF from Kroupa et al. (1993).
- Returns
Linear mass grid from mlow to mup (in \(\mathrm{M_\odot}\)) and probabilities corresponding to these mass intervals.
- Return type
2d-array
-
__init__(mlow, mup)[source]¶ Class instance is initialized by two parameters.
- Parameters
mlow (scalar) -- Lower limit of the mass range, \(\mathrm{M_\odot}\).
mup (scalar) -- Upper limit of the mass range, \(\mathrm{M_\odot}\).
-
number_stars(mass1, mass2)[source]¶ Probability of a star to have mass in the given interval according to chosen IMF (yes, the method name is misleading, sorry). Should be called after the IMF definition (e.g.,
jjmodel.func.IMF.BPL_4slopes()).- Parameters
mass1 (scalar) -- Lower mass limit, \(\mathrm{M_\odot}\).
mass2 (scalar) -- Upper mass limit, \(\mathrm{M_\odot}\).
- Returns
Probability that stellar mass belongs to [mass1,**mass2**].
- Return type
scalar
-
-
class
jjmodel.funcs.SFR[source]¶ Class with definitions of the MW disk star formation rate (SFR) function.
-
__init__()[source]¶ Initialization includes reading several tables with the default mass loss functions, no parameters have to be specified.
-
sfrd_jj10(t, t0, t1, sigma, **kwargs)[source]¶ Thin-disk SFR equation as defined in Just and Jahreiss (2010) (model A).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
tp (scalar) -- Present-day age of the MW disk (i.e., present-day Galactic time), Gyr.
t0 (scalar) -- SFR parameter, Gyr.
t1 (scalar) -- SFR parameter, Gyr.
sigma (scalar) -- Midplane local present-day surface density of the thin disk, \(\mathrm{M_\odot \ pc^{-2}}\).
g (scalar or array-like) -- Optional, mass loss function (same length as t).
- Returns
Absolute and normalized SFR as functions of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
list[1d-array] or list[float]
-
sfrd_jj10_default(t)[source]¶ SFR equation from Just and Jahreiss (2010) (model A) (
jjmodel.funcs.SFR.sfrd_jj10()) calculated with the best parameters.- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
stretch (boolean) -- Optional. If True, uses an extended (relative to model A) time scale by setting a present-day age of the MW disk to tp = 13 Gyr. By default is False, tp = 12 Gyr, as in Just and Jahreiss (2010).
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
list[1d-array] or list[float]
-
sfrd_sj21(t, dzeta, eta, t1, t2, sigma, **kwargs)[source]¶ SFR of the thin disk as defined in Sysoliatina and Just (2021).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
dzeta (scalar) -- SFR power index.
eta (scalar) -- SFR power index.
t1 (scalar) -- Parameter defining the SFR initial time-point (by default, t1 = 0 Gyr, i.e., the thin disk starts to form without a delay).
t2 (scalar) -- Parameter controlling the SFR shape.
sigma (scalar) -- Midplane present-day thin-disk surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
g (scalar or array-like) -- Optional, mass loss function (same length as t).
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
list[1d-array] or list[float]
-
sfrd_sj21_mono_default(t)[source]¶ SFR of the thin disk, as defined in Sysoliatina and Just (2021) (
jjmodel.funcs.SFR.sfrd_sj21()) calculated with the best-fit parameters (model MCMC1).- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
list[1d-array] or list[float]
-
sfrd_sj21_multipeak(tp, tr, t, dzeta, eta, t1, t2, sigma, sigmap, tpk, dtp, **kwargs)[source]¶ SFR of the thin disk as defined in Sysoliatina and Just (2021) with any number of extra Gaussian peaks. Also, see Eqs. (7)-(10) in Sysoliatina and Just (2022).
- Parameters
tp (scalar) -- Present-day age of the MW disk (i.e., present-day Galactic time), Gyr.
tr (scalar) -- Time resolution of the model, Gyr.
t (scalar or array-like) -- Galactic time, Gyr.
dzeta (scalar) -- SFR power index.
eta (scalar) -- SFR power index.
t1 (scalar) -- Parameter defining the SFR initial time-point (by default, t1 = 0 Gyr, i.e., the thin disk starts to form without a delay).
t2 (scalar) -- Parameter controlling the SFR shape.
sigma (scalar) -- Midplane present-day thin-disk surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
sigmap (array-like) -- Amplitude-related parameter(s) of the additional Gaussian peak(s), \(\mathrm{M_\odot \ pc^{-2}}\).
tpk (array-like) -- Mean Galactic time(s) of the Gaussian peak(s), Gyr.
dtp (array-like) -- Dispersion(s) of the Gaussian peak(s), Gyr
g (array-like) -- Optional, mass loss function (same length as t).
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\), and ratio of the peaks' contributions to the total SFR. Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
[1d-array,1d-array,list[1d-array]] or [float,float,list[float]]
-
sfrd_sj21_multipeak_default(t)[source]¶ SFR of the thin disk as defined in Sysoliatina and Just (2021) with two extra Gaussian peaks (see
jjmodel.funcs.SFR.sfrd_sj21_multipeak()). Calculated with the best-fit parameters (model MCMC1).- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\), and ratio of the peaks' contributions to the total SFR. Normalization factor is the mean SFR (averaged over the whole time range of the disk evolution 0-tp Gyr).
- Return type
[1d-array,1d-array,list[1d-array]] or [float,float,list[float]]
-
sfrr(p, a, gd, gd0, gt)[source]¶ Thin- and thick-disk SFR as functions of Galactocentric distance.
- Parameters
p (namedtuple) -- Set of model parameters from the parameter file.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
gd (array-like) -- Thin-disk mass loss function at a function of
a.t, at the different Galactocentric distancesa.R.gd0 -- Local thin-disk mass loss function.
gt -- Thick-disk mass loss function corresponding to
a.tora.t[:a.jt]. Assumed to be the same for all distancesa.R.
- Returns
When
p.pkey=0(no extra peaks in the thin-disk SFR), the output has the following structure: ((SFRd,NSFRd,SFRd0,NSFRd0),(SFRt,NSFRt,SFRt0,NSFRt0),(SFRtot,NSFRtot,SFRtot0,NSFRtot0)). For the thin-disk, thick-disk, and total SFR calculated quantities are absolute and normalized star formation rate ata.R(array shapes(a.Rbins,a.jd)or(a.Rbins,a.jt)) and in the Solar neighbourhood. Ifp.pkey=1, the thin-disk part is (SFRd,NSFRd,Fp,SFRd0,NSFRd0,Fp0), where Fp and Fp0 are the relative contributions of the peaks to the total SFR at each radius and also locally.- Return type
list[list[1d-array]]
-
sfrt_sj21(t, gamma, beta, t1, t2, sigma, **kwargs)[source]¶ SFR of the thick disk as defined in Sysoliatina and Just (2021), Eq. (7)-(8).
- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
gamma (scalar) -- SFR power index.
beta (scalar) -- SFR exponential index.
t1 (scalar) -- Parameter defining the star formation rate at the initial time-point, t = 0 Gyr.
t2 (scalar) -- Parameter defining the final time-point of the thick-disk formation, Gyr.
sigma (scalar) -- Midplane present-day thick-disk surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
g (scalar or array-like) -- Optional, mass loss function (for the time range 0-t2 Gyr or 0-tp Gyr).
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the thick-disk evolution).
- Return type
list[1d-array] or list[float]
-
sfrt_sj21_default(t)[source]¶ Thick-disk SFR as defined in Sysoliatina and Just (2021) (
jjmodel.funcs.SFR.sfrt_sj21()) calculated with best parameters (model MCMC1).- Parameters
t (scalar or array-like) -- Galactic time, Gyr.
- Returns
Absolute and normalized SFR as a function of t, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Normalization factor is the mean SFR (averaged over the whole time range of the thick-disk evolution).
- Return type
list[1d-array] or list[float]
-
Radial structure¶
-
class
jjmodel.funcs.RadialDensity(Rsun, zsun, R)[source]¶ Radial density profiles of the different Galactic components.
-
__init__(Rsun, zsun, R)[source]¶ Class instance is initialized by three parameters.
- Parameters
Rsun (float) -- Solar Galactocentric distance, kpc.
zsun (float) -- Height of the Sun above the Galactic plane, pc.
R (float or array-like) -- Galactocentric distance(s) where density has to be calculated, kpc.
-
rho_disk(rho0, Rd, **kwargs)[source]¶ Midplane mass density of an exponential disk.
- Parameters
rho0 (scalar) -- Local mass density, \(\mathrm{M_\odot \ pc^{-3}}\).
Rd (scalar) -- Radial scale length of the disk, kpc.
R0 (scalar) -- Opional. Radius of the inner hole, kpc.
- Returns
Mass density of the disk calculated at the given Galactocentric distance(s) R, \(\mathrm{M_\odot \ pc^{-3}}\).
- Return type
float or array-like
-
rho_dm_halo(z, rho0, ah)[source]¶ 3d mass density of an isothermal dark matter (DM) sphere.
- Parameters
z (scalar) -- Height above the Galactic plane, kpc.
rho0 (scalar) -- Local mass density of the DM halo, \(\mathrm{M_\odot \ pc^{-3}}\).
ah (scalar) -- DM scaling parameter, kpc.
- Returns
DM halo mass density at the given z and R, \(\mathrm{M_\odot \ pc^{-3}}\).
- Return type
float or array-like
-
rho_stellar_halo(z, rho0, a_sh)[source]¶ 3d mass density of a spherical stellar halo. Flattening is ignored, profile is a power law, \({\rho}(R) \propto (R_\odot/R)^{-\alpha}\).
- Parameters
z (scalar) -- Height above the Galactic plane, kpc.
rho0 (scalar) -- Local mass density of the halo, \(\mathrm{M_\odot \ pc^{-3}}\).
a_sh (scalar) -- Slope of the halo profile (about -2.5, see Bland-Hawthorn 2016).
- Returns
Halo mass density at the given z and R, \(\mathrm{M_\odot \ pc^{-3}}\).
- Return type
float or array-like
-
sigma_disk(sigma0, Rd, **kwargs)[source]¶ Surface density of an exponential disk.
- Parameters
sigma0 (scalar) -- Local surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
Rd (scalar) -- Radial scale length of the disk, kpc.
R0 (scalar) -- Opional. Radius of the inner hole, kpc.
- Returns
Surface density of the disk calculated at the given Galactocentric distance(s) R, \(\mathrm{M_\odot \ pc^{-2}}\).
- Return type
float or array-like
-
sigma_dm_halo(zmax, sigma0, ah)[source]¶ Surface density of an isothermal dark matter (DM) sphere.
- Parameters
zmax (scalar) -- Maximal height above the Galactic plane, kpc. Up to this height DM mass density law will be integrated.
sigma0 (scalar) -- Local surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
ah (scalar) -- DM scaling parameter, kpc.
- Returns
DM halo surface density at Galactocentric distance(s) R (up to the height zmax), \(\mathrm{M_\odot \ pc^{-2}}\).
- Return type
float or array-like
-
sigma_stellar_halo(zmax, sigma0, a_sh)[source]¶ Surface density of a spherical stellar halo. Flattening is ignored, profile is a power law (see
jjmodel.RadialDensity.rho_stellar_halo()).- Parameters
zmax (scalar) -- Maximal height above the Galactic plane, kpc. Up to this height halo mass density law will be integrated.
sigma0 (scalar) -- Local surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
a_sh (scalar) -- Slope of the halo profile (about -2.5, see Bland-Hawthorn 2016).
- Returns
Halo surface density at the given Galactocentric distance(s) R (up to the height zmax), \(\mathrm{M_\odot \ pc^{-2}}\).
- Return type
float or array-like
-
-
class
jjmodel.funcs.RadialPotential(Rsun, R)[source]¶ Galactic potential in the midplane.
-
__init__(Rsun, R)[source]¶ Class instance is initialized by two parameters.
- Parameters
Rsun (float) -- Solar Galactocentric distance, kpc.
R (float or array-like) -- Galactocentric distance(s) where potential has to be calculated, kpc.
-
cored_iso_sphere(rho0, ah)[source]¶ Potential of a cored isothermal sphere.
- Parameters
rho0 (scalar) -- Local mass density, \(\mathrm{M_\odot \ pc^{-3}}\).
ah (scalar) -- Scaling parameter, kpc.
- Returns
Potential the given Galactocentric distance(s) R, \(\mathrm{m^2 \ s^{-2}}\).
- Return type
float or array-like
-
exp_disk(sigma0, Rd)[source]¶ Potential of a razor-thin exponential disk (via Bessel functions).
- Parameters
sigma0 (scalar) -- Local surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
Rd (scalar) -- Radial scale length of the disk, kpc.
- Returns
Potential of the disk at the given Galactocentric distance(s) R, \(\mathrm{m^2 \ s^{-2}}\).
- Return type
float or array-like
-
pow_law(rho0, alpha)[source]¶ Potential of a MW component with a power-law radial density profile, \({\rho}(R) \propto (R_\odot/R)^{\alpha}\).
- Parameters
rho0 (scalar) -- Local mass density, \(\mathrm{M_\odot \ pc^{-3}}\).
alpha (scalar) -- Power-law slope.
- Returns
Potential at the given Galactocentric distance(s) R, \(\mathrm{m^2 \ s^{-2}}\).
- Return type
float or array-like
-
-
class
jjmodel.funcs.RotCurve(Rsun, R)[source]¶ Circular velocity as a function of Galactocentric distance as follows from the assumed density laws for the MW components.
-
__init__(Rsun, R)[source]¶ Class instance is initialized by two parameters.
- Parameters
Rsun (float) -- Solar Galactocentric distance, kpc.
R (float or array-like) -- Galactocentric distance(s) where circular velocity has to be calculated, kpc.
-
vc0(vc_tot)[source]¶ Calculates total circular velocity \({\upsilon}_\mathrm{c}\) at the Solar radius,
p.Rsun.- Parameters
vc_tot (array-like) -- Total circular velocity at the given Galactocentric distance(s) R. Note that this method is only useful when R is an array and covers Solar neighbourhood with a decent resolution.
- Returns
Local circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar
-
vc_bulge(Mb)[source]¶ Rotation curve of a point-mass bulge.
- Parameters
Mb (scalar) -- Mass of the bulge, \(\mathrm{M_\odot}\).
- Returns
Circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar or array-like
-
vc_disk(sigma0, Rd, R0)[source]¶ Rotation curve of an infinitely thin exponential disk (Eq. 2-169 in Binney and Tremaine).
- Parameters
sigma0 (scalar) -- Local surface density, \(\mathrm{M_\odot \ pc^{-2}}\).
Rd (scalar) -- Radial scale length of the disk, kpc.
R0 (scalar) -- Radius of the inner hole in the disk density profile, kpc.
- Returns
Circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar or array-like
-
vc_halo_cored_iso_sphere(rho0, ah)[source]¶ Rotation curve of dark matter (DM) halo, which is a cored isothermal sphere.
- Parameters
rho0 (scalar) -- Local DM mass density, \(\mathrm{M_\odot \ pc^{-3}}\).
ah (scalar) -- Scaling parameter, kpc.
- Returns
Circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar or array-like
-
vc_halo_nfw(rho0, ah)[source]¶ Rotation curve of dark matter (DM) halo with NWF profile.
- Parameters
rho0 (scalar) -- Local DM mass density, \(\mathrm{M_\odot \ pc^{-3}}\).
ah (scalar) -- Scaling parameter, kpc.
- Returns
Circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar or array-like
-
vc_tot(vc_array)[source]¶ Total rotation curve as quadratic sum of all velocity components.
- Parameters
vc_array (array-like (list or list[list])) -- \({\upsilon}_\mathrm{c}\) components at distance(s) R. Output units are the same as for the input velocities.
- Returns
Circular velocity corresponding to R, \(\mathrm{km \ s^{-1}}\).
- Return type
scalar or array-like
-
-
jjmodel.funcs.hgr(p, a)[source]¶ Scale heights of the atomic and molecular gas components as functions of Galactocentric distance. Data are taken from Nakanishi and Sofue (2016).
- Parameters
p (namedtuple) -- Set of model parameters from the parameter file.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
- Returns
((hg1,hg10),(hg2,hg20)), indices 1 and 2 correspond to molecular and atomic gas, respectively. Gas scale heights (pc) at Galactocentric distances
a.Rand at the Solar radiusp.Rsun.- Return type
((1d-array,float),(1d-array,float))
-
jjmodel.funcs.heffr(p, a, heffd0)[source]¶ Thin-disk half-thickness as a function of Galactocentric distance.
- Parameters
p (namedtuple) -- Set of model parameters from the parameter file.
a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.
heffd0 (scalar) -- Thin-disk half-thickness at the Solar radius
p.Rsun.
- Returns
Thin-disk half-thickness calculated at Galactocentric distances
a.R, pc.- Return type
1d-array
Some physical quantities¶
-
jjmodel.funcs.log_surface_gravity(Mf, L, Teff)[source]¶ Function for calculation of surface gravity.
- Parameters
Mf (scalar or array-like) -- Stellar mass (present-day mass in isochrones), \(\mathrm{M}_\odot\).
L (scalar or array-like) -- Stellar luminosity, \(\mathrm{L}_\odot\).
Teff (scalar or array-like) -- Effective temperature, K.
- Returns
Log surface gravity, \(\mathrm{log(cm \ s^{-2})}\).
- Return type
scalar or array-like