Spectral type vs. Teff and luminosity

The class SpecTypeDeJager() implements the relation given by de Jager and Nieuwenhuijzen 1987, A&A 177, 217-227.

Example: Basic Usage

from __future__ import print_function
from PyAstronomy import pyasl

# Instantiate class object
sdj = pyasl.SpecTypeDeJager()

llum, lteff = sdj.lumAndTeff("K0", "V")

print("Luminosity = {0:4.2f} Lsun".format(10.0**llum))
print("Effective temperature = {0:6.1f} K".format(10.0**lteff))

Example: Teff and luminosity as a function of spectral type

from __future__ import print_function
from PyAstronomy import pyasl
import matplotlib.pylab as plt

# Instantiate class object
sdj = pyasl.SpecTypeDeJager()

# Set luminosity class
lk = "V"

# Save spectral types, log(teff), and log(luminosity)
spts = []
lteffs = []
llums = []

# Save information to annotate abscissa
xt = []
xtl = []

for t in "OBAFGKM":
    for n in range(10):
        if (t == "O") and (n == 0):
            # Skip the invalid "O0" type
            continue

        # Save the spectral type
        spts.append(t + str(n))

        # Get log10 of luminosity and effective temperature
        ll, lt = sdj.lumAndTeff(spts[-1], lk)
        # and save to lists
        llums.append(ll)
        lteffs.append(lt)

        # Save location (i.e., number in the list) and
        # spectral for annotating the abscissa
        if (n == 0) or (n == 5):
            xt.append(len(spts)-1)
            xtl.append(spts[-1])


ax1 = plt.subplot(2, 1, 1)
# Plot log10(effective temperature)
plt.plot(lteffs)
plt.ylabel("$\log_{10}$(T$_{eff}$)")
plt.setp(ax1, xticks=xt, xticklabels=xtl)
ax2 = plt.subplot(2, 1, 2)
# Plot log10(luminosity)
plt.plot(llums)
plt.ylabel("$\log_{10}$($L/L_{\odot}$)")
plt.setp(ax2, xticks=xt, xticklabels=xtl)
plt.xlabel("Spectral type")
plt.show()

API

class PyAstronomy.pyasl.SpecTypeDeJager

Spectral type calibration from de Jager and Nieuwenhuijzen.

This class implements the spectral type calibration presented by de Jager and Nieuwenhuijzen 1987, A&A 177, 217-227 (DJ87). Specifically, the authors calibrate the relation between spectral type and stellar luminosity and effective temperature for a wide range of spectral types and luminosity classes.

DJ87 give their results in the form of a polynomial relation with 20 coefficients (Eqs. 2a and 2b) as well as in the form of their Tables 5 and 6.

Note

Tables 5 and 6 in DJ87 are calculated on the basis of a 40 parameter solution, which is not given in the paper. The numbers based on the 20 parameter polynomial solution deviate from the tabulated numbers by typically a few percent for the effective temperature and 10 percent for the luminosities (not their logarithm).

Methods

lumAndTeff(spt, lk)

Get effective temperature and luminosity.

_cheby(i, x)

Evaluate the Chebychev polynomial.

_decomposeSPT(spt)

Decomposes spectral type into ‘basic type’ and subtype.

Parameters
sptstring

Spectral type (e.g, F8.5)

Returns
Basic typestring

Type with integer subtype (e.g., F8)

Subtypefloat

Subtype as a float (e.g., 8.5)

_indexSpecType(spt)

Get index of spectral type in list and check validity.

Returns
indexint

Position in self._types list

_resolve_b(lk)

Resolve numerical value of variable b.

Parameters
lkstring

Luminosity class (e.g., IV)

Returns
bfloat

The value of b

_resolve_s(bt, st)

Resolve numerical value of variable s.

Parameters
btstring

Spectral type (e.g., F3), no LK included

stfloat

Subtype (e.g., 3.5 from F3.5)

Returns
sfloat

Value of s

lumAndTeff(spt, lk)

Get effective temperature and luminosity.

Parameters
sptstring

The spectral type (may include float subtype). For instance, F3, F3.5, or K2

lkstring, {V, IV, III, II, Ib, Iab, Ia, Ia+}

The luminosity class.

Returns
log10(L)float

The base-10 logarithm of the luminosity in units of the solar luminosity.

log10(teff)float

The base-10 logarithm of the effective temperature.