Absorption Data

Spectral Lines

The model is designed to use the HITRAN database of spectral line data for various atmospheric gases. To download line data, you must register for a free account then search for lines. It is generally best to download all lines for a single gas into a single file, which will have a .par extension. These are text files in fixed-width format and they can be read by functions in ClearSky.

To work with spectral line data directly, use the readpar function to load the data. This function simply parses the fixed-width file into a dictionary of vectors with the appropriate data types. For more information, see the readpar documentation.

If you plan to compute line shapes directly, read par files into SpectralLines objects. The constructor reads files using readpar then rearranges it for line shape calculations. Unnecessary information is dropped and the molecule name, formula, and molar masses are assigned. To compute line shapes, see Computing Line Shapes.

For only high-level calculations, par files can also be loaded directly into gas objects.

readpar(filename; νmin=0, νmax=Inf, Scut=0, I=[], maxlines=-1)

Read an absoption line file from the HITRAN database, which should have the ".par" extension. These files are available at https://hitran.org/lbl after registering for a free account.

Keyword Arguments

  • νmin: smallest line wavenumber to include
  • νmax: largest line wavenumber to include
  • Scut: smallest spectral line intensity
  • I: array of isotopologue numbers to include (excludes all others)
  • maxlines: maximum number of lines to include (includes only the most intense maxlines lines)

A dictionary of vectors is returned, reflecting the definitions from

  1. HITRAN website
  2. Rothman, Laurence S., et al. "The HITRAN 2004 molecular spectroscopic database." Journal of quantitative spectroscopy and radiative transfer 96.2 (2005): 139-204.
KeyVector TypeDescription
MInt16HITRAN molecular identification number
ICharHITRAN isotopologue identification symbol
νFloat64spectral line wavenumber [cm$^{-1}$] in a vacuum
SFloat64spectral line intensity [cm$^{-1}$/(molecule$\cdot$cm$^{-2}$)] at 296 K
AFloat64Einstein-A coefficient (s$^{-1}$) of a transition
γaFloat64air-broadened half width at half maximum (HWHM) [cm$^{-1}$/atm] at 296 K and 1 atm
γsFloat64self-broadened half width at half maximum (HWHM) [cm$^{-1}$/atm] at 296 K and 1 atm
EppFloat64lower-state energy of the transition [cm$^{-1}$]
naFloat64coefficient of temperature dependence of air-broadened half width
δaFloat64pressure shift [cm$^{-1}$/atm] at 296 K and 1 atm of the line position with respect to vacuum transition wavenumber
VpStringupper-state "global" quanta
VppStringlower-state "global" quanta
QpStringupper-state "local" quanta
QppStringlower-state "local" quanta
IerrStringuncertainty indices
IrefStringreference indices
*Charflag (?)
gpStringstatistical weight of upper state
gppStringstatistical weight of lower state

Organizing type for spectral line data of a single gas

nameStringgas name
formulaStringgas formula
NInt64number of lines
MInt16see readpar
IVector{Int16}see readpar
μVector{Float64}molar mass of isotopologues [kg/mole]
AVector{Float64}isotopologue abundance (Earth)
νVector{Float64}see readpar
SVector{Float64}see readpar
γaVector{Float64}see readpar
γsVector{Float64}see readpar
EppVector{Float64}see readpar
naVector{Float64}see readpar



Construct a SpectralLines object from a dictionary of line data. That dictionary can be created with readpar.

SpectralLines(filename, νmin=0, νmax=Inf, Scut=0, I=[], maxlines=-1)

Read a .par file directly into a SpectralLines object. Keyword arguments are passed through to readpar.

Collision Induced Absorption (CIA)

The model also makes it easy to include CIA data from HITRAN. These files can be downloaded directly or all at once using the download_cia.py script. Each file contains potentially many tables of absorption data at different wavenumbers and temperatures.

Like the line data, there is a function for reading these CIA files without doing anything else. The readcia function reads a cia file into a vector of dictionaries. Each dictionary represents a table of absorption data. This is the raw data, but it is relatively hard to work with.

A CIATables object arranges each table of absorption data into an interpolator and makes it easy to compute the CIA absorption coefficient at any wavenumber and temperature. Also, in combination with the cia function, a CIATables can be used to compute absorption cross-sections from provided wavenumber, temperature, and partial pressures.


Read a collision induced absorption data file. These files are available from HITRAN and desribed by this readme. A vector of dictionaries is returned. Each dictionary represents absorption coefficients for a single temperature over a range of wavenumbers. Each dictionary contains:

symbolStringchemical symbol
νminFloat64minimum wavenumber of absorption range [cm$^{-1}$]
νmaxFloat64maximum wavenumber of absorption range [cm$^{-1}$]
nptsInt64number of points
TFloat64temperature for absorption data [K]
νVector{Float64}wavenumber samples [cm$^{-1}$]
kVector{Float64}absorption coefficients [cm$^5$/molecule$^2$]
maxciaFloat64maximum absorption coefficient [cm$^5$/molecule$^2$]
commentsStringmiscelleneous comments
referenceInt64indices of data references

Organizing type for collision induced absorption data, with data tables loaded into interpolators.

nameStringmolecular symbol, i.e. "CO2-H2"
formulaeTuple{String,String}split molecular formulae, i.e ("CO2", "H2")
ΦVector{BilinearInterpolator}interpolators for each grid of absorption coefficients
ϕVector{LinearInterpolator}interpolators for isolated ranges of absorption coefficients
TVector{Float64}temperatures [K] for single ranges in ϕ
extrapolateBoolwhether to extrapolate using flat boundaries from the coefficient grids in Φ
singlesBoolwhether to use the single ranges in ϕ at all

The interpolator objects are described in the BasicInterpolators.jl documentation.


CIATables(cia::Vector{Dict}; extrapolate=false, singles=false, verbose=true)

Construct a CIATables object from a dictionary of coefficient data, which can be read from files using readcia. Keywords extrapolate and singles are used to set those fields of the returned object.

CIATables(filename; extrapolate=false, singles=false, verbose=true)

Construct a CIATables object directly from file, using readcia along the way.


A CIATables object is function-like. To retrieve the absorption coefficient at a given wavenumber [cm$^{-1}$] and temperature [K], use the object like a function.

co2co2 = CIATables("data/cia/CO2-CO2_2018.cia"); #read data
ν = 100; #wavenumber [cm^-1]
T = 288; #temperature [K]
k = co2co2(ν, T) #absorption coefficient [cm^5/molecule^2]

The object interpolates and sums all data tables that contain ν and T. If extrapolate is true, boundary values are included whenever the temperature is out of range. If singles is true, data ranges for a single temperature are included whenever they contain ν.

A CIATables can be passed to the cia function to compute an absorption cross-section with different temperatures and pressures.

co2ch4 = CIATables("data/cia/CO2-CH4_2018.cia"); #read data
ν = 250; #wavenumber [cm^-1]
T = 310 #temperature [K]
Pair = 1e5; #air pressure [Pa]
Pco2 = 40; #CO2 partial pressure [Pa]
Pch4 = 0.1; #CH4 partial pressure [Pa]
σ = cia(ν, co2ch4, T, Pair, Pco2, Pch4) #absorption cross-section [cm^2/molecule]