Skip to content

Commit

Permalink
Merge branch 'radis:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarchotalia committed Jun 7, 2022
2 parents 87c03b7 + 1136890 commit bf4b8ba
Show file tree
Hide file tree
Showing 72 changed files with 4,086 additions and 1,687 deletions.
11 changes: 4 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "💩Bug Report"
name: "Bug Report"
description: "Create a bug report to help us improve Radis \U0001F331"
title: "💩 Bug Report: "
title: "Bug Report: "
labels: [bug]
body:
- type: markdown
Expand All @@ -24,15 +24,12 @@ body:
label: "💡 Possible solutions"
description: "Not obligatory, but suggest an idea for implementing addition or change"
placeholder: "It actually ..."
- type: dropdown
- type: input
id: radis-version
attributes:
label: "🎲 Radis version"
description: "What version of Radis are you running?(radis.get_version())"
options:
- Version 1.0.0
- Version 0.9.18
- Version 0.9.19

validations:
required: true
- type: dropdown
Expand Down
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
# Install Micromamba
# We do this conditionally because it saves us some downloading if the
# version is the same.
- wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
# For now use http instead of https according to this comment:
# https://github.com/mamba-org/mamba/issues/1675#issuecomment-1127160021
- wget -qO- http://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
- ./bin/micromamba shell init -s bash -p ~/micromamba
- source ~/.bashrc
- micromamba activate base
Expand All @@ -44,14 +46,20 @@ jobs:
# Your test script goes here
- echo ">>> Run tests"
# use XVFB to have headless display port, and still run the Matplotlib tests.
- xvfb-run pytest --cov=./
- xvfb-run -a pytest --cov=./
# lookup 'addopts' in setup.cfg>[tools:pytest] for default tests

services:
- xvfb

after_success:
# codecoverage
- pip install codecov
- codecov

before_script:
- export MPLBACKEND=Agg

- stage: lint
name: Code Quality Checks
install:
Expand Down
Binary file added docs/_static/assets/general/radisicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/_templates/buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@


<p>
</a>
<a href="https://radis.github.io/radis-lab/">
<img class="circle-icon"
src="{{ pathto('radis_ico.png', 1) }}"
alt="Radis-Website">
</a>
<a href="https://github.com/radis/radis">
<img class="circle-icon"
src="{{ pathto('_static/assets/general/button_github.svg', 1) }}"
Expand All @@ -31,4 +37,9 @@
src="{{ pathto('_static/assets/general/radislab.png', 1) }}"
alt="Radis-Lab">
</a>
<a href="https://radis.github.io/">
<img class="circle-icon"
src="{{ pathto('_static/assets/general/radisicon.png', 1) }}"
alt="Radis-Lab">
</a>
</p>
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def setup(app):
"fixed_sidebar": True,
"analytics_id": "UA-113616205-1",
"link": "#7A306C",
"extra_nav_links": {"RADIS Website": "https://radis.github.io/"},
}

# Add any paths that contain custom themes here, relative to this directory.
Expand Down Expand Up @@ -436,7 +437,7 @@ def setup(app):
"RADIS Documentation",
author,
"RADIS",
"A fast line-by-line code for high resolution infrared molecular spectra",
"A fast line-by-line code for high resolution infrared molecular spectra: https://radis.github.io/",
"Miscellaneous",
),
]
Expand Down
1 change: 1 addition & 0 deletions docs/dev/_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The RADIS modules are organized with the following flow chart
.. image:: RADIS_flow_chart.*
:alt: https://radis.readthedocs.io/en/latest/_images/RADIS_flow_chart.svg
:scale: 100 %
:height: 500px

-------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/features/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It includes:

