CoolDwarf.opac.ferg05 package

Subpackages

Submodules

CoolDwarf.opac.ferg05.opac module

Ferguson et al. (2005) Opacity Table module. This module takes a single file which is the merging of an entire Ferguson opacity table composition set and parses it. At instantiation a table is interpolated to the correct X and Z from the provided table set. The table is then used to calculate the opacity at a given logR and logT. Currently this uses the GS98 composition file. This can be extended if you are interested in extending it to other compositions.

..math::

R = rho left(frac{T}{10^6}right)^3

Functions

linear_interpolator(x, x1, x2, Q1, Q2)

Provides a linear interpolation between two points

bilinear_interpolator(x, z, x1, x2, z1, z2, Q00, Q10, Q01, Q11)

Provides a bilinear interpolation between four points

find_closest_indices(x, z, keys)

Finds the closest indices in a dictionary to a given x and z

Classes

Ferg05Opacity

Class for the Ferguson et al. (2005) opacity table It is used to calculate the opacity at a given logR and log and provides the standard CoolDwarf opacity interface (the kappa function)

Example Usage

>>> from CoolDwarf.opac.ferg05.opac import Ferg05Opacity
>>> X, Z = 0.7, 0.02
>>> opac = Ferg05Opacity(X, Z)
>>> logKappa = opac.kappa(4e3, 1e-1)
>>> print(f"Kappa_rmo: {10**logKappa} cm^2/g")
class CoolDwarf.opac.ferg05.opac.Ferg05Opacity(X, Z)

Bases: object

Methods

interpolate

kappa

kappaLogRT

parse

interpolate(dataframes)
kappa(temp, density, log=False)
kappaLogRT(logT, logR)
parse()

Module contents