API Reference

Utilities

BolometricCorrections.MbolMethod
Mbol(logL::Number, solmbol::Number=4.74)

Returns the bolometric magnitude corresponding to the provided logarithmic bolometric luminosity logL which is provided in units of solar luminosities (e.g., logL = log10(L / L⊙)). This is given by Mbol⊙ - 2.5 * logL; the zeropoint of bolometric magnitude scale is defined by the solar bolometric magnitude, which you can specify as the second argument. The default (4.74) was recommended by IAU Resolution B2.

source
BolometricCorrections.logLMethod
logL(Mbol::Number, solmbol::Number=4.74)

Returns the logarithmic bolometric luminosity in units of solar luminosities (e.g., logL = log10(L / L⊙)) corresponding to the provided bolometric magnitude. This is given by (Mbol⊙ - Mbol) / 2.5; the zeropoint of bolometric magnitude scale is defined by the solar bolometric magnitude, which you can specify as the second argument. The default (4.74) was recommended by IAU Resolution B2.

source
BolometricCorrections.radiusFunction
radius(Teff::Number, logL::Number)

Returns the radius of a star in units of solar radii given its effective temperature Teff in Kelvin and the logarithm of its luminosity in units of solar luminosities (e.g., logL = log10(L / L⊙)).

Assumes solar properties following IAU 2015 Resolution B3.

julia> isapprox(BolometricCorrections.radius(5772, 0.0), 1.0; rtol=0.001) # For solar Teff and logL, radius ≈ 1
true
source
BolometricCorrections.surface_gravityFunction
surface_gravity(M, R)

Returns the surface gravity of a star in cgs units cm / s^2 given its mass in solar masses and radius in solar radii.

Assumes solar properties following IAU 2015 Resolution B3.

julia> isapprox(BolometricCorrections.surface_gravity(1, 1), 27420; rtol=0.001) # For solar M and R, g ≈ 27430 cm / s^2
true
source

BC Grid API

BolometricCorrections.AbstractBCGridType

AbstractBCGrid{T <: Real} is the abstract supertype for all bolometric correction grids. T is the data type to use internally and is returned by eltype. Generally, concrete subtypes should be callable with population properties (e.g., metallicity, reddening, etc.) to interpolate the full grid to these properties, returning a concrete subtype of BolometricCorrections.AbstractBCTable. As different grids will have different population properties available (e.g., some support different α-element abundances in addition to total metallicity), the call signature to interpolate the grid is specific for each concrete subtype, which include

source
BolometricCorrections.gridnameMethod
gridname(::Type{<:AbstractBCGrid})

Returns a human-readable String identifier for the provided grid; should be provided for all grid types.

gridname(grid::AbstractBCGrid) = gridname(typeof(grid))

Generic method provided to return the gridname for instances of concrete subtypes of AbstractBCGrid.

source
BolometricCorrections.filternamesMethod
filternames(grid::AbstractBCGrid)

Returns a Vector{String} containing the names of the photometric filters contained in the provided bolometric correction grid. See columnnames if you also want to retrieve names of dependent variable columns.

source
Base.extremaMethod
extrema(grid::AbstractBCGrid)

Returns a NamedTuple containing the bounds of the dependent variables in the bolometric correction grids (e.g., [Fe/H], Av).

source
TypedTables.TableMethod
Table(grid::AbstractBCGrid)

Returns a TypedTables.Table containing the data underlying the bolometric correction grid.

source

BC Table API

BolometricCorrections.AbstractBCTableType

AbstractBCTable{T <: Real} is the abstract supertype for all bolometric correction tables with extraneous dependent variables (e.g., [Fe/H], Av) fixed – typically only dependent variables such as logg and Teff should remain. T is the data type to use internally and is returned by eltype. Most AbstractBCTables should be callable with scalar (Teff, logg) arguments, returning the interpolated BCs at those values. Some tables may require additional arguments args... such as the mass loss rate Mdot for the WM-basic tables.

(table::AbstractTable)(Teff::Number, logg::Number, args...)

