Atomic spectrum #1: Atomic partition functions

The architecture allows multiple sources of partition functions each of which can be used with any atomic databank. The source is specified by the pfsource parameter of SpectrumFactory. There are currently 3 sources implemented:
  • ‘barklem’: an interpolator that uses a table of partition functions from [Barklem-&-Collet-2016]

  • ‘kurucz’ an interpolator that uses a table of partition functions provided with some Kurucz linelists

  • ‘nist’ a calculator that calculates the partition function from a table of energy levels provided by NIST

The partition functions from all 3 sources depend on temperature, but those from ‘kurucz’ also depend on potential lowering, which can be set with the potential_lowering parameter of SpectrumFactory.

The default pfsource is ‘nist’. It can be changed on the fly using the set_atomic_partition_functions() method, and the potential lowering for ‘kurucz’ can be modified on the fly by changing the sf.input.potential_lowering attribute of the SpectrumFactory instance sf. The changes are reflected the next time a partition function is calculated.

Allowable values for potential_lowering are usually (in cm-1/Zeff**2): -500, -1000, -2000, -4000, -8000, -16000, -32000.

import traceback

from radis import calc_spectrum

T_high = 50000  # K
s, sf = calc_spectrum(
    205,
    263,
    wunit="nm",
    species="Y_I",
    Tgas=T_high,
    databank="kurucz",
    pfsource="nist",
    return_factory=True,
    save_memory=False,  # to be able to recalculate spectra with the same SpectrumFactory
)

s.plot("radiance_noslit", wunit="cm-1")
plot 1partitionFunction potentialLowering
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: The required columns for Kurucz don't match those of existing moleculear databases, so all columns are being loaded
  warnings.warn(WarningType(message))
Attempting to download http://kurucz.harvard.edu/atoms/3900/gf3900.all
- Downloading gf3900.all (1/1)

Downloading:   0%|          | 0.00/848k [00:00<?, ?B/s]
Downloading:  13%|█▎        | 112k/848k [00:00<00:00, 1.05MB/s]
Downloading:  65%|██████▌   | 552k/848k [00:00<00:00, 2.87MB/s]
Downloading: 100%|██████████| 848k/848k [00:00<00:00, 3.53MB/s]
Successfully downloaded http://kurucz.harvard.edu/atoms/3900/gf3900.all
Added Kurucz-Y_I database in /home/docs/radis.json
- Downloading energy1.pl?spectrum=Y_I&units=0&format=3&output=0&level_out=on&g_out=on (1/1)

Downloading: 0.00B [00:00, ?B/s]
Downloading: 3.99kB [00:00, 151kB/s]
3.22s - Loaded database
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
   Tgas                 50000 K
   isotope              0
   medium               air
   mole_fraction        1
   path_length          1 cm
   pressure             1.01325 bar
   self_absorption      True
   species              Y_I
   state                X
   wavenum_max          48764.8634 cm-1
   wavenum_min          38011.4779 cm-1
