Skip to main content

SpectralRadex

A python library that serves two purposes:

  • Run RADEX directly from python
  • Create model spectra from RADEX outputs

A number of libraries exist for the first purpose. However, most either launch the RADEX compiled binary as a subprocess or wrap the original code. In the former case, the creating of subprocesses can interfere with many Python multiprocessing methods. In the latter, running multiple models simultanously can be problematic due to the use of F77 common blocks in RADEX.

SpectralRadex uses F2PY to compile a version of RADEX written in modern Fortran, most importantly dropping the use of common blocks. As a result, running a RADEX model creates no subprocesses and can be parallelized.

Documentation

Please check the documentation on our readthedocs page for installation instructions, detailed documentation of the library and usage examples.

Installation

We recommend the simple approach of using pypi:

pip install spectralradex

However, if you wish to install manually, clone the repo and from the main directory run the following

python3 setup.py install

optionally, specify a path for the installation using

python3 setup.py install --prefix=/path/to/my/install

making sure that the install path is part of your PYTHONPATH environmental variable. You'll need to add the .egg directory eg. path/to/my/install/lib/python3.7/site-packages/spectralradex-0.0.2-py3.7-linux-x86_64.egg

Spectral Modelling

The library also includes functions for producing model spectra from the RADEX results. RADEX provides the optical depth at line centre and the excitation temperature of each molecular transition and these are used to calculate the line profile assuming gaussian line profiles in velocity. This has been benchmarked against CASSIS and provides a useful way to perform this modelling through python.

Spectral Modelling Formalism

Radex solves the radiative transfer problem without assuming LTE and then provides various line properties. Two of those properties are key: 1. The excitation temperature of each line 2. The optical depth at line centre

The first is the excitation temperature of an LTE model that would give the same amount of emission. Which means we can use it and the optical depth to get the brightness temperature as a function of velocity.

The brightness temperature is:

Where $T_{ex}$ is the excitation temperature and $T_{BG}$ is the background temperature, likely 2.73 K. So RADEX provides the value of $T_{ex}$ such that this equation gives the same value as the RADEX model. It also provides us with the optical depth at line centre, $\tau_0$ so we simply need to calculate $tau_v$ assuming a gaussian line profile:

Finally, we need to consider what to do with overlapping lines. We follow Hsieh et al 2015 and use an opacity weighted radiation temperature:

We can multiply $T_B$ by the filling factor to get the main beam temperature.

Metadata

Release files for spectralradex 1.1.5

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

Built distributions (wheels)

Table of built distributions (wheels) for spectralradex 1.1.5
File
spectralradex-1.1.5-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
spectralradex-1.1.5-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
spectralradex-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details
spectralradex-1.1.5-cp311-cp311-musllinux_1_1_i686.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-32 Details
spectralradex-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
spectralradex-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-32 Details
spectralradex-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
spectralradex-1.1.5-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
spectralradex-1.1.5-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
spectralradex-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details
spectralradex-1.1.5-cp310-cp310-musllinux_1_1_i686.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-32 Details
spectralradex-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
spectralradex-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-32 Details
spectralradex-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
spectralradex-1.1.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
spectralradex-1.1.5-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
spectralradex-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-64 Details
spectralradex-1.1.5-cp39-cp39-musllinux_1_1_i686.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-32 Details
spectralradex-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
spectralradex-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-32 Details
spectralradex-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 34.5 MB

Release files / spectralradex-1.1.5-cp311-cp311-win_amd64.whl

Download URL spectralradex-1.1.5-cp311-cp311-win_amd64.whl
Size 1.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7af003f1db131f493b514c298c4566000b547f83dfdda0085ec907e6b29dc0b6
BLAKE2b-256 checksum
How to use checksums
20a6374b82580e3f225474fd0573d54e53564034271ed530ce6b80fcd869cede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-win32.whl

Download URL spectralradex-1.1.5-cp311-cp311-win32.whl
Size 1.1 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
b094fee8d0b8ea3ff098b281cb31fe5db6be7902ced21397039c63b8e3c52a7e
BLAKE2b-256 checksum
How to use checksums
1ef7066f013abf0b6efedebed84f21e2dc3edc72485bf3dc721afd104e17fc1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL spectralradex-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
ae1bc9c7915957d689d9222f1a7702b6bb966d1c22ae138e09a237b2a703186f
BLAKE2b-256 checksum
How to use checksums
b48611940e014f02952c0d5bf6e54297726534055e55c1856d010c8c61b5bbb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-musllinux_1_1_i686.whl

Download URL spectralradex-1.1.5-cp311-cp311-musllinux_1_1_i686.whl
Size 1.7 MB
Tags CPython 3.11 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
d7fed19e83b4197acab324319fbcc1c42f4a6691353dbf702fe6091835736ed0
BLAKE2b-256 checksum
How to use checksums
cfb5baf02a9ef33eade568cf31ac7bd638a6aa630adcd2d95a51e41abf7e525b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL spectralradex-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
307682e43cc820680945a6d5bb61540b8b714c2959912023ba5be3163b29e325
BLAKE2b-256 checksum
How to use checksums
9bd0bcfb526a1237faa928cdb24b2a4392e13bff8926ef8a8cefc151f8b64641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL spectralradex-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.9 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
bcd64b9f975b6332a11421713797d626823ba535f4867128c553f10c34b97b3f
BLAKE2b-256 checksum
How to use checksums
16f77e0234b07ad9d0c025f70e89678734eb7dd5f4d13beab76706594568028a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl

