.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_nonequilibrium_co_spectrum.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Run this example online : - Click :ref:`here ` to download the full example code - Then start `Radis-Lab `__, upload the Jupyter notebook, and run it from there. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_nonequilibrium_co_spectrum.py: ============================================ Calculate non-LTE spectra of carbon-monoxide ============================================ Compute a CO spectrum with the temperature of the vibrational mode different from the temperature of the rotational mode. This example uses the :py:func:`~radis.lbl.calc.calc_spectrum` function, the [HITRAN-2016]_ line database to derive the line positions and intensities, and the default RADIS spectroscopic constants to compute nonequilibrium energies and populations, but it can be extended to other line databases and other sets of spectroscopic constants. .. GENERATED FROM PYTHON SOURCE LINES 18-41 .. image-sg:: /auto_examples/images/sphx_glr_plot_nonequilibrium_co_spectrum_001.png :alt: plot nonequilibrium co spectrum :srcset: /auto_examples/images/sphx_glr_plot_nonequilibrium_co_spectrum_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Using /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_1 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_1.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_1.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_1.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_1.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_1.header END DOWNLOAD Lines parsed: 1344 PROCESSED Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_2 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_2.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_2.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_2.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_2.header END DOWNLOAD Lines parsed: 1042 PROCESSED Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_3 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_3.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_3.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_3.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_3.header END DOWNLOAD Lines parsed: 920 PROCESSED Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_4 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_4.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_4.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_4.header END DOWNLOAD Lines parsed: 800 PROCESSED Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_5 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_5.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_5.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_5.header END DOWNLOAD Lines parsed: 674 PROCESSED Data is fetched from http://hitran.org BEGIN DOWNLOAD: CO_6 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_6.data 65536 bytes written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_6.data Header written to /home/docs/.radisdb/hitran/downloads__can_be_deleted/CO/CO_6.header END DOWNLOAD Lines parsed: 601 PROCESSED Added HITRAN-CO database in /home/docs/radis.json Calculating energy levels with Dunham expansion for CO(X1Σ+)(iso1) Database generated up to v=48, J=238 Calculating energy levels with Dunham expansion for CO(X1Σ+)(iso2) Database generated up to v=48, J=243 Calculating energy levels with Dunham expansion for CO(X1Σ+)(iso3) Database generated up to v=48, J=243 Calculating Non-Equilibrium Spectrum Physical Conditions ---------------------------------------- Tgas 300.0 K Trot 300.0 K Tvib 700.0 K isotope 1,2,3 mole_fraction 0.1 molecule CO path_length 1.0 cm pressure_mbar 1013.25 mbar rot_distribution boltzmann self_absorption True state X vib_distribution boltzmann wavenum_max 2300.0000 cm-1 wavenum_min 1900.0000 cm-1 Computation Parameters ---------------------------------------- Tref 296 K add_at_used broadening_method voigt cutoff 1e-27 cm-1/(#.cm-2) dbformat hitran dbpath /home/docs/.radisdb/hitran/CO.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 auto truncation 50 cm-1 waveunit cm-1 wstep 0.01 cm-1 zero_padding -1 ---------------------------------------- Fetching Evib & Erot. /home/docs/checkouts/readthedocs.org/user_builds/radis/envs/master/lib/python3.8/site-packages/radis/misc/warning.py:354: NegativeEnergiesWarning: There are negative rotational energies in the database /home/docs/checkouts/readthedocs.org/user_builds/radis/envs/master/lib/python3.8/site-packages/radis/misc/warning.py:354: PerformanceWarning: 'gu' was recomputed although 'gp' already in DataFrame. All values are equal ... sorting lines by vibrational bands ... lines sorted in 0.0s 0.19s - Spectrum calculated | .. code-block:: default from astropy import units as u from radis import calc_spectrum s2 = calc_spectrum( 1900 / u.cm, 2300 / u.cm, molecule="CO", isotope="1,2,3", pressure=1.01325 * u.bar, Tvib=700 * u.K, Trot=300 * u.K, mole_fraction=0.1, path_length=1 * u.cm, databank="hitran", # or use 'hitemp' ) s2.plot("radiance_noslit") # Apply a (large) instrumental slit function : s2.apply_slit(10, "nm") s2.plot("radiance", nfig="same", lw=2) # compare with previous .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.418 seconds) .. _sphx_glr_download_auto_examples_plot_nonequilibrium_co_spectrum.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_nonequilibrium_co_spectrum.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_nonequilibrium_co_spectrum.ipynb `