Computation Parameters
----------------------------------------
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               1e-27 cm-1/(#.cm-2)
   dbformat             kurucz
   dbpath               /home/docs/.radisdb/kurucz/Y_I-gf3900.h5
   diluent              H
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               True
   isneutral            True
   lbfunc               None
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             nist
   potential_lowering   None
   pseudo_continuum_threshold  0
   sparse_ldm           True
   truncation           50 cm-1
   waveunit             cm-1
   wstep                0.01 cm-1
   zero_padding         1075340
----------------------------------------
0.19s - Spectrum calculated

<matplotlib.lines.Line2D object at 0x73bbeacbf8c0>

We can change the pfsource to ‘kurucz’:

- Downloading partfn3900.dat (1/1)

Downloading:   0%|          | 0.00/30.5k [00:00<?, ?B/s]
Downloading: 100%|██████████| 30.5k/30.5k [00:00<00:00, 1.21MB/s]

but if we run anything that attempts to calculate a partition function, we get an error:

try:
    sf.eq_spectrum(T_high)
except Exception:
    print(traceback.format_exc())
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 49, in <module>
    sf.eq_spectrum(T_high)
    ~~~~~~~~~~~~~~^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2412, in Qgas
    Q = self.parsum.at(Tgas, self.input.potential_lowering)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1182, in at
    raise Exception("Please specify the potential lowering.")
Exception: Please specify the potential lowering.

until we specify the potential lowering:

sf.input.potential_lowering = (
    -500
)  # any of [-500, -1000, -2000, -4000, -8000, -16000, -32000]
s2 = sf.eq_spectrum(T_high)
s2.plot("radiance_noslit", wunit="cm-1")
plot 1partitionFunction potentialLowering
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
   Tgas                 50000 K
   isotope              0
   medium               air
   mole_fraction        1
   path_length          1 cm
   pressure             1.01325 bar
   self_absorption      True
   species              Y_I
   state                X
   wavenum_max          48764.8634 cm-1
   wavenum_min          38011.4779 cm-1
Computation Parameters
----------------------------------------
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               1e-27 cm-1/(#.cm-2)
   dbformat             kurucz
   dbpath               /home/docs/.radisdb/kurucz/Y_I-gf3900.h5
   diluent              H
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               True
   isneutral            True
   lbfunc               None
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             kurucz
   potential_lowering   -500
   pseudo_continuum_threshold  0
   sparse_ldm           True
   truncation           50 cm-1
   waveunit             cm-1
   wstep                0.01 cm-1
   zero_padding         1075340
----------------------------------------
0.18s - Spectrum calculated

<matplotlib.lines.Line2D object at 0x73bbe1e53770>

In this case, 50 000 K is beyond the maximal temperature in ‘barklem’.

sf.set_atomic_partition_functions("barklem")

try:
    sf.eq_spectrum(T_high)
except ValueError:
    print(traceback.format_exc())
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 69, in <module>
    sf.eq_spectrum(T_high)
    ~~~~~~~~~~~~~~^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2414, in Qgas
    Q = self.parsum.at(Tgas)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 166, in at
    return self._at(T)
           ~~~~~~~~^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1241, in _at
    raise OutOfBoundError(
        f"The temperature {T} K is outside the tabulated range of the partition functions [{Temp.min()}, {Temp.max()}] K for Barklem & Collet (2016)"
    )
radis.misc.warning.OutOfBoundError: The temperature 50000 K is outside the tabulated range of the partition functions [1e-05, 10000.0] K for Barklem & Collet (2016)

In this case, 99 K is within the temperature range of ‘barklem’:

T_low = 99  # K
s2 = sf.eq_spectrum(Tgas=T_low)
s2.plot("radiance_noslit", wunit="cm-1")
plot 1partitionFunction potentialLowering
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: AccuracyWarning: Some lines are too narrow (FWHM ~ 0.029 cm⁻¹) for the current spectral grid (wstep=0.01). Please reduce wstep to below 0.0096 cm⁻¹. You can use wstep='auto' to get the optimal spectral grid value. You can also ignore by setting `warnings={'AccuracyWarning':'ignore'}` or change the 'GRIDPOINTS_PER_LINEWIDTH_WARN_THRESHOLD' key of radis.config / your ~/radis.json (if you know what you're doing!)
  warnings.warn(WarningType(message))
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
   Tgas                 99 K
   isotope              0
   medium               air
   mole_fraction        1
   path_length          1 cm
   pressure             1.01325 bar
   self_absorption      True
   species              Y_I
   state                X
   wavenum_max          48764.8634 cm-1
   wavenum_min          38011.4779 cm-1
Computation Parameters
----------------------------------------
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               1e-27 cm-1/(#.cm-2)
   dbformat             kurucz
   dbpath               /home/docs/.radisdb/kurucz/Y_I-gf3900.h5
   diluent              H
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               True
   isneutral            True
   lbfunc               None
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             barklem
   potential_lowering   -500
   pseudo_continuum_threshold  0
   sparse_ldm           True
   truncation           50 cm-1
   waveunit             cm-1
   wstep                0.01 cm-1
   zero_padding         1075340
----------------------------------------
0.17s - Spectrum calculated

<matplotlib.lines.Line2D object at 0x73bc37b323c0>

However, 99 K is not within the temperature range of ‘kurucz’:

sf.set_atomic_partition_functions(
    "kurucz"
)  # potential lowering is still -500 from above

try:
    sf.eq_spectrum(Tgas=T_low)
except ValueError:
    print(traceback.format_exc())
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 87, in <module>
    sf.eq_spectrum(Tgas=T_low)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2412, in Qgas
    Q = self.parsum.at(Tgas, self.input.potential_lowering)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1196, in at
    raise OutOfBoundError(
        f"The temperature {T} K is outside the tabulated range of the partition functions [{Temp.min()}, {Temp.max()}] K for Kurucz"
    )
radis.misc.warning.OutOfBoundError: The temperature 99 K is outside the tabulated range of the partition functions [100.0, 208930.0] K for Kurucz

Specifying a value for the potential lowering that isn’t present in the tables just returns a KeyError when attempting to calculate:

sf.input.potential_lowering = -1100
try:
    sf.eq_spectrum(4000)
except KeyError:
    print(traceback.format_exc())
Available values of potential lowering:
-500, -1000, -2000, -4000, -8000, -16000, -32000
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/conda/latest/lib/python3.14/site-packages/pandas/core/indexes/base.py", line 3641, in get_loc
    return self._engine.get_loc(casted_key)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "pandas/_libs/index.pyx", line 168, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 197, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 7668, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 7676, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '-1100'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 97, in <module>
    sf.eq_spectrum(4000)
    ~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2412, in Qgas
    Q = self.parsum.at(Tgas, self.input.potential_lowering)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1186, in at
    Qvals = self.partfn[f"{potential_lowering}"]
            ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/conda/latest/lib/python3.14/site-packages/pandas/core/frame.py", line 4378, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/conda/latest/lib/python3.14/site-packages/pandas/core/indexes/base.py", line 3648, in get_loc
    raise KeyError(key) from err
KeyError: '-1100'

Partition functions could also be available for a species from one source but not another, e.g. available from ‘barklem’:

s, sf = calc_spectrum(
    39000,
    40000,
    species="Os_II",
    Tgas=4000,
    databank="kurucz",
    pfsource="barklem",
    return_factory=True,
    save_memory=False,
)

s.plot("radiance_noslit", wunit="cm-1")
plot 1partitionFunction potentialLowering
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: The required columns for Kurucz don't match those of existing moleculear databases, so all columns are being loaded
  warnings.warn(WarningType(message))
Attempting to download http://kurucz.harvard.edu/atoms/7601/gf7601.all
- Downloading gf7601.all (1/1)
Error downloading http://kurucz.harvard.edu/atoms/7601/gf7601.all: Unable to access the resource (HEAD request). Expected HTTP status code 200, got 404 for URL: http://kurucz.harvard.edu/atoms/7601/gf7601.all. Please verify the URL and your network access permissions.
Attempting to download http://kurucz.harvard.edu/atoms/7601/gf7601.pos
- Downloading gf7601.pos (1/1)
Error downloading http://kurucz.harvard.edu/atoms/7601/gf7601.pos: Unable to access the resource (HEAD request). Expected HTTP status code 200, got 404 for URL: http://kurucz.harvard.edu/atoms/7601/gf7601.pos. Please verify the URL and your network access permissions.
Attempting to download http://kurucz.harvard.edu/linelists/gfall/gf7601.all
- Downloading gf7601.all (1/1)

Downloading:   0%|          | 0.00/5.30k [00:00<?, ?B/s]
Downloading: 100%|██████████| 5.30k/5.30k [00:00<00:00, 245MB/s]
Successfully downloaded http://kurucz.harvard.edu/linelists/gfall/gf7601.all
Added Kurucz-Os_II database in /home/docs/radis.json
0.35s - Loaded database
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
   Tgas                 4000 K
   isotope              0
   medium               air
   mole_fraction        1
   path_length          1 cm
   pressure             1.01325 bar
   self_absorption      True
   species              Os_II
   state                X
   wavenum_max          40000.0000 cm-1
   wavenum_min          39000.0000 cm-1
Computation Parameters
----------------------------------------
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               1e-27 cm-1/(#.cm-2)
   dbformat             kurucz
   dbpath               /home/docs/.radisdb/kurucz/Os_II-gf7601.h5
   diluent              H
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               True
   isneutral            False
   lbfunc               None
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             barklem
   potential_lowering   None
   pseudo_continuum_threshold  0
   sparse_ldm           True
   truncation           50 cm-1
   waveunit             cm-1
   wstep                0.01 cm-1
   zero_padding         100002
----------------------------------------
0.58s - Spectrum calculated

<matplotlib.lines.Line2D object at 0x73bbe202cad0>

but not from ‘kurucz’, resulting in a warning when you try to set it as the pfsource:

sf.set_atomic_partition_functions(
    "kurucz"
)  # setting `potential_lowering` is irrelevant as the tables aren't even available
- Downloading partfn7601.dat (1/1)
a partition function file specific to this species was not found
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: `pfsource` kurucz is not available for the species Os_II. Try running `set_atomic_partition_functions` again with a different `pfsource`.
  warnings.warn(WarningType(message))

and an error if we attempt to calculate:

try:
    sf.eq_spectrum(4000)
except Exception:
    print(traceback.format_exc())
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 131, in <module>
    sf.eq_spectrum(4000)
    ~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2412, in Qgas
    Q = self.parsum.at(Tgas, self.input.potential_lowering)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1178, in at
    raise Exception(
        "Kurucz partition functions are unavailable for this species."
    )
Exception: Kurucz partition functions are unavailable for this species.

An example of the opposite, where ‘kurucz’ does include the species “Y_V”:

def lbfunc1(
    **kwargs,
):  # an arbitrary broadening formula as NIST databank requires `lbfunc`
    return 0.1 * (296 / kwargs["Tgas"]) ** 0.7, None


s, sf = calc_spectrum(
    40000,
    50000,
    species="Y_V",
    Tgas=4000,
    databank="nist",
    lbfunc=lbfunc1,
    cutoff=0,
    pfsource="kurucz",
    potential_lowering=-1000,
    return_factory=True,
    save_memory=False,
)

s.plot("radiance_noslit", wunit="cm-1")
plot 1partitionFunction potentialLowering
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: The required columns for NIST don't match those of existing moleculear databases, so all columns are being loaded
  warnings.warn(WarningType(message))
- Downloading lines1.pl?spectra=Y_V&low_w=&upp_w=&unit=1&format=3&line_out=1&en_unit=0&output=0&show_calc_wl=1&order_out=0&show_av=2&A_out=0&allowed_out=1&forbid_out=1&enrg_out=on&g_out=on (1/1)

Downloading: 0.00B [00:00, ?B/s]
Downloading: 21.6kB [00:00, 221kB/s]
Downloading: 31.8kB [00:00, 190kB/s]
Added NIST-Y_V database in /home/docs/radis.json
- Downloading partfn3904.dat (1/1)

Downloading:   0%|          | 0.00/30.5k [00:00<?, ?B/s]
Downloading: 100%|██████████| 30.5k/30.5k [00:00<00:00, 1.13MB/s]
1.91s - Loaded database
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: wavenumber shift not given in database: assumed 0 shift
  warnings.warn(WarningType(message))
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
   Tgas                 4000 K
   isotope              0
   medium               air
   mole_fraction        1
   path_length          1 cm
   pressure             1.01325 bar
   self_absorption      True
   species              Y_V
   state                X
   wavenum_max          50000.0000 cm-1
   wavenum_min          40000.0000 cm-1
Computation Parameters
----------------------------------------
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               0 cm-1/(#.cm-2)
   dbformat             nist
   dbpath               /home/docs/.radisdb/NIST/Y_V-lines1.h5
   diluent              H
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               True
   isneutral            False
   lbfunc               <function lbfunc1 at 0x73bbe201b740>
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             kurucz
   potential_lowering   -1000
   pseudo_continuum_threshold  0
   sparse_ldm           True
   truncation           50 cm-1
   waveunit             cm-1
   wstep                0.01 cm-1
   zero_padding         1000002
----------------------------------------
0.09s - Spectrum calculated

<matplotlib.lines.Line2D object at 0x73bbe8262f90>

but ‘barklem’ doesn’t:

sf.set_atomic_partition_functions("barklem")

try:
    sf.eq_spectrum(4000)
except Exception:
    print(traceback.format_exc())
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py:1220: UserWarning: Note: the partition functions from Barklem & Collet (2016) don't include this species.
  warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/misc/warning.py:435: UserWarning: `pfsource` barklem is not available for the species Y_V. Try running `set_atomic_partition_functions` again with a different `pfsource`.
  warnings.warn(WarningType(message))
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/examples/1_Spectra_handling/plot_1partitionFunction_potentialLowering.py", line 168, in <module>
    sf.eq_spectrum(4000)
    ~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/factory.py", line 872, in eq_spectrum
    self.calc_linestrength_eq(Tgas)  # scales S0 to S (equivalent to S0 in code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2604, in calc_linestrength_eq
    df1.A, df1.gu, df1.El, Ia, df1.wav, self.Qgas(df1, Tgas), Tgas
                                        ~~~~~~~~~^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/lbl/base.py", line 2414, in Qgas
    Q = self.parsum.at(Tgas)
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 166, in at
    return self._at(T)
           ~~~~~~~~^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/levels/partfunc.py", line 1233, in _at
    raise Exception(
        "The partition functions from Barklem & Collet (2016) don't include this species"
    )
Exception: The partition functions from Barklem & Collet (2016) don't include this species

References

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