Stellar populations

class jjmodel.populations.ColumnsIso[source]

Collection of methods to work with the columns of Padova, MIST, and BaSTI isochrones.

apply_IMF(imf, iso_masses, mass)[source]

Applies IMF to the isochrone mass column.

Parameters
  • imf (function(mass1,mass2)) -- IMF PDF function returning the probability to form a star with a mass between mass1 and mass2.

  • iso_masses (array-like) -- Mass column from the isochrone table.

  • mass (scalar) -- Total mass that was converted into stars of the chosen metallicity and age (this isochrone), \(\mathrm{M}_\odot\).

Returns

New column with the present-day surface number densities of the semi-(metallicity-age-mass) 'stellar assemblies', \(\mathrm{number \ pc}^{-2}\).

Return type

1d-array

column_namespace(photometric_system)[source]

Names of the useful isochrone columns to be extracted from the stellar library (or calculated from them).

Parameters

photometric_system (str) -- Name of the photometric system to be used. Valid names are: 'UBVRIplus', 'GaiaDR2_MAW', 'GaiaEDR3', 'UBVRIplus+GaiaDR2_MAW', 'UBVRIplus+GaiaEDR3', 'GaiaDR2_MAW+GaiaEDR3', 'UBVRIplus+GaiaDR2_MAW+GaiaEDR3'. For MIST isochrones 'UBVRIplus' is UBV(RI)c + 2MASS, for Padova 'UBVRIplus' is UBVRIJHK. For BaSTI, only 'GaiaEDR3' system is available.

Returns

Dictionary with column names.

Keys are:
  • 'all': list of all columns that will be eventually saved.

  • 'basic': list of columns independent from the chosen photometric system.

  • 'basic_short': same as 'basic', but only columns initially present in the isochrones.

  • 'phot': columns with photometry corresponding to the chosen photometric system).

Return type

dict

column_positions(mode, get, **kwargs)[source]

Gets position of columns in the isochrone tables.

Parameters
  • mode (str) -- Defines which set of isochrones is used, can be 'Padova', 'MIST', or 'BaSTI'.

  • get (list[str]) -- List names of the columns to be extracted from the isochrone tables.

  • printnames (boolean) -- Optional. If True, prints all useful columns available in the isochrones.

Returns

List of positions of the columns given in parameter get.

Return type

list

read_columns(mode, isochrone, columns, indices)[source]

Extracts columns from the isochrone tables.

Parameters
  • mode (str) -- Defines which set of isochrones is used, can be 'Padova', 'MIST', or 'BaSTI'.

  • isochrone (array) -- Isochrone table which has been read from the input directory.

  • columns (array-like) -- Names of the columns to be extracted from the isochrone.

  • indices (1d-array) -- Positions of the columns.

Returns

Isochrone columns with an age column in units of Gyr.

Return type

dict

sort_mass_column(iso)[source]

Reshuffles isochrone rows to order the mass column.

Parameters

iso (dict) -- Isochrone (output of read_columns).

Returns

Isochrone with the reshuffled rows, such that the column 'Mini' (initial mass) is ordered.

Return type

dict

jjmodel.populations.stellar_assemblies_iso(mode, photometric_system, met, age, mass, imf)[source]

Creates a table with the semi-(metallicity,age,mass) 'stellar assemblies'.

Parameters
  • mode (str) -- Defines which set of isochrones is used, can be 'Padova', 'MIST', or 'BaSTI'.

  • photometric_system (int) --

    Photometric system. Name of the photometric system to use, can be:

    • 1 = 'UBVRIplus' (UBVRIJHK - for Padova; UBV(RI)c+2MASS - for MIST),

    • 2 = 'GaiaDR2_MAW'

    • 3 = 'GaiaEDR3'

    • 4 = 'UBVRIplus + GaiaDR2_MAW'

    • 5 = 'UBVRIplus + GaiaEDR3'

    • 6 = 'GaiaDR2_MAW + GaiaEDR3'

    • 7 = 'UBVRIplus + GaiaDR2_MAW + GaiaEDR3'

    For BaSTI the only option at the moment is 3.

  • met (scalar) -- Metallicity [Fe/H].

  • age (scalar) -- Age (in case of the disk, age is linked to the metallicity via the AMR).

  • mass (scalar) -- Total mass that was converted into stars of the chosen metallicity and age (isochrone).

  • imf (function(mass1,mass2)) -- IMF PDF function returning the probability to form a star with a mass between mass1 and mass2.

Returns

Isochrone table for the given metallicity and age, with several additional columns.

Return type

dict

jjmodel.populations.stellar_assemblies_r(R, p, a, amrd, amrt, sfrd, sfrt, sigmash, imf, mode, photometric_system, **kwargs)[source]

Constructs a list of the semi-(metallicity,age,mass) 'stellar assemblies' at some given Galactocentric distance.

