Use Custom Abundances

Custom isotopologue abundances can be defined, to model non-terrestrial atmospheres.

Abundances are read and set directly in the SpectrumFactory using the get_abundance() and set_abundance() methods.

Below, we compute a CO2 spectrum with custom abundances for the two main terrestrial isotopes (12C-16O2 ; 13C-16O2)

See Also

MolParams

from radis.test.utils import setup_test_line_databases

setup_test_line_databases()  # creates "HITEMP-CO2-TEST" for this example

from radis import SpectrumFactory

sf = SpectrumFactory(
    2284.2,
    2284.6,
    wstep=0.001,  # cm-1
    pressure=20 * 1e-3,  # bar
    mole_fraction=400e-6,
    molecule="CO2",
    isotope="1,2",
    verbose=False,
)
sf.load_databank("HITEMP-CO2-TEST")

Out:

/home/docs/checkouts/readthedocs.org/user_builds/radis/envs/latest/lib/python3.8/site-packages/radis/misc/warning.py:350: MissingReferenceWarning:

Missing doi for CDSD-HITEMP. Use HITEMP-2010?
print(sf.molparam.get("CO2", 1, "isotope_name"))  # >> (12C)(16O)2
print(sf.molparam.get("CO2", 2, "isotope_name"))  # >> (13C)(16O)2

Out:

(12C)(16O)2
(13C)(16O)2
print("Abundance of CO2[1,2]", sf.get_abundance("CO2", [1, 2]))
sf.eq_spectrum(2000).plot("abscoeff")
plot custom abundances

Out:

Abundance of CO2[1,2] [0.984204  0.0110574]

<matplotlib.lines.Line2D object at 0x7f822dfb8220>
sf.set_abundance("CO2", [1, 2], [0.8, 0.2])
print("New abundance of CO2[1,2]", sf.get_abundance("CO2", [1, 2]))

sf.eq_spectrum(2000).plot("abscoeff", nfig="same")
plot custom abundances

Out:

New abundance of CO2[1,2] [0.8 0.2]

<matplotlib.lines.Line2D object at 0x7f822de9cbb0>

Total running time of the script: ( 0 minutes 1.848 seconds)

Gallery generated by Sphinx-Gallery