Module API Guide

Warning

This project is very far from completion, so use the IDL version.

This is the application programming interface (API) guide for modules in the Spectroscopy Made Easy (SME) package. The Sphinx napoleon extension (invoked in docs/conf.py) generated the descriptions below from numpy-style docstrings in the source code. Raw docstring content is available in python via the help() command.

abund.py

class sme.abund.Abund(monh, name_or_pattern, input_norm=None)

Manage elemental abundances via metallicity and an abundance pattern.

monh

Metallicity, [M/H], which is the logarithmic offset that will be added to logarithmic abundances specified in pattern, for all elements except hydrogen.

Type:float
input_norm

Valid abundance pattern normalizations are:

  • ‘H=12’ - Abundance values are log10 of the fraction of nuclei of each element in any form, relative to the number of hydrogen nuclei in any form plus an offset of 12. For the Sun, the abundance values of H, He, and Li are approximately 12, 10.9, and 1.05.
  • ‘n/nH’ - Abundance values are the fraction of nuclei of each element in any form, relative to the number of hydrogen nuclei in any form. For the Sun, the abundance values of H, He, and Li are approximately 1, 0.085, and 1.12e-11.
  • ‘n/nTot’ - Abundance values are the fraction of nuclei of each element in any form, relative to the total for all elements in any form. For the Sun, the abundance values of H, He, and Li are approximately 0.92, 0.078, and 1.03e-11.
  • ‘sme’ - For hydrogen, the abundance value is the fraction of all nuclei that are hydrogen. For the other elements, the abundance values are log10 of the fraction of nuclei of each element in any form, relative to the total for all elements in any form. For the Sun, the abundance values of H, He, and Li are approximately 0.92, -1.11, and -11.0.
Type:{‘H=12’, ‘n/nTot’, ‘n/nH’, ‘sme’}
Returns:Abund object, which a Sequence subclass – Abundances calculated by applying metallicity to abundance pattern
__eq__(other)

Test whether specified abundances equal abundances in this object.

Parameters:other (sme.abund.Abund object) – Other abundances that will be compared to abundances in this object
Returns:boolean – True if abundances are defined for the same elements and are equal to within 0.0001 dex in the H=12 representation.
abund

Get abundances, calculated by combining metallicity and pattern.

Returns:dict - elemental abundances with the H=12 normalization
compare(refabund)

Return string comparing two sets of elemental abundances.

Parameters:refabund (Abund object) – reference abundances that will be compared to current abundances
elements

Return the standard abbreviation for each element.

monh

Metallicity, [M/H], that will be applied to the abundance pattern.

normalized(output_norm='H=12', prune=False)

Return abundances with the requested normalization.

Parameters:
  • output_norm (str) – normalization type: ‘H=12’, ‘n/nH’, ‘n/nTot’, and ‘sme’
  • prune (boolean) – if True, remove items where the abundance value is None
pattern

Elemental abundance pattern with H=12 normalization convention.

exception sme.abund.AbundError

Raise when abundance specification is invalid.

class sme.abund.AbundPattern(name_or_pattern, input_norm=None)

A pattern of abundances that is usually scaled by a metallicity.

Values contain a pattern of abundances on the H=12 scale. Pattern is usually scaled by metallicity to obtain abundances. Subclass of the standard dict class. Keys are standard element abbreviations (e.g., ‘Fe’). Values are floats (e.g., 12.000 for hydrogen).

Example

>>> from sme.abund import AbundPattern
>>> g = AbundPattern('Grevesse2007')
__eq__(other)

Test whether self and other abundance patterns are equivalent.

Parameters:other (dict-like object, including Abund or AbundPattern object) – Other abundance pattern to compare to self.
Returns:boolean – True if abundances are defined for the same elements and are equal to within 0.0001 dex in the H=12 representation.
__init__(name_or_pattern, input_norm=None)

Create an abundance pattern object with the specified pattern.

Parameters:
  • name_or_pattern (str or dict-like object) – abundance pattern name or abudance pattern values
  • input_norm (None or str) – None if name specified or normalization type if pattern specified
Returns:

  • AbundPattern object
  • If name_or_pattern has lower() method, assume it is a pattern name.
  • Otherwise, assume name_or_value contains abundance pattern values.
  • Require input_norm when pattern is specified. Otherwise, forbid.

__setitem__(elem, value)

Set value of abundance pattern for the specified element.

