Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightweaver-0.7.5.tar.gz (3.2 MB view details)

Uploaded Source

Built Distributions

lightweaver-0.7.5-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.7.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

lightweaver-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

lightweaver-0.7.5-cp39-cp39-macosx_10_9_universal2.whl (3.9 MB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

lightweaver-0.7.5-cp38-cp38-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

lightweaver-0.7.5-cp38-cp38-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

lightweaver-0.7.5-cp38-cp38-macosx_10_9_universal2.whl (3.9 MB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file lightweaver-0.7.5.tar.gz.

File metadata

  • Download URL: lightweaver-0.7.5.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5.tar.gz
Algorithm Hash digest
SHA256 88cd77e851618e629abac2d1ca5b4ff24980c293914c12ea2327db2d59c6df17
MD5 2c0129a43c568be55a3fae0054806d57
BLAKE2b-256 4a90ccbda0d1439dacefa3132481cba77671edc61cec1df44e7fc4cf21711b7b

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: lightweaver-0.7.5-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.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2cdde71294364be34e9309e16d4aeda58f3b9e1023799e3f91e7f9f9992a0a02
MD5 fe588cf4742713a2981b9799b5dcf33d
BLAKE2b-256 783753d34b253d0e9e62c988ccc22f03399e7ceb4f0f231e8bfa785022a6492b

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.7.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d14841af8980267e42a9f6bf31f50035d2c3ebe30e1c90a17eec2e606931c7e1
MD5 31226a775b0cf33357af2ec2a2ab659d
BLAKE2b-256 92d9ec5a4b724615651479256a87013fea6935dc8376aaee250cd271394b623b

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lightweaver-0.7.5-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.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 62ea66c834d137bdc99e6cfd420b464a9519a2a1f52c8a7c505fb7da0e955c32
MD5 fd3a75fc974a5b48a25109ed99842f75
BLAKE2b-256 023038ea38db55f6219c4984321902c9593fb7b17091b054ee5e3dc688e7743a

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

  • Download URL: lightweaver-0.7.5-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fe5c925aee4760ef1bd8ea8813912aba542b03273f18418a7cc5a4596b303001
MD5 721beb0f108303d9ea4d0573ae1274b2
BLAKE2b-256 e8793bf71840b54a1464ea7dd32ea57d054a4a0fe19ba7cbf44328f4cde7bde4

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: lightweaver-0.7.5-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.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ef43a6e13046ff16485e7ff90a3ac7c9f9831cb16a95af7158d7586343f5c639
MD5 0af8cd9633f078c598078b467e477342
BLAKE2b-256 9f5cc1d704e7de7c0e736d7b846f9df7267ec62c89bca1b9445d2236a1ab00cf

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.7.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2083602928c1d8f59fe2714ea09545dd422cb7e4f29dd010a52ca8a013744a29
MD5 50eb76dfcf09765e0790d1d053d24c32
BLAKE2b-256 ec727b06ff8d91e9e2671031e79ae74f65df7db8f26d5f245cfbfdc8b13efa5a

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lightweaver-0.7.5-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 42b872a6b5effc249202660d50f76ab82cad3bfc79906cb123d5d7a5f6c6f8f7
MD5 1274d17df4d7693603d8605c78b7ff76
BLAKE2b-256 0de6ae5eb93970aa6cf57ac666739a34d8deafa0b813fa5690df77b7c5180405

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.5-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

  • Download URL: lightweaver-0.7.5-cp38-cp38-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.5-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2507c79bdbfb839d56f6aa6851a089f1666a3f4368045412f24720eb9e55d806
MD5 bb8819ca030783daacb1945af73c9a19
BLAKE2b-256 70b1a7b15b0841d6e6e62a03135452bd82e048de8ab959de954f3959c8f41238

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page