- Absorption and emission spectra of all [HITRAN-2020]_ and [ExoMol-2020]_ species under equilibrium calculations (:py:data:`~radis.db.MOLECULES_LIST_EQUILIBRIUM`)
- Absorption and emission spectra of CO2 and CO for non-LTE calculations (see :py:data:`~radis.db.MOLECULES_LIST_NONEQUILIBRIUM` )
- Different Line Databases: support of [HITRAN-2020]_, [HITEMP-2010]_ and [CDSD-4000]_ line databases (see :py:data:`~radis.lbl.loader.KNOWN_DBFORMAT`)
- Different Line Databases: support of [HITRAN-2020]_, [HITEMP-2010]_, [CDSD-4000]_, [ExoMol-2020]_, [GEISA-2020]_ line databases (see :py:data:`~radis.lbl.loader.KNOWN_DBFORMAT`)
- Calculation of :ref:`Rovibrational Energies of molecules <label_examples_rovibrational_energies>`.
- Calculation of equilibrium and nonequilibrium :ref:`Partition Functions <label_examples_partition_functions>`.
- Spatially heterogeneous spectra (see :ref:`see line-of-sight <label_los_index>`)
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using Astroquery (based on [HAPI]_). Output is a
Tgas=700, # K
mole_fraction=0.1,
path_length=1, # cm
databank='hitran', # or use 'hitemp'
databank='hitran', # or 'hitemp', 'geisa', 'exomol'
)
s.apply_slit(0.5, 'nm') # simulate an experimental slit
s.plot('radiance')
Expand All @@ -71,7 +71,7 @@ store the CO(X) rovibrational energies): ::
Trot=300 * u.K,
mole_fraction=0.1,
path_length=1 * u.cm,
databank='hitran', # or use 'hitemp'
databank='hitran', # or 'hitemp', 'geisa', 'exomol'
)
s2.apply_slit(0.5, 'nm')
s2.plot('radiance', nfig='same') # compare with previous
Expand Down
11 changes: 11 additions & 0 deletions docs/references/_bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,21 @@ The latest HITEMP database version is automatically downloaded if using ``databa
spectroscopic databank, Journal of Quantitative Spectroscopy and Radiative Transfer 112 (9) (2011)
1403–1410, ISSN 00224073, `doi:10.1016/j.jqsrt.2011.03.005 <https://www.sciencedirect.com/science/article/pii/S0022407311001154>`__
The latest ExoMol database is automatically downloaded if using ``databank='exomol'``. ExoMol contains
multiple sub-databases per molecule. See :py:func:`~radis.io.exomol.fetch_exomol`

.. [ExoMol-2020] Tennyson et al., The 2020 release of the ExoMol database: Molecular line lists for
exoplanet and other hot atmospheres, Journal of Quantitative Spectroscopy and Radiative Transfer 255,
(2020), 107228, `doi:10.1016/j.jqsrt.2020.107228 <https://www.sciencedirect.com/science/article/abs/pii/S002240732030491X>`__
.. [ExoMol-2016] Tennyson et al., The ExoMol database: molecular line lists for exoplanet and other hot atmospheres,
J. Molec. Spectrosc., 327, 73-94 (2016), `doi:10.1016/j.jms.2016.05.002 <https://arxiv.org/abs/1603.05890>`__
The GEISA 2020 database is automatically downloaded with ``databank='geisa'``.

.. [GEISA-2020] Delahaye et al, The 2020 edition of the GEISA spectroscopic database,
J. Molec. Spectrosc., 380, 111510 (2021) `doi:10.1016/j.jms.2021.111510 <https://www.sciencedirect.com/science/article/pii/S0022285221000928>`
For download and configuration of line databases, see the :ref:`Line Databases section <label_line_databases>`


Expand Down
7 changes: 7 additions & 0 deletions docs/references/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ Research papers using RADIS and the associated algorithms :

- Papers citing |badge_article2| : https://scholar.google.fr/scholar?cites=17363432006874800849

Spectroscopy Tutorials
=====================
Tutorials for molecular spectroscopy can be found here at https://github.com/radis/spectro101

- Lab Spectroscopy: https://github.com/radis/spectro101/blob/main/102_lab_spectroscopy.ipynb

- Line Broadening : https://github.com/radis/spectro101/blob/main/103_lineshape_broadening.ipynb

Useful Links
============
Expand Down
5 changes: 5 additions & 0 deletions docs/spectrum/spectrum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ method to retrieve the quantity un the units you want::
_, R = s.get('radiance_noslit', wunit='nm', Iunit='W/cm2/sr/nm',
medium='air')

Use with `return_units` to get dimensioned Astropy Quantities ::

w, R = s.get('radiance_noslit', return_units=True)
# w, R are astropy quantities

See :ref:`spectral arrays <label_spectral _arrays>` for the list
of spectral arrays.

Expand Down
4 changes: 2 additions & 2 deletions examples/plot_compare_CO_exomol_hitemp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"wmin": 2002 / u.cm,
"wmax": 2300 / u.cm,
"molecule": "CO",
"isotope": "2",
"isotope": "1",
"pressure": 1.01325, # bar
"Tgas": 1000, # K
"mole_fraction": 0.1,
Expand All @@ -37,7 +37,7 @@
}

