SSP¶
- class artpop.stars.SSP(isochrone, num_stars=None, total_mass=None, distance=<Quantity 10. pc>, a_lam=0.0, mag_limit=None, mag_limit_band=None, imf='kroupa', imf_kw=None, mass_tolerance=0.01, add_remnants=True, random_state=None)[source]¶
Bases:
StellarPopulation
Generic Simple Stellar Population (SSP).
Note
You must give
total_mass
ornum_stars
.- Parameters
- isochrone
Isochrone
Isochrone object.
- num_starsint or
None
Number of stars in source. If
None
, then must givetotal_mass
.- total_massfloat or
Quantity
orNone
Stellar mass of the source. If
None
, then must givenum_stars
. This mass accounts for stellar remnants whenadd_remnants = True
, which means the actual sampled mass will be less than the given value. If float is given, the units are assumed to be solar masses.- distancefloat or
Quantity
, optional Distance to source. If float is given, the units are assumed to be
Mpc
. Default distance is 10pc
.- a_lamfloat or dict, optional
Magnitude(s) of extinction. If float, the same extinction will be applied to all bands. If dict, the keys must be the same as the observational filters.
- mag_limitfloat, optional
Only sample individual stars that are brighter than this magnitude. All fainter stars will be combined into an integrated component. Otherwise, all stars in the population will be sampled. You must also give the
mag_limit_band
if you use this parameter.- mag_limit_bandstr, optional
Bandpass of the limiting magnitude. You must give this parameter if you use the
mag_limit
parameter.- imfstr or dict
Which IMF to use, if str then must be one of pre-defined: ‘kroupa’, ‘scalo’ or ‘salpeter’. Can also specify custom (broken) power law as dict, which must contain either ‘a’ as a Float (describing the slope of a single power law) or ‘a’ (a list with 3 elements describing the slopes of a broken power law) and ‘b’ (a list with 2 elements describing the locations of the breaks).
- imf_kwdict, optional
Optional keyword arguments for sampling the stellar mass function.
- mass_tolerancefloat, optional
Tolerance in the fractional difference between the input mass and the final mass of the population. The parameter is only used when
total_mass
is given.- add_remnantsbool, optional
If True (default), apply scaling factor to total mass to account for stellar remnants in the form of white dwarfs, neutron stars, and black holes.
- random_state
None
, int, list of ints, orRandomState
If
None
, return theRandomState
singleton used bynumpy.random
. Ifint
, return a newRandomState
instance seeded with theint
. IfRandomState
, return it. Otherwise raiseValueError
.
- isochrone
Attributes Summary
Return extinction dictionary.
Absolute magnitudes in a
Table
object.The distance modulus.
Apparent magnitudes in a
Table
object.The number of simple stellar populations that composes this pop.
Number stars in population.
Total initial stellar mass in solar units.
Methods Summary
build_pop
([num_stars, total_mass, ...])Build the stellar population.
copy
()from_pickle
(file_name)Load pickle of stellar population object.
integrated_color
(blue, red[, select])Calculate the population's integrated color.
mag_integrated_component
(bandpass)Get the magnitude of the integrated component of the population if it exists.
mean_mag
(bandpass[, select])Calculate the population's mean magnitude.
sample_fraction
(mag_limit, mag_limit_band)Calculate the fraction of stars by mass and number that will be sampled with the give limiting magnitude.
sbf_mag
(bandpass)Calculate the apparent SBF magnitude of the stellar population.
set_distance
(distance)Change the distance to the stellar population.
star_mags
(bandpass[, select])Get the stellar apparent magnitudes.
to_pickle
(file_name)Pickle stellar population object.
total_mag
(bandpass[, select])Calculate the population's total magnitude.
Attributes Documentation
- a_lam¶
Return extinction dictionary.
- dist_mod¶
The distance modulus.
- num_pops¶
The number of simple stellar populations that composes this pop.
- num_stars¶
Number stars in population.
- total_initial_live_mass¶
Total initial stellar mass in solar units.
Methods Documentation
- build_pop(num_stars=None, total_mass=None, mass_tolerance=0.01, add_remnants=True)[source]¶
Build the stellar population. You must give
total_mass
ornum_stars
as an argument.- Parameters
- num_starsint or
None
Number of stars in source. If
None
, then must givetotal_mass
.- total_massfloat or
Quantity
orNone
Stellar mass of the source. If
None
, then must givenum_stars
. This mass accounts for stellar remnants whenadd_remnants = True
which means the actual sampled mass will be less than the given value. If float is given, the units are assumed to be solar masses.- mass_tolerancefloat, optional
Tolerance in the fractional difference between the input mass and the final mass of the population. The parameter is only used when
total_mass
is given.- add_remnantsbool, optional
If True (default), apply scaling factor to total mass to account for stellar remnants in the form of white dwarfs, neutron stars, and black holes.
- num_starsint or
- copy()¶
- static from_pickle(file_name)¶
Load pickle of stellar population object.
- integrated_color(blue, red, select=None)¶
Calculate the population’s integrated color.
- Parameters
- bluestr
The blue bandpass. Must be a filter in the given photometric system(s).
- redstr
The red bandpass. Must be a filter in the given photometric system(s).
- select
ndarray
, optional Boolean mask for selecting stars (True for stars to include).
- Returns
- colorfloat
The integrated color.
- mag_integrated_component(bandpass)¶
Get the magnitude of the integrated component of the population if it exists.
- Parameters
- bandpassstr
Filter of observation. Must be a filter in the given photometric system(s).
- Returns
- magfloat
The integrated magnitude if it exists. Otherwise None is returned.
- mean_mag(bandpass, select=None)¶
Calculate the population’s mean magnitude.
- Parameters
- bandpassstr
Filter of observation. Must be a filter in the given photometric system(s).
- select
ndarray
, optional Boolean mask for selecting stars (True for stars to include).
- Returns
- magfloat
The mean magnitude in the given bandpass.
- sample_fraction(mag_limit, mag_limit_band)[source]¶
Calculate the fraction of stars by mass and number that will be sampled with the give limiting magnitude.
- Parameters
- mag_limitfloat, optional
Only sample individual stars that are brighter than this magnitude.
- mag_limit_bandstr, optional
Bandpass of the limiting magnitude.
- Returns
- m_limfloat
Initial stellar mass associated with
mag_limit
.- f_num_sampledfloat
Fraction of stars that will be sampled by number.
- f_mass_sampledfloat
Fraction of stars that will be sampled by mass.
- sbf_mag(bandpass)¶
Calculate the apparent SBF magnitude of the stellar population.
- Parameters
- bandpassstr
Filter of observation. Must be a filter in the given photometric system(s).
- Returns
- mbarfloat
The apparent SBF magnitude of the stellar population in the given bandpass.
- set_distance(distance)¶
Change the distance to the stellar population.
- Parameters
- distancefloat or
Quantity
Distance to source. If float is given, the units are assumed to be
Mpc
.
- distancefloat or
- star_mags(bandpass, select=None)¶
Get the stellar apparent magnitudes.
- to_pickle(file_name)¶
Pickle stellar population object.
- total_mag(bandpass, select=None)¶
Calculate the population’s total magnitude.
- Parameters
- bandpassstr
Filter of observation. Must be a filter in the given photometric system(s).
- select
ndarray
, optional Boolean mask for selecting stars (True for stars to include).
- Returns
- magfloat
The total magnitude in the given bandpass.