Skip to main content

PyExoCross

A Python framework for LTE and non-LTE spectroscopic post-processing of atomic and molecular line lists

PyPI PyPI Total Downloads PyPI Monthly Downloads PyPI Status

Python Code Documentation License

CUDA GPU acceleration with PyTorch and CuPy MPS GPU acceleration with PyTorch

DOI arXiv

DOI arXiv

Description

PyExoCross is a Python adaptation of the ExoCross Fortran application.

PyExoCross is designed for postprocessing the atomic and molecular line lists generated by the ExoMol project and other similar initiatives such as the HITRAN and HITEMP. PyExoCross generates absorption and emission spectra and other properties (partition functions, specific heats, cooling functions, lifetimes, oscillator strengths, and stick spectra) based on atomic and molecular line lists. PyExoCross calculates cross sections with four line profiles: Doppler, Gaussian, Lorentzian, and Voigt; a number of options are available for computing Voigt profiles. PyExoCross can convert data format between ExoMol (ExoMol, ExoMolHR, and ExoAtom) and HITRAN (HITRAN and HITEMP). PyExoCross supports importing and exporting line lists in the ExoMol, ExoMolHR, and HITRAN formats.

PyExoCross Python Package

PyExoCross PyPI : https://pypi.org/project/pyexocross/

PyExoCross API Reference : https://pyexocross.readthedocs.io/en/latest/python_api/index.html

Install from PyPI (Python package)

pip install pyexocross

Use as a Python package

import pyexocross as px

print(px.__version__)

For detailed usage, see the Python API Reference in the documentation: https://pyexocross.readthedocs.io/en/latest/python_api/index.html

PyExoCross Python Program

PyExoCross GitHub : https://github.com/Beryl-Jingxin/PyExoCross

PyExoCross Manual : https://pyexocross.readthedocs.io

PyExoCross Wiki : https://github.com/Beryl-Jingxin/PyExoCross/wiki

PyExoCross NASA EMAC: https://emac.gsfc.nasa.gov?cid=2407-003

Download program

Download PyExoCross program by command:

git clone https://github.com/Beryl-Jingxin/PyExoCross.git

Install Python packages

pip install -r requirements.txt

Python packages version (see requirements.txt for installable bounds; tested on Python 3.8–3.12):

Python packages Version range
python_version 3.8, 3.9, 3.10, 3.11, 3.12
numpy >=1.20, <2.0
pandas >=1.4, <3.0
pyarrow >=10.0, <24.0
scipy >=1.7, <2.0
numexpr >=2.7.0,<3.0.0
matplotlib >=3.5, <4.0
tqdm >=4.64.0,<5.0.0
tabulate >=0.8.9,<1.0.0
requests >=2.25.1,<3.0.0
astropy >=5.0.0,<7.0.0
dask >=2022.5, <2025
pandarallel >=1.6.5,<2.0.0

Optional GPU Acceleration

PyExoCross now supports selectable compute mode:

  • Device CPU (default)
  • Device GPU (uses CUDA backend when available)

GPU mode is optional and automatically falls back to CPU if CUDA runtime packages or devices are unavailable. To keep GPU memory usage bounded, use:

  • GPUBatchLines (default 8192)
  • GPUBatchGrid (default 256)

When using API kwargs, use device='CPU' or device='GPU'.
run_mode kwarg remains supported as a compatibility alias for device.
Other parameters are gpu_backend, gpu_batch_lines, and gpu_batch_grid.

Runtime packages (optional):

  • CUDA: install torch (preferred) or cupy with CUDA support.

Note: macOS MPS GPU can use GPU mode but it only uses float32 which lacks precision, so please use Nvidia GPU (CUDA) or use macOS CPU mode instead for high precision calculations.

Run PyExoCross program

In the terminal, use the following commands to run PyExoCross:

python run.py -p input_filepath

If the input filepath is /home/username/PyExoCross/input/H2O_exomol.inp

python run.py -p ./input/H2O_exomol.inp
# OR 
python run.py -p /home/username/PyExoCross/input/H2O_exomol.inp

If you want to run program in conda environment which is named as 'exomol', please use command:

/home/username/anaconda3/envs/exomol/bin/python run.py -p ./input/H2O_exomol.inp

If you need to run program in background, please use command:

# Recommended: Without log file (the program will record log automatically)
nohup python -u run.py -p ./input/H2O_exomol.inp > /dev/null 2>&1
# Save log file
nohup python -u run.py -p ./input/H2O_exomol.inp > ./output/H2O_exomol.out 2>&1 &
# OR 
nohup /home/username/anaconda3/envs/exomol/bin/python -u run.py -p ./input/H2O_exomol.inp > ./output/H2O_exomol.out 2>&1 &

