Non-LTE Radiative Transfer Framework in Python
Project description
Lightweaver
C. Osborne (University of Glasgow) & I. Milić (NSO/CU Boulder), 2019-2021
MIT License
Lightweaver is an NLTE radiative transfer code in the style of RH.
It is well validated against RH and also SNAPI.
The code is currently designed for plane parallel atmospheres, either 1D single columns (which can be parallelised over wavelength) or 1.5D parallel columns with ProcessPool
or MPI parallelisation.
There is also support for unpolarised radiative transfer in 2D atmospheres.
Lightweaver is described in a paper (including examples!), and has API documentation.
Whilst the core numerics are implemented in C++, as much of the non-performance critical code as possible is implemented in Python, and the code currently only has a Python interface (provided through a Cython binding module). Other languages with a C/C++ interface could interact directly with this core, hopefully allowing it to be reused as needed in different projects.
The aim of Lightweaver is to provide an NLTE Framework, rather than a "code". That is to say, it should be more malleable, and provide easier access to experimentation, with most forms of experimentation (unless one wants to play with formal solvers or iteration schemes), being available directly from python. Formal solvers that comply with the interface defined in Lightweaver can be compiled into separate shared libraries and then loaded at runtime. The preceding concepts are inspired by the popular python machine learning frameworks such as PyTorch and Tensorflow.
Installation
For most users precompiled python wheels (supporting modern Linux, Mac, and Windows 10 systems) can be installed from pip
and are the easiest way to get started with Lightweaver.
Lightweaver requires python 3.8+, and it is recommended to be run inside a virtual environment using conda
.
In this case a new virtual environment can be created with:
conda create -n Lightweaver python=3.8
activate the environment:
conda activate Lightweaver
and Lightweaver can then be installed with
python -m pip install lightweaver
Installation from source
Whilst the above should work for most people, if you wish to work on the Lightweaver backend it is beneficial to have a source installation.
This requires a compiler supporting C++17.
The build is then run with python3 -m pip install -vvv -e .
.
The libraries currently produce a few warnings, but should not produce any errors.
Documentation
- Paper.
- API documentation.
- I suggest looking through the samples repository (in particular the
Simple*.py
) after the code description in the paper to gain an understanding of the basic functionality and interfaces. These samples are unfortunately not always up to date, but are a work in progress. - The MsLightweaver repository contains a more "production grade" tool built on Lightweaver for reprocessing the time-dependent radiative output from RADYN simulations. This tool is currently undocumented, but has a relatively simple structure.
Please contact me through this repository if difficulties are encountered.
Acknowledgements
The python implementation of the Wittmann equation of state has been kindly provided J. de la Cruz Rodriguez.
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 Distribution
Built Distributions
File details
Details for the file lightweaver-0.7.2.tar.gz
.
File metadata
- Download URL: lightweaver-0.7.2.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8ab8c1f949d2af4caedf2962088167af10a93bc366083f8caa8cf2897098d7f |
|
MD5 | a05db82ac756c9a5674b7d68f95f4e72 |
|
BLAKE2b-256 | e36c8040cbfd25de4b690b8a8a0cfe6051306d25bde6a64fd13812e37efd65bd |
File details
Details for the file lightweaver-0.7.2-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31c5d01c7a76c439725863a794156ed3aea25b0d6c625bf75f6fb1faeaefd381 |
|
MD5 | ffdff45177118b7da821a8538b234f95 |
|
BLAKE2b-256 | 362da89aaeab1d8e1a2c1ed1839cf3515fb3e7e8005dd4e1fa6819a75ebbbba1 |
File details
Details for the file lightweaver-0.7.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acb745d5cb677f0713e558926e5c6a9c5313cf1fc5edaaf1e91dcd4344623a46 |
|
MD5 | c5e65ae4d5b2c3515527372e1a9669b4 |
|
BLAKE2b-256 | 68c01b69a8bd3fda1f843522cb2580f845ae2202c324844174b10eb56fc4acd8 |
File details
Details for the file lightweaver-0.7.2-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61744a2e1c42e2b805ec9ded972d51fb439243b927648504ecbe7bacb64f6348 |
|
MD5 | 393763da94d97b8ec6b941adef4e9fa8 |
|
BLAKE2b-256 | 6cde3558924b48884ca9000948c578d9c7dfeca7e9434fd09fed1a55a7ca2b31 |
File details
Details for the file lightweaver-0.7.2-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02490426a38c095600a3ac03edbadddb62c3b8fb7a1a237a703fc56eb969a2d3 |
|
MD5 | c6bfa00a76cbc748f4924a764c5b2722 |
|
BLAKE2b-256 | 606f365ba50b4c44ad3095923cccba7eca688608029ebf31cde7a2d2ad97855d |
File details
Details for the file lightweaver-0.7.2-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c202dbebfe1ed0479b166d131d0543f12cf718151ab8eb06e6f94476350efe9 |
|
MD5 | 898dcecc992d56bee572bd4276bc985d |
|
BLAKE2b-256 | 43198077b97f789a97414e22e1dc23d6b71296e10aa61b6662b57fe1183e58af |
File details
Details for the file lightweaver-0.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5890876e68944b84b78147ee5e7f8b7b342d8549c5a058a3119081780549d2c |
|
MD5 | da597c343206a49c63364332d794a82e |
|
BLAKE2b-256 | 90a74a52e7b624d0a0425175eb3d976f8426e01a9df90c292e2fdf1135328796 |
File details
Details for the file lightweaver-0.7.2-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d25795a930378ad6b2faeb6b81647ecc35e5f123ad8c467c65ab50c4a7a649 |
|
MD5 | d0be3929c0a7c2eb20542bb24b06c314 |
|
BLAKE2b-256 | 78ebc2ea5f06103c7ae932043af5b6a4d95e2041fe570621d75b6a2ad88bf05b |
File details
Details for the file lightweaver-0.7.2-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: lightweaver-0.7.2-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6196756f79f8766976763f25b3b455f8e1204e4074bb867191c67ce90767ec |
|
MD5 | d0f880ee6c911d65e455f38eee0dacce |
|
BLAKE2b-256 | 737f47ccc3c1972df88166d28768ae65fafd307f72e69026be9720fe55d6e1d3 |