Update`self[elem]` item in self, which is a dict-like object. Check that elem is a known element abbreviation. Check that if elem is ‘H’, then float(value) is 12.0000. Check that value is None or float(value) is a float.

Parameters:
  • elem (str) – Element key, e.g., ‘H’, ‘He’, ‘Li’, ‘Be’, ‘B’, ‘C’, …
  • value (object that can be coverted to float by float()) – Abundance pattern value in the H=12 scale.
  • Exceptions
  • ----------
  • AbundError abundance pattern specification is invalid. (Raises) –
__str__()

Print alternating rows of element names and abundances.

custom_pattern(pattern, input_norm)

Set custom abundance pattern from input pattern and normalization.

Valid input normalizations: ‘H=12’, ‘n/nH’, ‘n/nTot’, ‘sme’ Internally, pattern is stored with H=12 normalization. Reset all abundances: 12 for ‘H’, None for elements ‘He’ through ‘Es’. Update individual abundances based on items in pattern.

Parameters:
  • pattern (dict-like object with keys that are element abbreviations) – abundance pattern with normalization specified in input_norm
  • input_norm (str) – abundance normalization type, case insensitive
items()

Return pattern as list of (element, abundance) tuples.

named_pattern(name)

Set abundance pattern to standard values for the specified name.

Known pattern names: ‘Asplund2009’, ‘Grevesse2007’, ‘Empty’. The ‘Empty’ pattern creates items for 88 elements from ‘H’ to ‘Es’.

Parameters:name (str) – identifier for a known abundance pattern, case insensivite
Raises:AbundError – Raised if name is not a known pattern name.
normalized(output_norm='H=12', prune=False)

Return abundances with the requested normalization.

Parameters:
  • output_norm (str) – normalization type: ‘H=12’, ‘n/nH’, ‘n/nTot’, and ‘sme’
  • prune (boolean) – if True, remove items where the abundance value is None
values()

Return list of abundances in pattern.

sme.abund.from_H12(input_pattern, output_norm)

Copy input abundance pattern and convert from H=12 normalization.

Parameters:
  • input_pattern (dict-like object, including Abund or AbundPattern object) – abundance pattern normalized so that H=12
  • output_norm (str) – normalization type: ‘H=12’, ‘n/nH’, ‘n/nTot’, and ‘sme’
Returns:

dict-like object – abundance pattern normalized as specified in output_norm

sme.abund.to_H12(input_pattern, input_norm)

Copy input abundance pattern and convert to H=12 normalization.

Parameters:
  • input_pattern (dict-like object, including Abund or AbundPattern object) – abundance pattern normalized as specified in input_norm
  • input_norm (str) – normalization type: ‘H=12’, ‘n/nH’, ‘n/nTot’, and ‘sme’
Returns:

dict-like object – abundance pattern normalized such that hydrogen abundance is 12

Raises:

AbundError – Raised if input_norm is not a known normalization type

atmo.py

class sme.atmo.AtmoFileAtlas9(path)

Contents of an ATLAS9 atmosphere file.

Parameters:path (path-like object) – Path to an ATLAS9 atmosphere file
abund

Abundance pattern and metallicity for the ATLAS9 atmosphere.

atmo

Dictionary that contains depth-dependent atmosphere data.

Keys come from the ATLAS9 atmosphere file. Nominal keys:

Key Units Description
RHOX g/cm**2 Mass column density
T K Kinetic temperature
P erg/cm**3 Total gas pressure
XNE 1/cm**3 Electron number fraction
ABROSS cm**2/g Rosseland mean mass extinction
ACCRAD cm/s**2 Radiative acceleration
VTURB cm/s Microturbulence velocity
FLXCNV   Convective flux
VCONV cm/s Velocity of convective cells
VELSND cm/s Local sound speed
logg

Logarithm of surface gravity for the ATLAS9 atmosphere.

ndepth

Number of layers in the ATLAS9 atmosphere.

param

Dictionary of parameters read from the ATLAS9 atmosphere file.

path

Path to the ATLAS9 atmosphere file used to initialize object.

teff

Effective temperature for the ATLAS9 atmosphere.

exception sme.atmo.AtmoFileError

Raise when attempt to read an atmosphere file fails.

class sme.atmo.ContinuousOpacityFlags

Manage continuous opacity flags needed by the SME external library.

Subclass of the standard dict class. Initialization populates dict with one item per continuous opacity source. Key identifies the opacity source (e.g., ‘H-‘). Value indicates whether the SME external library should include the continuous opacity source (True or False).