Tables may also be called with a single argument (usually a NamedTuple) which has the necessary values stored as – for example, arg = (Teff = 2750, logg = 2.5) could be passed directly to a AbstractBCTable without splatting.

(table::AbstractTable)(arg)

We additionally support automatic broadcasting over input arrays – the following method formats the result into a stacked matrix or a TypedTables.Table, if that is the first argument. The creation of the table has a roughly fixed runtime overhead cost of 3–5 μs to perform the type conversion. Examples of this usage are provided in the docstrings for each subtype of AbstractBCTable (see, for example, MISTBCTable).

(table::AbstractBCTable)([::Type{TypedTables.Table},]
                         args::Vararg{AbstractArray{<:Real}, N}) where {N}
source
BolometricCorrections.gridnameMethod
gridname(::Type{<:AbstractBCTable})

Returns a human-readable String identifier of the grid from which the provided table was derived. This should be provided for all table types.

gridname(table::AbstractBCTable) = gridname(typeof(table))

Generic method provided to return the gridname for instances of concrete subtypes of AbstractBCTable.

source
BolometricCorrections.filternamesMethod
filternames(table::AbstractBCGrid)

Returns a NTuple{N, Symbol} containing the names of the photometric filters contained in the provided bolometric correction table. See columnnames if you also want to retrieve names of dependent variable columns.

source
Base.extremaMethod
extrema(table::AbstractBCTable)

Returns a NamedTuple containing the bounds of the dependent variables in the bolometric correction table (e.g., logg, Teff).

source
TypedTables.TableMethod
Table(table::AbstractBCTable)

Returns a TypedTables.Table containing the data underlying the bolometric correction table.

source

Photometric Zeropoints API

BolometricCorrections.AbstractZeropointsType

AbstractZeropoints is the abstract supertype for information regarding the photometric zeropoints assumed for a particular grid of bolometric corrections and supports conversion between systems (AB, Vega, ST).

source
BolometricCorrections.zeropointsFunction
zeropoints(grid::AbstractBCGrid)
zeropoints(table::AbstractBCTable)

Return the correct concrete instance of AbstractZeropoints for the type of grid or table.

julia> zeropoints(MISTBCGrid("JWST")) isa BolometricCorrections.MIST.MISTZeropoints
true
source
BolometricCorrections.vegamagsFunction
vegamags(zpt::AbstractZeropoints, filter, mags)

Uses the photometric zeropoint information in zpt to convert magnitudes mags in the given filter to the Vega magnitude system.

source
BolometricCorrections.abmagsFunction
abmags(zpt::AbstractZeropoints, filter, mags)

Uses the photometric zeropoint information in zpt to convert magnitudes mags in the given filter to the AB magnitude system.

source
BolometricCorrections.stmagsFunction
stmags(zpt::AbstractZeropoints, filter, mags)

Uses the photometric zeropoint information in zpt to convert magnitudes mags in the given filter to the ST magnitude system.

source
BolometricCorrections.MbolMethod
Mbol(zpt::AbstractZeropoints)

Returns the absolute bolometric magnitude of the Sun assumed in the definition of the BC grid.

source
BolometricCorrections.LbolMethod
Lbol(zpt::AbstractZeropoints)

Returns the bolometric luminosity [erg / s] of the Sun assumed in the definition of the BC grid.

source

Chemical Mixture API

Chemical mixtures used for BCs typically start by defining an assumed chemical mixture for the Sun. When considering the solar chemical mixture, it is important to note that there is a difference between photospheric abundances and protostellar abundances as metals diffuse out of the photosphere over time, leading the photospheric abundances to be lower than protostellar abundances. We differentiate between these in our API. Generally the protostellar quantities (i.e., X, Y, Z) are preferred for most use cases, as these are the initial conditions for the stellar models set by the researchers and are therefore static. The diffusive processes responsible for the difference between the photospheric and protostellar metallicities depend on the initial mass of a star in addition to its age, and so a population of stars that share a single protostellar metallicity will not all have identical photospheric metallicities, even if they all have the same age. Ideally the photospheric metallicity should be a quantity tracked during the simulation of a stellar model so that it would be included in the stellar track – the photospheric metallicities are therefore a prediction of the stellar evolution models, rather than an intrinsic property set at the beginning of the simulation.