s_exomol = calc_spectrum(
**conditions, databank="exomol", name="ExoMol's HITEMP (H2 broadened)"
**conditions, databank="exomol", name="ExoMol's HITEMP (default broadening)"
)
s_hitemp = calc_spectrum(
**conditions,
Expand Down
52 changes: 52 additions & 0 deletions examples/plot_compare_CO_geisa_hitran.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
"""
=========================================================
Compare CO spectrum from the GEISA and HITRAN database
=========================================================
GEISA Database has been newly implemented in RADIS 0.13 release on May 15, 2022. This is among
the very first attemps to compare the spectra generated from the two databases.
Auto-download and calculate CO spectrum from the GEISA database, and the HITRAN database.
Output should be similar, but not exactly! By default these two databases provide different
broadening coefficients. However, the Einstein coefficients & linestrengths should be
approximately the same, therefore the integrals under the lines should be similar.
You can see it by running the code below.
For your interest, GEISA and HITRAN lines can be downloaded and accessed separately using
:py:func:`~radis.io.geisa.fetch_geisa` and :py:func:`~radis.io.hitran.fetch_hitran`
"""
import astropy.units as u

from radis import calc_spectrum, plot_diff

conditions = {
"wmin": 2002 / u.cm,
"wmax": 2300 / u.cm,
"molecule": "CO",
"pressure": 1.01325, # bar
"Tgas": 1000, # K
"mole_fraction": 0.1,
"path_length": 1, # cm
"verbose": True,
}

s_geisa = calc_spectrum(**conditions, databank="geisa", name="GEISA's CO")

s_hitran = calc_spectrum(
**conditions,
databank="hitran",
name="HITRAN's CO",
)

"""
In :py:func:`~radis.io.geisa.fetch_geisa`, you can choose to additionally plot the
absolute difference (method='diff') by default, or the ratio (method='ratio'), or both.
"""

plot_diff(s_geisa, s_hitran, method=["diff", "ratio"])
14 changes: 9 additions & 5 deletions examples/plot_exomol_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
Auto-download and compute a SiO spectrum from the ExoMol database ([ExoMol-2020]_)
ExoMol lines can be downloaded and accessed separately using
:py:func:`~radis.io.exomol.fetch_exomol`
"""

from radis import calc_spectrum
Expand All @@ -29,14 +26,21 @@
s.plot("radiance")


#%% See line data:
#%%

"""ExoMol lines can be downloaded and accessed separately using
:py:func:`~radis.io.exomol.fetch_exomol`
"""

# See line data:
from radis.io.exomol import fetch_exomol

df = fetch_exomol("SiO", database="EBJT", isotope="1", load_wavenum_max=5000)
print(df)


#%% See the list of recommended databases for the 1st isotope of SiO :
#%%
# See the list of recommended databases for the 1st isotope of SiO :
from radis.io.exomol import get_exomol_database_list, get_exomol_full_isotope_name

databases, recommended = get_exomol_database_list(
Expand Down
2 changes: 1 addition & 1 deletion radis/__version__.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.13.0
2 changes: 1 addition & 1 deletion radis/db/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_molecule_identifier(molecule_name):
except KeyError:
raise NotImplementedError(
"Molecule '{0}' not supported. Choose one of {1}".format(
molecule_name, list(trans2.keys())
molecule_name, sorted(list(trans2.keys()))
)
)

Expand Down
1 change: 1 addition & 0 deletions radis/db/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"HITRAN-2016": "10.1016/j.jqsrt.2017.06.038",
"HITRAN-2020": "10.1016/j.jqsrt.2021.107949",
"HITEMP-2010": "10.1016/j.jqsrt.2010.05.001",
"GEISA-2020": "10.1016/j.jms.2021.111510",
"CDSD-4000": "10.1016/j.jqsrt.2011.03.005",
"ExoMol-2020": "10.1016/j.jqsrt.2020.107228",
# Tabulated Partition functions
Expand Down
2 changes: 2 additions & 0 deletions radis/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .cdsd import cdsd2df
from .exomol import fetch_exomol
from .geisa import fetch_geisa
from .hitemp import fetch_hitemp
from .hitran import fetch_hitran, hit2df
from .query import fetch_astroquery
Expand All @@ -19,4 +20,5 @@
"fetch_hitran",
"fetch_exomol",
"fetch_astroquery",
"fetch_geisa",
]

0 comments on commit bf4b8ba

Please sign in to comment.