Use standard dictionary syntax to get a flag value (e.g., cof[‘H-‘]) or to set a flag (e.g., cof[‘H-’] = False). Attempting to set a flag raises ValueError if the key is not a valid continuous opacity source (e.g., ‘H++’) or the value is not boolean (e.g., 1).

Overrides __str__() so that print lists keys (opacity sources) with value True followed by keys with value False. The cof.smelib property returns flag values as integers (0 or 1) for use with the SME external library.

Example

>>> from sme.atmo import ContinuousOpacityFlags
>>> cof = ContinuousOpacityFlags()
>>> print(cof.smelib)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
>>> cof['hot'] = False
>>> print(cof)
True: H H2+ H- HRay He He+ He- HeRay cool luke e- H2Ray | False: hot
__init__()

Create continuous opacity flags object with default values. Key order in _defaults must match order expected by SME library.

__setitem__(key, value)

Set value of a continuous opacity flag. Raise ValueError exception if continuous opacity key is not valid or if the value is not boolean.

__str__()

Return string that summarizes continuous opacity flag values.

defaults()

Set each continuous opacity flag to its default value.

smelib

Get opacity flag values as list of integers (0 for False, 1 for True) in the order expected by the SME external library. Python 3.7 or later required because code assumes dict is ordered.

class sme.atmo.SmeAtmo(modeltype, scale, wavelength=None, radius=None)

Manage atmosphere attributes used by the SME external library.

Parameters:
  • radius (float) – Stellar radius (in cm) base of atmosphere grid. Mandatory for spherical geometry. Not allowed for plane-parallel geometry.
  • opacity_flags (dictionary) – Text

Notes

Data in this class yield arguments required by the InputModel() external function in the SME external library. Those arguments are:

arg[0] Number of depths in the atmosphere
arg[1] Reserved for future use (currently read into TEFF, but not used)
arg[2] Reserved for future use (currently read into GRAV, but not used)
arg[3] Wavelength for reference continuous opacities (used if MOTYPE=0)
arg[4] Type of model atmosphere (‘TAU’, ‘RHOX’, or ‘SPH’)
__str__()

Return string that summarizes atmosphere.

modeltype

Combination of radiative transfer geometry (plane parallel or spherical) and depth scale type (mass column, continuum optical depth, or height). The SME external library can handle the following model types:

Value Geometry Depth scale type Units
‘rhox’ plane-parallel mass column g/cm**2
‘tau’ plane-parallel continuum optical depth  
‘sph’ spherical height cm

This read only property is set when an atmosphere is loaded.

nlayer

Number of layers (depths or heights) in the model atmosphere. This read only property is set when an atmosphere is loaded.

radius

Radius (in cm) of deepest point in an atmosphere grid. Set for modeltype ‘sph’, otherwise None. This read only property is set when an atmosphere is loaded.

scale

Physical scale for each layer in the atmosphere. See modeltype for description of scale types (mass column, continuum optical depth, or height). This read only property is set when an atmosphere is loaded.

set_scale(modeltype, scale, wavelength=None, radius=None)

Set model type and atmosphere scale. Input modeltype is case insensitive, but will be forced to lowercase for subsequent use. For modeltype ‘tau’, specify wavelength of the continuum optical depth scale. For modeltype ‘sph’, specify stellar radius (in cm) of deepest point in the atmosphere grid.

Setting a new scale updates the number oflayers and invalidates existing values of temperature, electron number density, total number density, and mass density at each layer in the atmosphere.

Raise ValueError exception if modeltype is not valid. Raise AttributeError exception if wavelength and/or radius are missing when expected or specifed when not expected.

wavelength

Wavelength (in Angstrom) of continuum optical depth scale. Set for modeltype ‘tau’, otherwise None. This read only property is set when an atmosphere is loaded.

dll.py

class sme.dll.LibSme(file=None)

Access SME external library code.

ClearH2broad()

Disable collisional broadening by molecular hydrogen in library code.

InputLineList(linelist)

Pass atomic and molecular line data to library code.

InputWaveRange(wfirst, wlast)

Pass wavelength range for spectrum synthesis to library code.

OutputLineList()

Returns WLCENT, GF, EXCIT, log10(GAMRAD), log10(GAMQST), GAMVW. Note that InputLineList elements are 2:WLCENT, 3:log(GF), 4:EXCIT, whereas OutputLineList elements are 0:WLCENT, 1:EXCIT, 2:GF.

SMELibraryVersion()

Return version number reported by SME library code.

SetH2broad()

