radis.lbl.overp module

Created on Thu Sep 14 13:44:35 2017.

@author: erwan

Summary

An experimental module to merge precalculated vibrational bands in post-processing, and recompute a new spectrum at a new temperature or with overpopulations, without having to recalculate the broadening of each line

Warning

Order of magnitude faster, but only valid under optically thin conditions as the rescaling of absorption doesnt scale induced emission properly


class LevelsList(parfunc, bands, levelsfmt, sortby='Ei', copy_lines=False, verbose=True)[source]

Bases: object

A class to generate a Spectrum from a list of precalculated bands at a given reference temperature.

Warning

only valid under optically thin conditions!!

E_bands[source]
Qref[source]
Qvib_ref[source]
Trot_ref[source]
Tvib_ref[source]
bands[source]
bands_ref[source]
copy_lines[source]
cum_weight[source]
eq_spectrum(Tgas, overpopulation=None, mole_fraction=None, path_length=None, save_rescaled_bands=False)[source]

See eq_spectrum()

Warning

only valid under optically thin conditions!!

Parameters
  • … same as usually. If None, then the reference value (used to

  • calculate bands) is used

Other Parameters

save_rescaled_bands (boolean) – save updated bands. Take some time as it requires rescaling all bands individually (which is only done on the MergedSlabs usually) Default False

levelsfmt[source]
lvl_index[source]
mole_fraction_ref[source]
non_eq_spectrum(Tvib=None, Trot=None, Ttrans=None, vib_distribution='boltzmann', overpopulation=None, mole_fraction=None, path_length=None, save_rescaled_bands=False)[source]

See non_eq_spectrum()

Warning

only valid under optically thin conditions!!

Parameters
  • … same as usually. If None, then the reference value (used to

  • calculate bands) is used

Other Parameters

save_rescaled_bands (boolean) – save updated bands. Take some time as it requires rescaling all bands individually (which is only done on the MergedSlabs usually) Default False

Notes

Implementation:

Generation of a new spectrum is done by recombination of the precalculated bands with

parfunc[source]
path_length_ref[source]
plot_vib_populations(nfig=None, **kwargs)[source]

Plot current distribution of vibrational levels.

By constructions populations are shown as divided by the state degeneracy, i.e, g = gv * (2J+1) * gi * gs

Parameters
  • nfig (str, int) – name of Figure to plot on

  • kwargs (**dict) – arguments are forwarded to plot()

sorted_bands[source]
verbose[source]
vib_distribution_ref[source]
vib_levels[source]
rescale_updown_levels(spec, new_nu, old_nu, new_nl, old_nl, ignore_warnings=False, force=False)[source]

Update spectrum with new molar fraction for upper and lower levels.

Convoluted values (with slit) are dropped in the process.

Rescales with a ratio new_nu/old_nu.

This is only valid for emission quantities, under optically thin conditions, as rescaling doesnt correct for induced emission.

Warning

experimental feature

Parameters
  • new_nu (float) – new upper state mole fraction

  • old_nu (float) – current upper state mole fraction

  • new_nl (float) – new lower state mole fraction

  • old_nl (float) – current lower state mole fraction

Other Parameters

force (boolean) – if False, won’t allow rescaling to 0 (not to loose information). Default False

Notes

Implementation:

similar to rescale_path_length() but we have to scale abscoeff & emisscoeff Note that this is valid only for small changes in mole fractions. Then, the change in line broadening becomes significant and the whole band should be recomputed

IMPORTANT: if editing make sure you use the proper nu and nl. In particular when infering emission quantities from absorption quantities this may ends up in error in overpopulation rescaling.