Notes for input file

All information can be written in the input file. Just change the information you will use.You don't need to change any other unnecessary information.Please do not change the first column strings.

Citation

PyExoCross Paper

PyExoCross (2024)

PyExoCross Published Paper : https://doi.org/10.1093/rasti/rzae016

PyExoCross arXiv Preprint : https://doi.org/10.48550/arXiv.2406.03977

PyExoCross 2.0 (2026)

PyExoCross 2.0 Published Paper : https://doi.org/10.1093/rasti/rzag094

PyExoCross 2.0 arXiv Preprint : https://doi.org/10.48550/arXiv.2609.17273

Please cite PyExoCross paper 💚

Cite

PyExoCross (2024)

Jingxin Zhang, Jonathan Tennyson, Sergei N Yurchenko, PyExoCross: a Python program for generating spectra and cross-sections from molecular line lists, RAS Techniques and Instruments, Volume 3, Issue 1, January 2024, Pages 257–287, https://doi.org/10.1093/rasti/rzae016

PyExoCross 2.0 (2026)

Jingxin Zhang, Sergei N Yurchenko, Jonathan Tennyson, PyExoCross 2.0: A Python Framework for LTE and non-LTE Spectra, Cross Sections, and Spectroscopic Post-processing of Atomic and Molecular Line Lists, RAS Techniques and Instruments, 2026, rzag094, https://doi.org/10.1093/rasti/rzag094

Bibtex

@article{pyexocross,
    author   = {Jingxin Zhang and Jonathan Tennyson and Sergei N. Yurchenko},
    title    = {{PyExoCross: a Python program for generating spectra and cross-sections from molecular line lists}},
    journal  = {RAS Techniques and Instruments},
    volume   = {3},
    number   = {1},
    pages    = {257-287},
    year     = {2024},
    month    = {01},
    issn     = {2752-8200},
    doi      = {10.1093/rasti/rzae016},
    url      = {https://doi.org/10.1093/rasti/rzae016},
    eprint   = {https://academic.oup.com/rasti/article-pdf/3/1/257/61224370/rzae016.pdf},
}

@article{pyexocross2,
    author  = {Jingxin Zhang and Sergei N. Yurchenko and Jonathan Tennyson},
    title   = {{PyExoCross 2.0: A Python Framework for LTE and non-LTE Spectra, Cross Sections, and Spectroscopic Post-processing of Atomic and Molecular Line Lists}},
    journal = {RAS Techniques and Instruments},
    pages   = {rzag094},
    year    = {2026},
    month   = {11},
    issn    = {2752-8200},
    doi     = {10.1093/rasti/rzag094},
    url     = {https://doi.org/10.1093/rasti/rzag094},
    eprint  = {https://academic.oup.com/rasti/advance-article-pdf/doi/10.1093/rasti/rzag094/73037061/rzag094.pdf},
}

Support databases

✅ ExoMol (High temperature + molecule)

✅ ExoMolHR (High-resolution + high accuracy + high temperature + molecule)

✅ ExoAtom (Including NIST and Kurucz + atom and ion)

✅ HITRAN (High-resolution + molecule)

✅ HITEMP (High temperature + molecule)

⏳ Databases from VAMDC

Metadata

Release files for pyexocross 1.1.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyexocross 1.1.22
File Size Uploaded Provenance Actions
pyexocross-1.1.22.tar.gz 346.3 kB Without provenance Details for pyexocross-1.1.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyexocross 1.1.22
File Interpreter ABI Platform Actions
pyexocross-1.1.22-py3-none-any.whl Python 3 none any Details for pyexocross-1.1.22-py3-none-any.whl

Total release size: 594.4 kB

Release files / pyexocross-1.1.22.tar.gz

Download URL pyexocross-1.1.22.tar.gz
Size 346.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2033810cd7960f50f58a0bb765523d4b7d0d30659d313cc6a3af7e5900f40343
BLAKE2b-256 checksum
How to use checksums
e1c700e5a9854efec89b09e8c37e42c4a87c79e9c0e917b1f165c62fc71cebc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.8

Release files / pyexocross-1.1.22-py3-none-any.whl

Download URL pyexocross-1.1.22-py3-none-any.whl
Size 248.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfad8998f1f2635944920a1df2717754cd2c19b0df41fcb7514cfc1799ab5875
BLAKE2b-256 checksum
How to use checksums
3a83de6834179d3398060e55abb957df504ec674a10f58cdd6e15fad51c3a1c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.8

Security for pyexocross 1.1.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page