.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_explore_database_vaex.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_explore_database_vaex.py: .. _example_explore_database_vaex: ================================ Explore Line Database Parameters ================================ Database will be downloaded automatically and can be edited locally. The :ref:`Download HITEMP Database example ` showed how to download the HITEMP database under Pandas format. RADIS can also be used to explore and visualize larger databases, using the underlying :py:mod:`vaex` library. .. GENERATED FROM PYTHON SOURCE LINES 18-24 .. code-block:: default from radis.io.hitemp import fetch_hitemp df = fetch_hitemp("CO2", output="vaex", load_wavenum_min=2150, load_wavenum_max=2450) print(f"{len(df)} lines in HITEMP CO2; 2150 - 2450 cm-1") .. rst-class:: sphx-glr-script-out .. code-block:: none HITEMP keep only relevant input files: ['/home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5', '/home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5'] HITEMP keep only relevant input files: ['/home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5', '/home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5'] Downloading 02_02125-02250_HITEMP2010.zip for CO2 (1/2). Download complete. Parsing CO2 database to /home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5 Downloading 02_02250-02500_HITEMP2010.zip for CO2 (2/2). Download complete. Parsing CO2 database to /home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5 Added HITEMP-CO2 database in /home/docs/radis.json HITEMP keep only relevant input files: ['/home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5', '/home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5'] 1355761 lines in HITEMP CO2; 2150 - 2450 cm-1 .. GENERATED FROM PYTHON SOURCE LINES 25-34 Note the use of `output='vaex'` in :py:func:`~radis.io.hitemp.fetch_hitemp` above. The returned DataFrame is a Vaex DataFrame. Loading times takes only few tens of milliseconds even for the largest HITEMP or ExoMol databases We can also use Vaex graph functions. See Vaex vizualisations : https://vaex.readthedocs.io/en/latest/guides/advanced_plotting.html# For instance, we plot a :py:func:`~vaex.viz.DataFrameAccessorViz.heatmap` showing Self and Air-broadening coefficients .. GENERATED FROM PYTHON SOURCE LINES 34-41 .. code-block:: default import matplotlib.pyplot as plt plt.figure() df.viz.heatmap("airbrd", "selbrd", limits="99%") # TODO / idea : compare CO2 broadening with Air broadening for HITRAN database ? .. image-sg:: /auto_examples/images/sphx_glr_plot_explore_database_vaex_001.png :alt: plot explore database vaex :srcset: /auto_examples/images/sphx_glr_plot_explore_database_vaex_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 42-43 Or below we plot the number of lines using Vaex's :py:func:`~vaex.viz.DataFrameAccessorViz.histogram` .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: default plt.figure() df.viz.histogram("wav", shape=1000) plt.yscale("log") .. image-sg:: /auto_examples/images/sphx_glr_plot_explore_database_vaex_002.png :alt: plot explore database vaex :srcset: /auto_examples/images/sphx_glr_plot_explore_database_vaex_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 1 minutes 12.068 seconds) .. _sphx_glr_download_auto_examples_plot_explore_database_vaex.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_explore_database_vaex.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_explore_database_vaex.ipynb `