Enable collisional broadening by molecular hydrogen in library code.

SetVWscale(vwscale)

Pass van der Waals broadening enhancement factor to library code.

UpdateLineList(newlinedata, index)

Pass new line data to library code for lines specified by index.

default_libfile()

Return default absolute path to SME library file.

file

Absolute path to SME library file for the current platform.

util.py

exception sme.util.FileError

Raise when SME encounters an error accessing a file.

sme.util.air_to_vacuum(wair, units)

Convert wavelengths in air to wavelengths in vacuum.

Algorithm: Convert input air wavelengths to Angstroms. Convert air wavelengths greater than 1999.3520267833621 Angstroms to vacuum wavelengths using the following formulae, which is used by VALD3:

s &= {10^4 \over \lambda_{air}}

n &= 1 + 0.00008336624212083
      + {0.02408926869968 \over 130.1065924522 - s^2}
      + {0.0001599740894897 \over 38.92568793293 - s^2}

\lambda_{vac} &= n \lambda_{air}

In this formula, n is the index of refraction in air. Convert air wavelengths from Angstroms back to the original units before output. Do not convert vacuum wavelengths less than 2000 Angstroms.

Parameters:
  • wair (float or list of floats) – Input wavelength(s) in air.
  • units (str) – Units of input wavelength(s), e.g. ‘A’, ‘nm’, ‘cm^-1’. See change_waveunit for list of allowed wavelength units.
Returns:

float or list of floats – Output wavelength(s) in vacuum and the same units as the input.

Examples

>>> from sme.util import vacuum_to_air
>>> air_to_vacuum(4998.605522013399, 'A')
5000
>>> air_to_vacuum([x, y], 'nm')
[500, 501]
>>> air_to_vacuum(1999, 'A')
1999
sme.util.change_energyunit(energy, oldunits, newunits)

Return energies converted to new energy units.

Parameters:
  • energy (float or list of floats) – Input energy or energies in units specified by oldunits.
  • oldunits (str) – Input units for energy. Allowed values are described in the table below. Values are case insensitive.
  • newunits (str) – Units for returned energy or energies. Allowed values are described in the table below. Values are case insensitive.
Returns:

float or list of floats – Output energy or energies in units specified by newunits.

Raises:

ValueError – If either oldunits or newunits is not a recognized energy unit, as described in the table below.

The following table defines allowed values for newunits and oldunits.

Unit Description
'eV' electron volts
'erg' erg
'J' Joule
'cm^-1' inverse centimeters
'1/cm' inverse centimeters

Examples

>>> from sme.util import change_energyunit
>>> change_energyunit(2.0, 'eV', 'cm^-1')
16131.087874
>>> change_energyunit([5000, 20000], 'cm^-1', 'eV')
[0.6199209921928418, 2.479683968771367]
sme.util.change_waveunit(wave, oldunits, newunits)

Return wavelengths converted to new wavelength units.

Parameters:
  • wave (float or list of floats) – Input wavelength(s) in units specified by oldunits.
  • oldunits (str) – Input units for wave. Allowed values are described in the table below. Values are case insensitive.
  • newunits (str) – Units for returned wavelength(s). Allowed values are described in the table below. Values are case insensitive.
Returns:

float or list of floats – Output wavelength(s) in units specified by newunits.

Raises:

ValueError – If either oldunits or newunits is not a recognized wavelength unit, as described in the table below.

The following table defines allowed values for newunits and oldunits.

Unit Description
'A' Angstroms
'nm' nanometers
'um' micrometers
'micron' micrometers
'cm^-1' inverse centimeters
'1/cm' inverse centimeters

Examples

>>> from sme.util import change_waveunit
>>> change_waveunit(5000, 'A', 'nm')
500.0
>>> change_waveunit([10000, 20000], 'cm^-1', 'a')
[10000.0, 5000.0]
sme.util.filesection(fobj, name, nline=0)

Read specified number of lines from file or read to end of file.

Upon entry, read/write pointer may point anywhere in the file. Upon exit, read/write pointer will be just beyond last character read. Return values do not contain line terminators.

Parameters:
  • fobj (file object) – File-like object that has file property supports readline() and readlines() methods.
  • name (str) – Short string identifying section type. Used in error message.
  • nline (int) – If positive, read exactly nline lines. If zero, read all remaining lines in the file. If negative, read all remaining lines, require at least -nline lines.
Returns:

list of str – Lines read from file with line terminator removed.

Raises:

FileError – If reading the file object did not yield the required number of lines.

