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 inferring emission quantities from absorption quantities this may ends up in error in overpopulation rescaling.