BolometricCorrections.AbstractChemicalMixtureType

AbstractChemicalMixture is the abstract supertype for information regarding the chemical mixtures available or assumed for a particular grid of bolometric corrections. It also supports evaluation and conversion between different chemical conventions (i.e., conversion between metal mass fraction Z and logarithmic metallicity [M/H]).

source
BolometricCorrections.chemistryMethod
chemistry(mix::AbstractBCTable)
chemistry(mix::AbstractBCGrid)

Returns the correct concrete instance of AbstractChemicalMixture for the provided bolometric correction grid or table. This provides a convenient programmatic way to obtain this chemical information.

julia> grid = MISTBCGrid("JWST");

julia> chemistry(grid)
BolometricCorrections.MIST.MISTChemistry()

julia> table = grid(-1.5, 0.03);

julia> chemistry(table)
BolometricCorrections.MIST.MISTChemistry()
source
BolometricCorrections.XMethod
X(mix::AbstractChemicalMixture)

Returns the protostellar solar hydrogen mass fraction assumed in the provided chemical mixture.

source
BolometricCorrections.X_photMethod
X_phot(mix::AbstractChemicalMixture)

Returns the photospheric solar hydrogen mass fraction assumed in the provided chemical mixture.

source
BolometricCorrections.Y_pMethod
Y_p(mix::AbstractChemicalMixture)

Returns the primordial helium mass fraction assumed in the provided chemical mixture.

source
BolometricCorrections.YMethod
Y(mix::AbstractChemicalMixture)

Returns the protostellar solar helium mass fraction. May use [Z] internally.

source
BolometricCorrections.ZMethod
Z(mix::AbstractChemicalMixture)

Returns the protostellar solar metal mass fraction assumed in the provided chemical mixture.

source
BolometricCorrections.Z_photMethod
Z_phot(mix::AbstractChemicalMixture)

Returns the photospheric solar metal mass fraction assumed in the provided chemical mixture.

source

The above methods define the solar standard assumed in chemical mixture models. The information contained in an AbstractChemicalMixture can be used to convert between different chemical conventions (i.e., the metal mass fraction Z and logarithmic metallicity [M/H]). These conversion methods are documented below with accompanying notes for use.

It has been shown that helium abundance $Y$ typically only affects broadband BCs at the level of a few thousandths of magnitudes (Girardi et al., 2007; VandenBerg et al., 2022). However, it is common for stellar BCs to assume helium abundances that are a function of the stellar metallicity to match the relation used for the stellar evolution models where the helium abundance makes a more significant difference. For grids in which $Y$ scales with $Z$, the following methods can be used to derive other quantities.

BolometricCorrections.XMethod
X(mix::AbstractChemicalMixture, Z)

Returns protostellar hydrogen mass fraction given the protostellar metal mass Z and the provided chemical mixture. Generic method returns 1 - Y(mix, Z) - Z.

source
BolometricCorrections.YMethod
Y(mix::AbstractChemicalMixture, Z)

Returns the protostellar helium mass fraction given the protostellar metal mass fraction Z. Only valid for grids in which $Y$ is a function of $Z$.

source
BolometricCorrections.ZMethod
Z(mix::AbstractChemicalMixture, MH)

Returns the protostellar metal mass fraction given the logarithmic metallicity MH and the provided chemical mixture.

source
BolometricCorrections.MHMethod
MH(mix::AbstractChemicalMixture, Z)

Returns the protostellar logarithmic metallicity [M/H] = log10(Z/X) - log10(Z⊙/X⊙) given the metal mass fraction Z and the provided chemical mixture.

source

Note that we do not offer methods scaling the photospheric abundance values with $Z$, such as MH_phot(mix::BolometricCorrections.AbstractChemicalMixture, Z), as the diffusive processes that change the photospheric abundances relative to the initial abundances depend on both the age and initial mass of the star in question – it is therefore inappropriate to simply scale the assumed solar photospheric abundances to other bulk metallicities $Z$.