sme.util.vacuum_angstroms(wave, units, medium)

Convert wavelength(s) from input units and medium to vacuum angstroms.

Internally, SME uses vacuum wavelengths in Angstroms. When reading spectra and line data into SME, SME uses this function to convert to vacuum wavelengths in Angstroms.

Parameters:
  • wave (float or list of floats) – Input wavelength(s) in units specified by units and medium specified by medium.
  • units (str) – Input units for wave. See change_waveunit for description of allowed wavelength units.
  • medium (str) – Input medium for wave. Allowed values are described in the table below. Values are case insensitive.
Returns:

float or list of floats – Output vacuum wavelength(s) in Angstroms.

Raises:

ValueError – If units is not a recognized wavelength unit (as described in change_waveunit) or if medium is not a recognized medium (as described in the table below).

The following table defines allowed values for medium.

Medium Description
'air' Air
'vac' Vacuum
'vacuum' Vacuum
'None' Assume vacuum

Examples

>>> from sme.util import vacuum_angstroms
>>> vacuum_angstroms(5000, 'A', 'vac')
5000
>>> vacuum_angstroms([500, 501], 'nm', 'air')
[5001.39484863807, 5011.397506813088]
sme.util.vacuum_to_air(wvac, units)

Convert wavelengths in vacuum to wavelengths in air.

Convert input vacuum wavelengths to Angstroms. Convert vacuum wavelengths greater than 2000 Angstroms to air wavelengths using the following formulae from Morton (2000, ApJS, 130, 403), which is used by VALD3:

s &= {10^4 \over \lambda_{vac}}

n &= 1 + 0.0000834254 + {0.02406147 \over 130 - s^2}
      + {0.00015998 \over 38.9 - s^2}

\lambda_{air} &= {\lambda_{vac} \over n}

In this formula, n is the index of refraction in air. Convert air wavelengths from Angstroms back to the original units before output. Do not convert vacuum wavelengths less than 2000 Angstroms.

Parameters:
  • wvac (float or list of floats) – Input wavelength(s) in vacuum.
  • units (str) – Units of input wavelength(s), e.g. ‘A’, ‘nm’, ‘cm^-1’. See change_waveunit for list of allowed wavelength units.
Returns:

float or list of floats – Output wavelength(s) in air and the same units as the input.

Examples

>>> from sme.util import vacuum_to_air
>>> vacuum_to_air(5000, 'A')
4998.605522013399
>>> vacuum_to_air([500, 501], 'nm')
[499.86055220133994, 500.8602864587058]
>>> vacuum_to_air(1999, 'A')
1999

vald.py

class sme.vald.LineList

Line data for a list of atomic and molecular lines.

class sme.vald.SmeLine(species, wlcent, excit, loggf, gamrad, gamqst, gamvw)

Basic data required by SME for each atomic or molecular transition.

species

Name of atom (e.g., ‘Co’) or molecule (e.g., ‘CO’), followed by a space and the ionization state (e.g., ‘ 1’). Atom name begins with a capital letter (e.g., ‘C’). Additional letters (if any) are lower case (e.g., ‘Co’). Molecule name is a sequence of atom names (e.g., ‘CO’) with multiplicity factors as needed (e.g., ‘H2O’) Ionization state is a number: ‘1’ for neutral, ‘2’ for singly ionized, etc. Examples: 'C 4', 'Co 2', 'CO 1', or 'H2O 1’.

Type:str
wlcent

Wavelength (in Angstroms) of the transition. Examples: 6564.61 or '6564.6100'.

Type:float or str that yields a float
excit

Energy (in eV) of the lower state of the transition. Examples: 10.1988 or '10.1988'.

Type:float or str that yields a float
loggf

Logarithm of the product of the statistical weight (g) of the lower state of the transition times the oscillator strength (f) of the transition. Examples: 0.71 or '0.710'.

Type:float or str that yields a float
gamrad

Logarithm of the radiative damping parameter for the transition. Examples: 8.766 or '8.766'.

Type:float or str that yields a float
gamqst

For species other than atomic hydrogen, logarithm of the quadratic Stark broading parameter for the transition. For atomic hydrogen, principal quantum number (n) of the lower state. A value of zero requests use of an approximate Stark broadening formula from Cowley (1971). Examples: -6.14, '-6.14', 2, '2.000', 0, or '0.000'.

Type:float or str that yields a float
gamvw

