Stellar Model#
Available stellar models in Lightning are based on the PEGASE and BPASS spectral population synthesis codes;
models with the A24 suffix include a nebular component generated from custom Cloudy simulations run by Amirnezam Amiri
in 2024 (hence, A24). The PEGASEModel class is the same set of stellar population models used in IDL Lightning,
with a Kroupa IMF and Z = 0.001-0.1
- class lightning.stellar.PEGASEModel#
Bases:
BaseEmissionModelStellar emission models generated using Pégase.
These models are either:
A single burst of star formation at 1 solar mass yr-1, evaluated on a grid of specified ages
A binned stellar population, representing a constant epoch of star formation in a specified set of stellar age bins. These models are integrated from the above.
Nebular extinction + continuum are included by default, lines are optional, added by hand.
- Parameters:
- filter_labelslist, str
List of filter labels.
- redshiftfloat
Redshift of the model.
- agenp.ndarray, (Nsteps + 1,) or (Nages,), float
Either the bounds of
Nstepsage bins for a piecewise-constant SFH model, orNagesstellar ages for a continuous SFH model.- stepbool
If
True,ageis interpreted as age bounds for a piecewise-constant SFH model. Otherwiseageis interpreted as the age grid for a continuous SFH.- add_linesbool
If
True, emission lines are added to the spectral models at ages< 1e7yr.- wave_gridnp.ndarray, (Nwave,), float, optional
If set, the spectra are interpreted to this wavelength grid.
- Attributes:
- filter_labels
- redshift
- age
- step
- metallicity
- mstarnp.ndarray, (Nages,), float
Surviving stellar mass as a function of age.
- Lbolnp.ndarray, (Nages,), float
Bolometric luminosity as a function of age.
- q0np.ndarray, (Nages,), float
Lyman-continuum photon production rate (yr-1) as a function of age.
- wave_grid_restnp.ndarray, (Nwave,), float
Rest-frame wavelength grid.
- wave_grid_obs
- nu_grid_rest
- nu_grid_obs
- Lnu_obsnp.ndarray, (Nages, Nwave), float
(1 + redshift)times the rest-frame spectral model, as a function of age.
Methods
get_model_lines(sfh, sfh_param, params[, ...])Get the integrated luminosity of all the lines available to the nebular model.
get_model_lnu(sfh, sfh_param, params[, ...])Construct the stellar SED as observed in the given filters.
get_model_lnu_hires(sfh, sfh_param, params)Construct the high-res stellar spectrum.
Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- get_model_lines(sfh, sfh_param, params, stepwise=False)#
Get the integrated luminosity of all the lines available to the nebular model.
See self.line_names for a full list of lines. In the future we’ll need to redden these lines to compare them to the observed lines, such that our line attenuation is consistent with the attenuation of the stellar population model broadly.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for Z.
- stepwisebool
If true, the lines are returned as a function of stellar age.
- Returns:
- Lmod_linesnp.ndarray, (Nmodels, Nlines) or (Nmodels, Nages, Nlines)
Integrated line luminosities, optionally as a function of age.
- get_model_lnu(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the stellar SED as observed in the given filters.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed and convolved with the filters. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsNone
Empty placeholder for compatibility.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_model_lnu_hires(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the high-res stellar spectrum.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsNone
Empty placeholder for compatibility.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_mstar_coeff(Z)#
Return the Mstar coefficients as a function of age for a given metallicity.
- Parameters:
- Zarray-like (Nmodels,)
Stellar metallicity
- Returns:
- Mstar(Nmodels, Nages)
Surviving stellar mass as function of age per 1 Msun yr-1 of SFR.
- class lightning.stellar.PEGASEModelA24#
Bases:
BaseEmissionModelStellar emission models generated using PEGASE, including nebular emission calculated with Cloudy using a custom recipe with an ionization bounded nebula and an open geometry. See the README in the models folder for an outline of the Cloudy setup and links to more detailed documentation.
These models are either:
A single burst of star formation at 1 solar mass yr-1, evaluated on a grid of specified ages
A binned stellar population, representing a constant epoch of star formation in a specified set of stellar age bins. These models are integrated from the above.
Nebular extinction, lines, and continuum are included by default.
- Parameters:
- filter_labelslist, str
List of filter labels.
- redshiftfloat
Redshift of the model.
- agenp.ndarray, (Nsteps + 1,) or (Nages,), float
Either the bounds of
Nstepsage bins for a piecewise-constant SFH model, orNagesstellar ages for a continuous SFH model.- stepbool
If
True,ageis interpreted as age bounds for a piecewise-constant SFH model. Otherwiseageis interpreted as the age grid for a continuous SFH.- binariesbool
If
True, the spectra include the effects of binary stellar evolution. IfFalse, the nebular model cannot be applied.- nebular_effectsbool
If
True, the spectra will include nebular extinction, continua, and lines.- line_labelsnp.ndarray, (Nlines,), string, optional
Line labels in the format used by pyCloudy. See lightning/models/linelist_full.txt for the complete list of lines in the grid and their format.
- dust_grainsbool
If
True, then dust grains are included in the Cloudy grids. (Default: False)- wave_gridnp.ndarray, (Nwave,), float, optional
If set, the spectra are interpreted to this wavelength grid.
- Attributes:
- filter_labels
- redshift
- age
- step
- metallicity
- mstarnp.ndarray, (Nages,), float
Surviving stellar mass as a function of age.
- Lbolnp.ndarray, (Nages,), float
Bolometric luminosity as a function of age.
- q0np.ndarray, (Nages,), float
Lyman-continuum photon production rate (yr-1) as a function of age.
- wave_grid_restnp.ndarray, (Nwave,), float
Rest-frame wavelength grid.
- wave_grid_obs
- nu_grid_rest
- nu_grid_obs
- Lnu_obsnp.ndarray, (Nages, Nwave), float
(1 + redshift)times the rest-frame spectral model, as a function of age.
Methods
get_model_lines(sfh, sfh_param, params[, ...])Get the integrated luminosity of all the lines available to the nebular model.
get_model_lnu(sfh, sfh_param[, params, ...])Construct the stellar SED as observed in the given filters.
get_model_lnu_hires(sfh, sfh_param, params)Construct the high-res stellar spectrum.
Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- get_model_lines(sfh, sfh_param, params, exptau=None, stepwise=False)#
Get the integrated luminosity of all the lines available to the nebular model.
See self.line_names for a full list of lines. In the future we’ll need to redden these lines to compare them to the observed lines, such that our line attenuation is consistent with the attenuation of the stellar population model broadly.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 2)
Values for Z and logU.
- stepwisebool
If true, the lines are returned as a function of stellar age.
- Returns:
- Lmod_linesnp.ndarray, (Nmodels, Nlines) or (Nmodels, Nages, Nlines)
Integrated line luminosities, optionally as a function of age.
- get_model_lnu(sfh, sfh_param, params=None, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the stellar SED as observed in the given filters.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed and convolved with the filters. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_model_lnu_hires(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the high-res stellar spectrum.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_mstar_coeff(Z)#
Return the Mstar coefficients as a function of age for a given metallicity.
- Parameters:
- Zarray-like (Nmodels,)
Stellar metallicity
- Returns:
- Mstar(Nmodels, Nages)
Surviving stellar mass as function of age per 1 Msun yr-1 of SFR.
- class lightning.stellar.PEGASEBurstA24#
Bases:
PEGASEModelA24SFH-free model representing a single instantaneous burst of star formation with a given mass and age.
Methods
get_model_lines(params[, exptau])get_model_lnu(params[, exptau])get_model_lnu_hires(params[, exptau])get_mstar_coeff(Z)Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- __init__(filter_labels, redshift, wave_grid=None, age=None, lognH=2.0, cosmology=None, line_labels=None, dust_grains=False)#
Generic initialization. Actual model-building should be handled by implementing the construct_model and construct_model_grid methods.
- get_model_lines(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau). Currently unused, i.e. line luminosities returned are intrinsic, unreddened.
- Returns:
- lmod_lines
- get_model_lnu(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau)
- Returns:
- lmod_unattenuated
- lmod_unattenuated
- L_TIR
- get_model_lnu_hires(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau)
- Returns:
- lnu_unattenuated
- lnu_unattenuated
- L_TIR
- class lightning.stellar.BPASSModel#
Bases:
BaseEmissionModelStellar emission models generated using BPASS, including nebular emission calculated with Cloudy, as generated by the BPASS team. See the README in the models folder for an outline of the Cloudy setup and links to more detailed documentation. For the custom BPASS+Cloudy models used in e.g. Lehmer+(2024), see
BPASSModelA24.These models are either:
A single burst of star formation at 1 solar mass yr-1, evaluated on a grid of specified ages
A binned stellar population, representing a constant epoch of star formation in a specified set of stellar age bins. These models are integrated from the above.
Nebular extinction, lines, and continuum are included by default. IMF is only ‘imf_135_300’; a Kroupa-like two-slope IMF with an upper mass cutoff at 300 Msun.
- Parameters:
- filter_labelslist, str
List of filter labels.
- redshiftfloat
Redshift of the model.
- agenp.ndarray, (Nsteps + 1,) or (Nages,), float
Either the bounds of
Nstepsage bins for a piecewise-constant SFH model, orNagesstellar ages for a continuous SFH model.- stepbool
If
True,ageis interpreted as age bounds for a piecewise-constant SFH model. Otherwiseageis interpreted as the age grid for a continuous SFH.- binariesbool
If
True, the spectra include the effects of binary stellar evolution. IfFalse, the nebular model cannot be applied (and as a result thedust_grainsswitch has no effect).- nebular_effectsbool
If
True, the spectra at ages <1e7.5 years will include nebular extinction, continua, and lines.- dust_grainsbool
If
True, the Cloudy models include the effects of dust grain depletion. This option has no effect unlessnebular_effectsis True. By default, we set this option toFalse, for parity with the treatment of nebular emission in the Pégase stellar population models.- wave_gridnp.ndarray, (Nwave,), float, optional
If set, the spectra are interpreted to this wavelength grid.
- Attributes:
- filter_labels
- redshift
- age
- step
- metallicity
- mstarnp.ndarray, (Nages,), float
Surviving stellar mass as a function of age.
- Lbolnp.ndarray, (Nages,), float
Bolometric luminosity as a function of age.
- q0np.ndarray, (Nages,), float
Lyman-continuum photon production rate (yr-1) as a function of age.
- wave_grid_restnp.ndarray, (Nwave,), float
Rest-frame wavelength grid.
- wave_grid_obs
- nu_grid_rest
- nu_grid_obs
- Lnu_obsnp.ndarray, (Nages, Nwave), float
(1 + redshift)times the rest-frame spectral model, as a function of age.
Methods
get_model_lines(sfh, sfh_param, params[, ...])Get the integrated luminosity of all the lines available to the nebular model.
get_model_lnu(sfh, sfh_param, params[, ...])Construct the stellar SED as observed in the given filters.
get_model_lnu_hires(sfh, sfh_param, params)Construct the high-res stellar spectrum.
Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- get_model_lines(sfh, sfh_param, params, stepwise=False)#
Get the integrated luminosity of all the lines available to the nebular model.
See self.line_names for a full list of lines. In the future we’ll need to redden these lines to compare them to the observed lines, such that our line attenuation is consistent with the attenuation of the stellar population model broadly.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 2)
Values for Z and logU.
- stepwisebool
If true, the lines are returned as a function of stellar age.
- Returns:
- Lmod_linesnp.ndarray, (Nmodels, Nlines) or (Nmodels, Nages, Nlines)
Integrated line luminosities, optionally as a function of age.
- get_model_lnu(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the stellar SED as observed in the given filters.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed and convolved with the filters. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_model_lnu_hires(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the high-res stellar spectrum.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_mstar_coeff(Z)#
Return the Mstar coefficients as a function of age for a given metallicity.
- Parameters:
- Zarray-like (Nmodels,)
Stellar metallicity
- Returns:
- Mstar(Nmodels, Nages)
Surviving stellar mass as function of age per 1 Msun yr-1 of SFR.
- class lightning.stellar.BPASSModelA24#
Bases:
BaseEmissionModelStellar emission models generated using BPASS, including nebular emission calculated with Cloudy using a custom recipe with an ionization bounded nebula and an open geometry. See the README in the models folder for an outline of the Cloudy setup and links to more detailed documentation.
These models are either:
A single burst of star formation at 1 solar mass yr-1, evaluated on a grid of specified ages
A binned stellar population, representing a constant epoch of star formation in a specified set of stellar age bins. These models are integrated from the above.
Nebular extinction, lines, and continuum are included by default. IMF is Chabrier by default, with high mass cutoff at 300 Msun (chab300). If the grids based on the SSP+ULX SED files from Garofali+(2024) are selected, the IMF is instead ‘imf_135_100’, a Kroupa-like two-slope IMF with a high mass cutoff at 100 Msun.
- Parameters:
- filter_labelslist, str
List of filter labels.
- redshiftfloat
Redshift of the model.
- agenp.ndarray, (Nsteps + 1,) or (Nages,), float
Either the bounds of
Nstepsage bins for a piecewise-constant SFH model, orNagesstellar ages for a continuous SFH model.- stepbool
If
True,ageis interpreted as age bounds for a piecewise-constant SFH model. Otherwiseageis interpreted as the age grid for a continuous SFH.- binariesbool
If
True, the spectra include the effects of binary stellar evolution. IfFalse, the nebular model cannot be applied.- ULXbool
If
True, the spectra loaded will be the SXP+SSP models from Garofali+(2024), postprocessed with Cloudy following the same recipe as we typically adopt (seelightning_models/models/BPASS_Cloudy/README.md). Note that this fixes the IMF to the BPASS imf_135_100 adopted in Garofali+. Note that this model doesn’t extend fully to the X-rays yet, it just modifies the line emission due to the considerably larger Q(He II).- nebular_effectsbool
If
True, the spectra will include nebular extinction, continua, and lines.- line_labelsnp.ndarray, (Nlines,), string, optional
Line labels in the format used by pyCloudy. See lightning/models/linelist_full.txt for the complete list of lines in the grid and their format.
- nebula_oldbool
If
True, the spectra will include nebular extinction and emission at ages older than 50 Myr, modeling the nebular contributions of the hot, stripped cores of evolved massive stars. While the the conditions we assume for the nebula are most appropriate for massive H II regions, Byler+(2017) found that nebular emission from post-AGB stars is not super sensitive to the geometry/density of the nebula, but it may be worth fitting your galaxies with and without this component if you’re concerned.- dust_grainsbool
If
True, then dust grains are included in the Cloudy grids. (Default: False)- wave_gridnp.ndarray, (Nwave,), float, optional
If set, the spectra are interpreted to this wavelength grid.
- Attributes:
- filter_labels
- redshift
- age
- step
- metallicity
- mstarnp.ndarray, (Nages,), float
Surviving stellar mass as a function of age.
- Lbolnp.ndarray, (Nages,), float
Bolometric luminosity as a function of age.
- q0np.ndarray, (Nages,), float
Lyman-continuum photon production rate (yr-1) as a function of age.
- wave_grid_restnp.ndarray, (Nwave,), float
Rest-frame wavelength grid.
- wave_grid_obs
- nu_grid_rest
- nu_grid_obs
- Lnu_obsnp.ndarray, (Nages, Nwave), float
(1 + redshift)times the rest-frame spectral model, as a function of age.
Methods
get_model_lines(sfh, sfh_param, params[, ...])Get the integrated luminosity of all the lines available to the nebular model.
get_model_lnu(sfh, sfh_param[, params, ...])Construct the stellar SED as observed in the given filters.
get_model_lnu_hires(sfh, sfh_param, params)Construct the high-res stellar spectrum.
Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- get_model_lines(sfh, sfh_param, params, exptau=None, stepwise=False)#
Get the integrated luminosity of all the lines available to the nebular model.
See self.line_names for a full list of lines. In the future we’ll need to redden these lines to compare them to the observed lines, such that our line attenuation is consistent with the attenuation of the stellar population model broadly.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for Z and logU
- stepwisebool
If true, the lines are returned as a function of stellar age.
- Returns:
- Lmod_linesnp.ndarray, (Nmodels, Nlines) or (Nmodels, Nages, Nlines)
Integrated line luminosities, optionally as a function of age.
- get_model_lnu(sfh, sfh_param, params=None, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the stellar SED as observed in the given filters.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed and convolved with the filters. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nfilters), (Nmodels, Nages, Nfilters), or (Nfilters,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_model_lnu_hires(sfh, sfh_param, params, exptau=None, exptau_youngest=None, stepwise=False)#
Construct the high-res stellar spectrum.
Given a SFH instance and set of parameters, the corresponding high-resolution spectrum is constructed. Optionally, attenuation is applied and the attenuated power is returned.
- Parameters:
- sfhinstance of lightning.sfh.PiecewiseConstSFH or lightning.sfh.FunctionalSFH
Star formation history model.
- sfh_paramsnp.ndarray, (Nmodels, Nparam) or (Nparam,), float32
Parameters for the star formation history.
- paramsnp.ndarray, (Nmodels, 1) or (Nmodels,)
Values for logU, if the model includes a nebular component.
- exptaunp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
exp(-tau)as a function of wavelength. If this is 2D, the size of the first dimension must match the size of the first dimension ofsfh_params.- exptau_youngestnp.ndarray, (Nmodels, Nwave) or (Nwave,), float32
This doesn’t do anything at the moment, until I figure out how to flexibly decide which ages to apply the birth cloud attenuation to.
- stepwisebool
If true, the spectrum is returned as a function of stellar age.
- Returns:
- lnu_attenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The stellar spectrum as seen after the application of the ISM dust attenuation model.
- lnu_unattenuatednp.ndarray, (Nmodels, Nwave), (Nmodels, Nages, Nwave), or (Nwave,), float32
The intrinsic stellar spectrum.
- L_TIRnp.ndarray, (Nmodels,) or (Nmodels, Nages)
The total attenuated power of the stellar population.
- get_mstar_coeff(Z)#
Return the Mstar coefficients as a function of age for a given metallicity.
- Parameters:
- Zarray-like (Nmodels,)
Stellar metallicity
- Returns:
- Mstar(Nmodels, Nages)
Surviving stellar mass as function of age per 1 Msun yr-1 of SFR.
- class lightning.stellar.BPASSBurstA24#
Bases:
BPASSModelA24SFH-free model representing a single instantaneous burst of star formation with a given mass and age.
Methods
get_model_lines(params[, exptau])get_model_lnu(params[, exptau])get_model_lnu_hires(params[, exptau])get_mstar_coeff(Z)Return the Mstar coefficients as a function of age for a given metallicity.
print_params([verbose])If verbose, print a nicely formatted table of the models, their parameters, and the description of the parameters.
- __init__(filter_labels, redshift, wave_grid=None, age=None, lognH=2.0, cosmology=None, line_labels=None, dust_grains=False, nebula_old=False, ULX=False)#
Generic initialization. Actual model-building should be handled by implementing the construct_model and construct_model_grid methods.
- get_model_lines(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau).
- Returns:
- lmod_lines
- get_model_lnu(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau)
- Returns:
- lmod_unattenuated
- lmod_unattenuated
- L_TIR
- get_model_lnu_hires(params, exptau=None)#
- Parameters:
- paramsarray-like (Nmodels, 4)
The parameters are, in order, Mburst, tburst, Z, and logU. In practice we’ll probably sample log(Mburst) and log(tburst).
- exptauarray-like (Nmodels, Nwave)
Attenuation curve(s) evaluated at model wavelengths; really it’s exp(-tau)
- Returns:
- lnu_unattenuated
- lnu_unattenuated
- L_TIR