Access to Kurucz atmospheric models

The classes and functions available here provide access to the model grids made available by Robert L. Kurucz on: http://kurucz.harvard.edu/grids.html

Note

Model grids are downloaded on first request and stored in PyA’s data path.

Example: Get access to the models

from __future__ import print_function, division
from PyAstronomy import pyasl

km = pyasl.KuruczModels()
# See what model grids are available
print(km.availableGrids())

# See whether model grid for log(metallicity) = 0.0
# is available
print(km.gridAvailable(0.0))

# Obtain the model grid for solar metallicity
mg = km.requestModelGrid(0.0)

# See what Teffs and logg are available
print("Teffs: ", mg.availableTeffs())
print("Loggs: ", mg.availableLoggs())

print()
print()

# Use simple access method to obtain a model.
# The input is: Teff, logg, and log10(metallicity)
model = pyasl.getKuruczModel(4250, 4.5, 0.1)

Purge data

If required, e.g., to initiate a re-download, the Kurucz data stored in PyA’s data directory can be deleted.

from PyAstronomy import pyasl
pyasl.purgeKuruczData()

Classes and functions

PyAstronomy.pyasl.getKuruczModel(teff, logg, met, nameadd='')

Obtain a Kurucz model

Parameters
tefffloat

Effective temperature [K]

loggfloat

Logarithmic surface gravity [cgs]

metfloat

Logarithmic metallicity, e.g., +0.1.

nameaddstring, optional

Name extension of the model grid; for instance, “NOVER”.

Returns
Modellist of strings

The requested model.

PyAstronomy.pyasl.purgeKuruczData()

Remove downloaded Kurucz data from PyA’s data directory

class PyAstronomy.pyasl.KuruczModels

Provides access to the Kurucz models.

Methods

availableGrids()

All available model grids.

getListOfGridsFN()

Get filename for list of grids

gridAvailable(met[, add])

Check whether model grid is available.

listGridLinks()

List links to available grids

requestModelGrid(met[, add])

Get a model grid.

availableGrids()

All available model grids.

Returns
Available gridslist of strings

The names of all available model grids.

getListOfGridsFN()

Get filename for list of grids

gridAvailable(met, add='')

Check whether model grid is available.

Parameters
metfloat

Log10 of metallicity.

Returns
Availability flagboolen

True, if model grid is available.

List links to available grids

requestModelGrid(met, add='')

Get a model grid.

Parameters
metfloat

Log10 of the metallicity. For instance use: 0.0, +0.1, +0.5, or -0.5.

Returns
Model gridKuruczMT

The model grid enclosed in a class instance, which allows easy access to the models.

class PyAstronomy.pyasl.KuruczMT(fn)

Provides access to individual models in a model grid.

Parameters
fnstring

Name of the Kurucz model file.

Attributes
teffsarray

Available effective temperatures [K] in ascending order.

loggsarray

Available loggs in ascending order [cgs].

modelsdictionary

The key is a tuple of the form: (teff, logg, met) and the value is a list of strings representing the model.

metfloat

The logarithmic metallicity of the model grid.

Methods

availableLoggs()

Get available logg values.

availableTeffs()

Get available effective temperatures.

getModel(teff, logg[, met])

Get a model.

metallicity()

Get metallicity of model grid.

modelAvailable(teff, logg[, met])

Determine whether model is available.

availableLoggs()

Get available logg values.

Note that not all models are available for all logg values.

Returns
Loggsarray

Array of available loggs sorted in ascending order.

availableTeffs()

Get available effective temperatures.

Returns
Teffsarray

Array of available effective temperatures sorted in ascending order.

getModel(teff, logg, met=None)

Get a model.

Parameters
tefffloat

Effective temperatures [K]

loggfloat

Logg [cgs]

metfloat, optional

Logarithmic metallicity. If not given, the metallicity of the model grid is used.

Returns
Modellist of strings

The model as found on the file.

metallicity()

Get metallicity of model grid.

Returns
metfloat

Log10 of the metallicity.

modelAvailable(teff, logg, met=None)

Determine whether model is available.

Parameters
tefffloat

Effective temperatures [K]

loggfloat

Logg [cgs]

metfloat, optional

Logarithmic metallicity. If not given, the metallicity of the model grid is used.

Returns
Availability flagboolean

True, if the model is available.