Parameters
  • R (scalar) -- Galactocentric distance, kpc.

  • p (namedtuple) -- Set of model parameters from the parameter file.

  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • amrd (array-like) -- Thin-disk AMR at this R (only metallicity column, without the corresponding time a.t).

  • amrt (array-like) -- Thick-disk AMR (again, only metallicity column).

  • sfrd (array-like) -- Thin-disk SFR at this R, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\).

  • sfrt (array-like) -- Thick-disk SFR at this R, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\).

  • sigmash (scalar) -- Present-day surface density of the stellar halo at this R, \(\mathrm{M_\odot \ pc^{-2}}\).

  • imf (function(mass1,mass2)) -- IMF PDF function returning the probability to form a star with a mass between mass1 and mass2.

  • mode (str) -- Defines which set of isochrones is used, can be 'Padova', 'MIST', or 'BaSTI'.

  • photometric_system (int) -- Photometric system to use, can be an integer value from 1 to 7. For the list of available systems see jjmodel.populations.stellar_assemblies_iso().

  • FeH_mean_sh (scalar) -- Optional, mean metallicity of the halo.

  • FeH_sigma_sh (scalar) -- Optional. Standard deviation of the Gaussian metallicity distribution of the halo.

  • Nmet_sh (int) -- Optional. Number of metallicity populations used to represent halo metallicity distribution.

  • FeH_scatter (scalar) -- Optional. Physical scatter in the thin- and thick-disk AMR, by default there is no scatter.

  • Nmet_dt (int) -- Number of metallicity populations used to represent the Gaussian distribution (FeH_scatter) around mean metallicities (the thin- and thick-disk AMR).

Returns

None. Saves the calculated tables to the output directory defined in the directory tree a.T.

class jjmodel.analysis.GetPopulations(mode_iso, R, p, a)[source]

Class for selecting different stellar populations on the color-magnitude diagram (CMD) and with applying cuts on physical stellar parameters.

__init__(mode_iso, R, p, a)[source]

Initialization of the class instance.

Parameters
  • mode_iso (str) -- Defines which set of isochrones is used, can be 'Padova', 'MIST', or 'BaSTI'.

  • R (scalar) -- Galactocentric distance, kpc.

  • p (namedtuple) -- Set of model parameters from the parameter file.

  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

a_stars(mode_comp, **kwargs)[source]

Selects A-type stars using cuts on T_eff: 7500 K < T_eff < 10000 K.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the A-type stellar population.

Return type

astropy table

cepheids_type1(mode_comp, **kwargs)[source]

Selects classical Cepheids. HB stars in the instability strip (IS) with masses in the range 4-20 \(\mathrm{M}_\odot\). IS adopted from De Somma et al. (2020)a (mixing length parameter = 1.5, canonical mass-luminosity relation), periods calculated according to De Somma et al. (2020)b. Dy default, these are the fundamental pulsators, but also the first obertone (FO) pulsators can be selected.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • FO -- Optional. If True, the first obertone pulsators are selected.

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the Cepheid type I population.

Return type

astropy table

custom_population(mode_comp, column_list, range_list, **kwargs)[source]

Allows to select stellar population using custom cuts on the columns of the stellar assemblies table.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • column_list (list[str]) -- List of column names for which the cuts will be applied.

  • range_list (list[list]) -- List with ranges of values [min,max] corresponding to the columns in column_list.

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory /pop/tab).

  • tabname (str) -- Name of the population. If not given, the table is saved with the default name 'custom_population'.

Returns

Selected population.

Return type

astropy table

f_stars(mode_comp, **kwargs)[source]

Selects F-type stars using cuts on T_eff: 6000 K < T_eff < 7500 K.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the F-type stellar population.

Return type

astropy table

g_dwarfs(mode_comp, **kwargs)[source]

Selects G-dwarfs using cuts on T_eff and logg: 5200 K < T_eff < 6000 K && 4.3 < logg < 7.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the G-dwarf population.

Return type

astropy table

k_dwarfs(mode_comp, **kwargs)[source]

Selects K-dwarfs using cuts on T_eff and logg: 3700 K < T_eff < 5200 K && 4.3 < logg < 7.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the K-dwarf population.

Return type

astropy table

m_dwarfs(mode_comp, **kwargs)[source]

Selects M-dwarfs using cuts on T_eff and logg: 2400 K < T_eff < 3700 K && 4 < logg < 7.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the M-dwarf population.

Return type

astropy table

rc_clean(mode_comp, **kwargs)[source]

Selects Red Clump (RC) population in the 3d parameter space {logT,logg,[Fe/H]}. This is a cleaner RC selection than the one given by jjmodel.analysis.GetPopulations.rc_simple() method.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • fig (boolean) -- Optional. If True, the selected RC sample is plotted in the 3d-space {logT,logg,[Fe/H]}.

  • close (boolean) -- Optional. If True, the figure is closed after plotting (active only if fig is True).

  • save (boolean) -- Optional. If True, the output table (and figure, if plotted) is (are) saved (to the output subdirectory pop/tab and pop/plt).

Returns

Table of the stellar assemblies which belong to the RC population.

Return type

astropy table

rc_simple(mode_comp, **kwargs)[source]

Selects Red Clump (RC) population using simple cuts on T_eff, logg and logL: 4250 K < T_eff < 5250 K && logg < 2.75 && 1.65 < logL < 1.85.

Parameters
  • mode_comp (str) -- Model component: 'd', 't', or 'sh' (thin disk, thick disk, or halo).

  • save (boolean) -- Optional. If True, the output table is saved (to the output subdirectory pop/tab).

Returns

Table of the stellar assemblies which belong to the RC population (contaminatated by HGB stars).

Return type

astropy table