For species other than atomic hydrogen and value less than zero, logarithm of the van der Waals collisional broading parameter for the transition at 10000 K (e.g., ‘-7.510’). For species other than atomic hydrogen and value greater than 20, broadening cross section (sigma in atomic units) at 10 km/s and velocity exponent (alpha) packed into a single parameter int(sigma)+alpha (e.g., ‘230.192’). See Barklem for more info. For atomic hydrogen, principal quantum number (n) of the upper state. A value of zero requests use of the Unsold approximation (1955). Examples: -7.510, '-7.510', 230.192, '230.192', 3, '3', 0, or '0.000'.

Type:float or str that yields a float
gamvw

Van der Waals damping parameter (line FWHM per perturber in units of rad/s cm**3) at 10000 K for collisions with neutral species. For species other than hydrogen:

  • A value less than zero is the base 10 logarithm of the damping parameter. Examples: -7.510 or '-7.510'.
  • A value of zero indicates that no damping parameter is specified. In such cases, SME uses a modified Unsold (1955) approximation to calculate the damping parameter. Examples: 0 or '0.000'.
  • A value greater than 20 is the broadening cross section (sigma in atomic units) at 10 km/s and the velocity exponent (alpha), packed into a single parameter, int(sigma)+alpha. See Barklem (1998) for more information. Examples: 230.192 or '230.192'.

For atomic hydrogen:

  • Principal quantum number (n) of the upper state. Examples: 3 or '3'.
Type:float or str that yields a float

Notes

These parameter conventions are used by the Vienna Atomic Line Database (VALD) extract stellar service, except that VALD users may select other units for wlcent and excit. Other conventions (e.g., ionization state expressed by a roman numeral) are not valid in SME.

References

Examples

>>> line = SmeLine('H 1', '6564.61', '10.20', '0.71', '8.766', '2', '3')
>>> line = SmeLine('Co 1', 6565.21, 2.042, 3.93, 7.70, -6.14, 270.243)
__eq__(other)

Test whether two SmeLine objects have identical lines parameters.

Parameters:other (SmeLine object) – Another spectral line to compare with this spectral line.

Examples

>>> line1 = SmeLine('Co 1', 6565.21, 2.042, 3.93, 7.70, -6.14, 270.243)
>>> line2 = SmeLine('Co 1', 6565.21, 2.042, 3.93, 7.70, -6.14, 270.243)
>>> line1 == line2, line1.__eq__(line2), line1 is line2
(True, True, False)
__repr__()

Return python string representation of this object.

Examples

>>> line = SmeLine('Co 1', 6565.21, 2.042, 3.93, 7.70, -6.14, 270.243)
>>> repr(line)
"SmeLine('Co 1', 6565.2100, 2.0420, 3.930, 7.700,-6.140, 270.243)"
__str__()

Return line data as a string in VALD extract sellar short format.”

Example

>>> print(line)
'Co 1',       6565.2100,   2.0420,  3.930, 7.700,-6.140, 270.243
class sme.vald.ValdFile(filename, standard=True)

Contents of a VALD3 line data file.

parse_abund(lines)

Parse VALD abundance lines from a VALD line data file.

parse_header(lines)

Parse header lines from a VALD line data file. Presence of wavelength medium (‘_air’ or ‘_vac’) implies VALD3.

parse_isotopes(line)

Infer whether isotopic scaling was applied in VALD line data file.

parse_linedata(lines)

Parse line data from a VALD line data file.

parse_valdatmo(lines)

Parse VALD model atmosphere line from a VALD line data file.

read(filename)

Read and parse file from the VALD extract stellar service.

standardize()

Convert linelist wavelengths to vacuum Angstroms and energies to eV.

If input wavelength units are inverse centimeters, reverse the wavelength range and reverse the order of lines in the linelist.

If any input wavelengths are bluer than 2000 Angstroms, search for the first air wavelength, which can be slightly below 2000 Angstroms (see docstring for util._first_air_wavelength).

exception sme.vald.ValdFileError

Raise when attempt to read a VALD line data file fails.

class sme.vald.ValdLongLine(chunk)

Data for one atomic or molecular line from a long-format VALD file.

class sme.vald.ValdShortLine(line, wlmedium=None, wlunits=None, exunits=None)

Data for one atomic or molecular line from a short-format VALD file.

__repr__()

Return python string representation of this object.

__str__()

Return line data as they would appear in a VALD line data file.

class sme.vald.ValdShortRef(shortref)

Reference information for one transition in a short format VALD file.

__str__()

Return references as they would appear in a short format VALD file.