API Reference
Utilities
BolometricCorrections.Mbol
— MethodMbol(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.
BolometricCorrections.logL
— MethodlogL(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.
BolometricCorrections.radius
— Functionradius(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
BolometricCorrections.surface_gravity
— Functionsurface_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
BC Grid API
BolometricCorrections.AbstractBCGrid
— TypeAbstractBCGrid{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
BolometricCorrections.gridname
— Methodgridname(::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
.
BolometricCorrections.filternames
— Methodfilternames(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.
Base.extrema
— Methodextrema(grid::AbstractBCGrid)
Returns a NamedTuple
containing the bounds of the dependent variables in the bolometric correction grids (e.g., [Fe/H], Av).
TypedTables.Table
— MethodTable(grid::AbstractBCGrid)
Returns a TypedTables.Table
containing the data underlying the bolometric correction grid.
BC Table API
BolometricCorrections.AbstractBCTable
— TypeAbstractBCTable{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 AbstractBCTable
s 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}
BolometricCorrections.gridname
— Methodgridname(::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
.
BolometricCorrections.filternames
— Methodfilternames(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.
Base.extrema
— Methodextrema(table::AbstractBCTable)
Returns a NamedTuple
containing the bounds of the dependent variables in the bolometric correction table (e.g., logg
, Teff
).
TypedTables.Table
— MethodTable(table::AbstractBCTable)
Returns a TypedTables.Table
containing the data underlying the bolometric correction table.
Photometric Zeropoints API
BolometricCorrections.AbstractZeropoints
— TypeAbstractZeropoints
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).
BolometricCorrections.zeropoints
— Functionzeropoints(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
BolometricCorrections.filternames
— Methodfilternames(zpt::AbstractZeropoints)
Returns a Vector{String}
containing the names of the photometric filters in the table of zeropoints.
BolometricCorrections.vegamags
— Functionvegamags(zpt::AbstractZeropoints, filter, mags)
Uses the photometric zeropoint information in zpt
to convert magnitudes mags
in the given filter
to the Vega magnitude system.
BolometricCorrections.abmags
— Functionabmags(zpt::AbstractZeropoints, filter, mags)
Uses the photometric zeropoint information in zpt
to convert magnitudes mags
in the given filter
to the AB magnitude system.
BolometricCorrections.stmags
— Functionstmags(zpt::AbstractZeropoints, filter, mags)
Uses the photometric zeropoint information in zpt
to convert magnitudes mags
in the given filter
to the ST magnitude system.
BolometricCorrections.Mbol
— MethodMbol(zpt::AbstractZeropoints)
Returns the absolute bolometric magnitude of the Sun assumed in the definition of the BC grid.
BolometricCorrections.Lbol
— MethodLbol(zpt::AbstractZeropoints)
Returns the bolometric luminosity [erg / s] of the Sun assumed in the definition of the BC grid.
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.AbstractChemicalMixture
— TypeAbstractChemicalMixture
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]).
BolometricCorrections.chemistry
— Methodchemistry(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()
BolometricCorrections.X
— MethodX(mix::AbstractChemicalMixture)
Returns the protostellar solar hydrogen mass fraction assumed in the provided chemical mixture.
BolometricCorrections.X_phot
— MethodX_phot(mix::AbstractChemicalMixture)
Returns the photospheric solar hydrogen mass fraction assumed in the provided chemical mixture.
BolometricCorrections.Y_p
— MethodY_p(mix::AbstractChemicalMixture)
Returns the primordial helium mass fraction assumed in the provided chemical mixture.
BolometricCorrections.Y
— MethodY(mix::AbstractChemicalMixture)
Returns the protostellar solar helium mass fraction. May use [Z
] internally.
BolometricCorrections.Y_phot
— MethodY_phot(mix::AbstractChemicalMixture)
Returns the photospheric solar helium mass fraction. May use [Z_phot
] internally.
BolometricCorrections.Z
— MethodZ(mix::AbstractChemicalMixture)
Returns the protostellar solar metal mass fraction assumed in the provided chemical mixture.
BolometricCorrections.Z_phot
— MethodZ_phot(mix::AbstractChemicalMixture)
Returns the photospheric solar metal mass fraction assumed in the provided chemical mixture.
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.X
— MethodX(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
.
BolometricCorrections.Y
— MethodY(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$.
BolometricCorrections.Z
— MethodZ(mix::AbstractChemicalMixture, MH)
Returns the protostellar metal mass fraction given the logarithmic metallicity MH
and the provided chemical mixture.
BolometricCorrections.MH
— MethodMH(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.
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$.