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.4.tar.gz (3.2 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.7.4-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.4-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.4-cp38-cp38-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.4-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.4-cp38-cp38-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: lightweaver-0.7.4.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.2 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.4.tar.gz
Algorithm Hash digest
SHA256 cfa5265520a9abb3b48bcd8332a4891dcbd01c5d3d9cb0c86d1b4f9ff14f8806
MD5 5db1693f05cf5e1e53bebcee8d648428
BLAKE2b-256 ec04411a8e28455964d8404b73fbf2e04b4406e588f573ade06546f281a8a458

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.4-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.2 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f0d0bd84d4b47dbd6f6adc6cd1ab0b12f439089295f174a936346ced7e7cb49c
MD5 16f61e265271a57f3f757ee60a0351b6
BLAKE2b-256 c03e1d1096cb242395253befc64b7d375c3cde41fef88674cdbcc2d8b025e48f

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.4-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.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b396a7076f6525db55f8f6e7c5f3b2d442fae0182d330ccbe25a2eee95bbf96d
MD5 67b266bf35c246ccb72f594decad244f
BLAKE2b-256 668961a3947b4859841d2c4def3a5e37bc3708993da893f3bdc02be4a9d004b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.4-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.2 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6d7993eba77c3a6dbe57c68d08582dbbb9ed3a4d7a0f7e0103def98c4b37d621
MD5 e06ff29c99a8a97c0a41e3162a15add9
BLAKE2b-256 70f9fa309d7daabd6d059827415a4b663d36f7acb52db45d915a6f8c7730fd87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.4-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.2 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 50d580969d50fdb2a926dede461e0bb51b0b97a0465eee734cec05f1e75d9f85
MD5 7dbee825bcb746ead5126f4dd5b6ee49
BLAKE2b-256 a5c5c7dfc69df50a4b08e3071074d4cb20780eaa8258b85c78ba1186fdd25459

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.4-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.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3a065a9449b541eb6babbcb5d5780cffda1b9d2bbad6a0634ff233d7cd72c52e
MD5 d07a8a9502207a23831528c913bfa10d
BLAKE2b-256 e75f36afb6d9f379034dbdd4d78a8c3c3c677afa876b9d9f249f7be80531311f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lightweaver-0.7.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cbd602456aaab351a552251fd785204d91f38fb8d5df49157045eb90662bba8e
MD5 06e020d521af7c7314b0162184f8dd44
BLAKE2b-256 d342479dbc98bb5df9c8ff033e717a1aa132902edebe09dad222b63d3e4b88e1

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