Note
Run this example online :
Calculate a spectrum from HITEMP¶
Auto-download and compute a CO spectrum from HITEMP ([HITEMP-2010]).
Compare with HITRAN-2016 ([HITRAN-2016]).

Downloading 05_HITEMP2019.par.bz2 for CO (1/1).
Download complete. Parsing CO database to /home/docs/.radisdb/hitemp/CO-05_HITEMP2019.hdf5
Added HITEMP-CO database in /home/docs/radis.json
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
Tgas 2000 K
Trot 2000 K
Tvib 2000 K
isotope 1
mole_fraction 0.1
molecule CO
overpopulation None
path_length 1 cm
pressure 3 bar
rot_distribution boltzmann
self_absorption True
state X
vib_distribution boltzmann
wavenum_max 2170.0000 cm-1
wavenum_min 2135.0000 cm-1
Computation Parameters
----------------------------------------
Tref 296 K
add_at_used cython
broadening_method voigt
cutoff 1e-27 cm-1/(#.cm-2)
dbformat hitemp-radisdb
dbpath /home/docs/.radisdb/hitemp/CO-05_HITEMP2019.hdf5
folding_thresh 1e-06
include_neighbouring_lines True
memory_mapping_engine auto
neighbour_lines 0 cm-1
optimization simple
parfuncfmt hapi
parsum_mode full summation
pseudo_continuum_threshold 0
sparse_ldm True
truncation 50 cm-1
waveunit cm-1
wstep 0.01 cm-1
zero_padding 3502
----------------------------------------
0.03s - Spectrum calculated
Added HITRAN-CO2-TEST database in /home/docs/radis.json
Added HITRAN-CO-TEST database in /home/docs/radis.json
Added HITEMP-CO2-TEST database in /home/docs/radis.json
Added HITEMP-CO2-HAMIL-TEST database in /home/docs/radis.json
Using database: HITRAN-CO-TEST
'HITRAN-CO-TEST':
{'info': 'HITRAN 2016 database, CO, 3 main isotopes (CO-26, 36, 28), 2000-2300 cm-1', 'path': ['/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/test/files/hitran_co_3iso_2000_2300cm.par'], 'format': 'hitran', 'parfuncfmt': 'hapi', 'levelsfmt': 'radis'}
Generating cache file /home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/test/files/hitran_co_3iso_2000_2300cm.h5 with metadata :
{'last_modification': 'Mon Nov 27 09:25:51 2023', 'wavenum_min': 2000.052539, 'wavenum_max': 2298.445736}
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:427: HighTemperatureWarning:
HITRAN is valid for low temperatures (typically < 700 K). For higher temperatures you may need HITEMP or CDSD. See the 'databank=' parameter
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:427: PerformanceWarning:
'object' type column found in database, calculations and memory usage would be faster with a numeric type. Possible solution is to not use 'save_memory' and convert the columns to dtype.
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
Tgas 2000 K
Trot 2000 K
Tvib 2000 K
isotope 1
mole_fraction 0.1
molecule CO
overpopulation None
path_length 1 cm
pressure 3 bar
rot_distribution boltzmann
self_absorption True
state X
vib_distribution boltzmann
wavenum_max 2170.0000 cm-1
wavenum_min 2135.0000 cm-1
Computation Parameters
----------------------------------------
Tref 296 K
add_at_used cython
broadening_method voigt
cutoff 1e-27 cm-1/(#.cm-2)
dbformat hitran
dbpath /home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/test/files/hitran_co_3...
folding_thresh 1e-06
include_neighbouring_lines True
memory_mapping_engine auto
neighbour_lines 0 cm-1
optimization simple
parfuncfmt hapi
parsum_mode full summation
pseudo_continuum_threshold 0
sparse_ldm True
truncation 50 cm-1
waveunit cm-1
wstep 0.01 cm-1
zero_padding 3502
----------------------------------------
0.03s - Spectrum calculated
(<Figure size 640x480 with 2 Axes>, [<Axes: >, <Axes: xlabel='Wavenumber (cm⁻¹)'>])
from radis import calc_spectrum
s = calc_spectrum(
2135,
2170, # cm-1
molecule="CO",
isotope="1",
pressure=3, # bar
Tgas=2000, # K
mole_fraction=0.1,
path_length=1, # cm
databank="hitemp", # latest version is fetched
name="HITEMP-2020",
)
from radis.test.utils import setup_test_line_databases
setup_test_line_databases()
s2 = calc_spectrum(
2135,
2170, # cm-1
molecule="CO",
isotope="1",
pressure=3, # bar
Tgas=2000, # K
mole_fraction=0.1,
path_length=1, # cm
databank="HITRAN-CO-TEST", # we could also have fetched the latest HITRAN with "databank='hitran'"
name="HITRAN-2016",
)
# Compare:
from radis import plot_diff
plot_diff(s, s2)
Total running time of the script: (0 minutes 25.028 seconds)