Download URL spectralradex-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl
Size 2.2 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3f8666a5ba2281bbd12143f1e77f37092f58697f350dc85a1cd165edabd67ba9
BLAKE2b-256 checksum
How to use checksums
10013ea07ea2e398b1d8f767ba919c5d1a6e3513386cce879612e5581db20c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-win_amd64.whl

Download URL spectralradex-1.1.5-cp310-cp310-win_amd64.whl
Size 1.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
0400c85101439b950c0dd945ac5f6e02b85d81ad7251c777fa5ac7b5003b11cf
BLAKE2b-256 checksum
How to use checksums
5f9331873a042330852f35da1f71db71d139f2dc0324f003b7112e2265b9262f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-win32.whl

Download URL spectralradex-1.1.5-cp310-cp310-win32.whl
Size 1.1 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
6255198fde56feecc9cf436610eebde1e1805f9190cb39a1448c446e4e536d51
BLAKE2b-256 checksum
How to use checksums
4f72d94cdcb4daa41bb38538d0726b31baac34da533bf9d140a6f27f0a14b331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL spectralradex-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
fa2b194f746761444c8be3ed5c8aa93db6913a1dcaae9d21d8a52d8c786a87a1
BLAKE2b-256 checksum
How to use checksums
708d8d115b1df61969b5871f8a274539232f664ae8696dddd2d50b6e3e4661d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-musllinux_1_1_i686.whl

Download URL spectralradex-1.1.5-cp310-cp310-musllinux_1_1_i686.whl
Size 1.7 MB
Tags CPython 3.10 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
d0da323e52e2b93700126834aa17106e5ef4da4bb9f8b724d4168f6351fcbc95
BLAKE2b-256 checksum
How to use checksums
d38b947f88b28fa2f9fe8b615ec06eca219e74b12ef96d39578097ad3ba1e40a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL spectralradex-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4c0c105f409f74ba20b058ab0096239d7b6681fa2d015c409bea4e695aceb3df
BLAKE2b-256 checksum
How to use checksums
fbcd30dcb988f7d6d3fdf42f3c70909c891ceb92542358dd797005e346802b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL spectralradex-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
f27a2bca922b23dd9c187b25d0e423b7e16d7b42a2907249cedc45aa7c9b8628
BLAKE2b-256 checksum
How to use checksums
cc7fc9d6bccc24dd7bc136fecbcc9838c612402e93bf2fc295a9e7f7762cc9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl

Download URL spectralradex-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
6b466ce0fd3e4570b3558bbb56b5a61ed56ed3c1dfe70a2191af4fe485567a26
BLAKE2b-256 checksum
How to use checksums
e98a543da9c4cc4d5f99a72d199476e5d54f26b9b83210005936b120d98cbd90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-win_amd64.whl

Download URL spectralradex-1.1.5-cp39-cp39-win_amd64.whl
Size 1.1 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
63c9096fcb6ed6da442b9bd9b3297c9af346034f59d91caf69aab04ef9f6541e
BLAKE2b-256 checksum
How to use checksums
1fa5cea197d77d1647414b0651e9f0d71be423ba8c1fdf16fc119ae8339e0df2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-win32.whl

Download URL spectralradex-1.1.5-cp39-cp39-win32.whl
Size 1.1 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
4c94fce032bf8e7b4bcc91e810173128ba86655aad87c735be94cd42ca2b06a7
BLAKE2b-256 checksum
How to use checksums
d04d5d05129b7f5007b670271c07c923b9d0fe20df50dce3590a8be2d033a3f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl

Download URL spectralradex-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
4cadbdd8b76fe1c9917bd8363ed2a5e41488274df24860fd3332b49aaf9152cb
BLAKE2b-256 checksum
How to use checksums
699a9bdf08375947dd757208e48c943313fc077384fed7398e0e17fd2aaf1291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-musllinux_1_1_i686.whl

Download URL spectralradex-1.1.5-cp39-cp39-musllinux_1_1_i686.whl
Size 1.7 MB
Tags CPython 3.9 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
f7cae28b2849353cd66f43b2459ff8da83f7d8e06ed32a780dac69d616d111e1
BLAKE2b-256 checksum
How to use checksums
afa7b92cde6e8c6863e8511b79a439e1f035e351fd504ee28f32f80e9f1ccdb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL spectralradex-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0592f962eefc003de61ab93a8a71cce0a4536e21bc747e9c49c8ee0ec8ef58e7
BLAKE2b-256 checksum
How to use checksums
52d02e63f7ab42a0cb328a0fd5e227de4215d947c9680b5ecc133881101863af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL spectralradex-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
86ef01b04de12c34ea1623202d7f31b06661f6f607b7c151cb3152744e41c49d
BLAKE2b-256 checksum
How to use checksums
841a0309b0ac60b3c367738ec7af016f1f84c26c13ddf746bcdd66a51fd05482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / spectralradex-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl

Download URL spectralradex-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl
Size 2.2 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
22f0eb19bf2ecc55d5dea47457fd248d11b5cacccc85cb70ca90dae2c22e8bad
BLAKE2b-256 checksum
How to use checksums
96488cad23f57f77506c00b045758bfc3cfe8d132c2456807626771e5cddb74b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release history Release notifications | RSS feed

This release

1.1.5 This release

21 release files

1.1.4

42 release files

1.1.3

20 release files

1.1.1

20 release files

1.0.1

20 release files

0.3.1

20 release files

0.3.0

20 release files

0.2

20 release files

0.1.3

15 release files

0.1.2

15 release files

0.1.1

12 release files

0.1.0

13 release files

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