A package for RADEX and spectral modelling
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file spectralradex-1.1.5-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7af003f1db131f493b514c298c4566000b547f83dfdda0085ec907e6b29dc0b6 |
|
MD5 | 3f95d66344829e6cd8854344d10f22ae |
|
BLAKE2b-256 | 20a6374b82580e3f225474fd0573d54e53564034271ed530ce6b80fcd869cede |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-win32.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-win32.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b094fee8d0b8ea3ff098b281cb31fe5db6be7902ced21397039c63b8e3c52a7e |
|
MD5 | 6353bb57188a455e0f9e891712c16acf |
|
BLAKE2b-256 | 1ef7066f013abf0b6efedebed84f21e2dc3edc72485bf3dc721afd104e17fc1a |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1bc9c7915957d689d9222f1a7702b6bb966d1c22ae138e09a237b2a703186f |
|
MD5 | cbaa3363fbfe06008ed20896aa2fa2e4 |
|
BLAKE2b-256 | b48611940e014f02952c0d5bf6e54297726534055e55c1856d010c8c61b5bbb2 |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-musllinux_1_1_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-musllinux_1_1_i686.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fed19e83b4197acab324319fbcc1c42f4a6691353dbf702fe6091835736ed0 |
|
MD5 | 24c7bdce0fc6ae9eb1a9c016bc01b49f |
|
BLAKE2b-256 | cfb5baf02a9ef33eade568cf31ac7bd638a6aa630adcd2d95a51e41abf7e525b |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 307682e43cc820680945a6d5bb61540b8b714c2959912023ba5be3163b29e325 |
|
MD5 | 6c31dde24aa2942aa50db9d4310bc2a6 |
|
BLAKE2b-256 | 9bd0bcfb526a1237faa928cdb24b2a4392e13bff8926ef8a8cefc151f8b64641 |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcd64b9f975b6332a11421713797d626823ba535f4867128c553f10c34b97b3f |
|
MD5 | a204d95efa918b8cdbc34e818f7e43eb |
|
BLAKE2b-256 | 16f77e0234b07ad9d0c025f70e89678734eb7dd5f4d13beab76706594568028a |
File details
Details for the file spectralradex-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f8666a5ba2281bbd12143f1e77f37092f58697f350dc85a1cd165edabd67ba9 |
|
MD5 | 3541e6849e14d546fdf2e301e14fb584 |
|
BLAKE2b-256 | 10013ea07ea2e398b1d8f767ba919c5d1a6e3513386cce879612e5581db20c59 |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0400c85101439b950c0dd945ac5f6e02b85d81ad7251c777fa5ac7b5003b11cf |
|
MD5 | 674910b51c0f52314c719b3bf09ca4c8 |
|
BLAKE2b-256 | 5f9331873a042330852f35da1f71db71d139f2dc0324f003b7112e2265b9262f |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-win32.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-win32.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6255198fde56feecc9cf436610eebde1e1805f9190cb39a1448c446e4e536d51 |
|
MD5 | ceb8c099d87000bcdc58ee97d89ba652 |
|
BLAKE2b-256 | 4f72d94cdcb4daa41bb38538d0726b31baac34da533bf9d140a6f27f0a14b331 |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa2b194f746761444c8be3ed5c8aa93db6913a1dcaae9d21d8a52d8c786a87a1 |
|
MD5 | 353666d5e70bdf833906c383e32145cd |
|
BLAKE2b-256 | 708d8d115b1df61969b5871f8a274539232f664ae8696dddd2d50b6e3e4661d4 |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-musllinux_1_1_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-musllinux_1_1_i686.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0da323e52e2b93700126834aa17106e5ef4da4bb9f8b724d4168f6351fcbc95 |
|
MD5 | ca54d0bd4ba8d2aa807f03e0549df45b |
|
BLAKE2b-256 | d38b947f88b28fa2f9fe8b615ec06eca219e74b12ef96d39578097ad3ba1e40a |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0c105f409f74ba20b058ab0096239d7b6681fa2d015c409bea4e695aceb3df |
|
MD5 | e439b03ac7ac912b0aab697d4eefc9d7 |
|
BLAKE2b-256 | fbcd30dcb988f7d6d3fdf42f3c70909c891ceb92542358dd797005e346802b08 |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f27a2bca922b23dd9c187b25d0e423b7e16d7b42a2907249cedc45aa7c9b8628 |
|
MD5 | 0148a91790f88af25d8ddcea89d33ea8 |
|
BLAKE2b-256 | cc7fc9d6bccc24dd7bc136fecbcc9838c612402e93bf2fc295a9e7f7762cc9ce |
File details
Details for the file spectralradex-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b466ce0fd3e4570b3558bbb56b5a61ed56ed3c1dfe70a2191af4fe485567a26 |
|
MD5 | 990bb7c1ff2f3f39f2bdb81ba7771450 |
|
BLAKE2b-256 | e98a543da9c4cc4d5f99a72d199476e5d54f26b9b83210005936b120d98cbd90 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c9096fcb6ed6da442b9bd9b3297c9af346034f59d91caf69aab04ef9f6541e |
|
MD5 | 32b4bb817984f6b315ccf45c141cff8f |
|
BLAKE2b-256 | 1fa5cea197d77d1647414b0651e9f0d71be423ba8c1fdf16fc119ae8339e0df2 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-win32.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-win32.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c94fce032bf8e7b4bcc91e810173128ba86655aad87c735be94cd42ca2b06a7 |
|
MD5 | 718422696958d13989647dae04ee0e38 |
|
BLAKE2b-256 | d04d5d05129b7f5007b670271c07c923b9d0fe20df50dce3590a8be2d033a3f0 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cadbdd8b76fe1c9917bd8363ed2a5e41488274df24860fd3332b49aaf9152cb |
|
MD5 | 5c08572d97567679eaaa9939e595cabb |
|
BLAKE2b-256 | 699a9bdf08375947dd757208e48c943313fc077384fed7398e0e17fd2aaf1291 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-musllinux_1_1_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-musllinux_1_1_i686.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7cae28b2849353cd66f43b2459ff8da83f7d8e06ed32a780dac69d616d111e1 |
|
MD5 | 4a8ede61446558d7d53c9635785c656b |
|
BLAKE2b-256 | afa7b92cde6e8c6863e8511b79a439e1f035e351fd504ee28f32f80e9f1ccdb8 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0592f962eefc003de61ab93a8a71cce0a4536e21bc747e9c49c8ee0ec8ef58e7 |
|
MD5 | 5cc261d395ccb018547910e9b14663a9 |
|
BLAKE2b-256 | 52d02e63f7ab42a0cb328a0fd5e227de4215d947c9680b5ecc133881101863af |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86ef01b04de12c34ea1623202d7f31b06661f6f607b7c151cb3152744e41c49d |
|
MD5 | e929830e06ef58a0c35ab8a13a049514 |
|
BLAKE2b-256 | 841a0309b0ac60b3c367738ec7af016f1f84c26c13ddf746bcdd66a51fd05482 |
File details
Details for the file spectralradex-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: spectralradex-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f0eb19bf2ecc55d5dea47457fd248d11b5cacccc85cb70ca90dae2c22e8bad |
|
MD5 | c45b87b6e0393cb448e9ba5e85b617a5 |
|
BLAKE2b-256 | 96488cad23f57f77506c00b045758bfc3cfe8d132c2456807626771e5cddb74b |