scopesim_targets.spectral_classes.StellarParameters#

class scopesim_targets.spectral_classes.StellarParameters(required_columns: str | Iterable[str] | None = None)#

Bases: object

Wrapper for Mamajek table of spectral types and physical parameters [1].

Acts as a static lookup table for the parameters listed below.

Currently only uses a subset of columns from the original table, omitting the ones currently not needed in the ScopeSim ecosystem. Some columns have been renamed to match nomenclature elsewhere. The following columns are currently included:

  • spectral_type (primary key, astar_utils.SpectralType objects)

  • teff (effective temperature in K)

  • mass (stellar mass in solar masses)

  • radius (stellar radius in solar radii)

  • M_V (absolute V band magnitude)

  • M_J (absolute J band magnitude)

  • M_Ks (absolute Ks band magnitude)

  • U-B color

  • B-V color

  • V-Ks color

  • J-H color

  • H-Ks color

Todo

Consider including the remaining columns if useful.

Todo

Add information about .loc[]-style indexing with spectral types, including examples.

Todo

Document interpolation and lookup methods with examples.

Parameters:

required_columns (str | Iterable[str] | None) – Column(s) that may not be NaN. Any rows containing a missing value in those columns are excluded from the table. Useful for e.g. clipping the table to contain only spectral classes with available IR photometry.

table#

Processed parameter lookup table.

Type:

astropy.table.QTable

Notes

Originally taken from: https://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt, initially published in [1], partially also in [2].

References

__init__(required_columns: str | Iterable[str] | None = None)#

Methods

__init__([required_columns])

closest_mass(mass)

Lookup the row(s) closest to a given stellar mass(es).

closest_spectral_type(spectral_type)

closest_teff(teff)

Lookup the row(s) closest to a given effective temperature(s).

group_spectral_classes()

Generate SpectralClass objects from grouped parameters table.

interpolate(colname, values[, extrapolate_phot])

closest_mass(mass: Annotated[Quantity, Unit('solMass')]) QTable | Row#

Lookup the row(s) closest to a given stellar mass(es).

Parameters:

mass (u.Quantity[u.solMass]) – Stellar mass(es) to look up. Can be scalar or array, but must be quantity convertible to mass.

Returns:

closest_rows – Resulting row(s). If mass was provided as an array, the result will be a QTable, subset of the original table. If mass is scalar, the result will be a single Row object.

Return type:

QTable | Row

closest_teff(teff: Annotated[Quantity, Unit('K')]) QTable | Row#

Lookup the row(s) closest to a given effective temperature(s).

Parameters:

teff (u.Quantity[u.K]) – Stellar effective temperature(s) to look up. Can be scalar or array, but must be quantity convertible to temperature.

Returns:

closest_rows – Resulting row(s). If teff was provided as an array, the result will be a QTable, subset of the original table. If teff is scalar, the result will be a single Row object.

Return type:

QTable | Row

group_spectral_classes() Iterator[SpectralClass]#

Generate SpectralClass objects from grouped parameters table.

Min and max of Teff are calculated for each spectral class (OBAFGKMLTY) and then any “gaps” between classes are closed by the average between the previous min and next max.

Yields:

spectral_class (SpectralClass) – Instances of SpectralClass created from each row.