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.8.3rc1.tar.gz (3.3 MB view details)

Uploaded Source

Built Distributions

lightweaver-0.8.3rc1-cp310-cp310-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

lightweaver-0.8.3rc1-cp310-cp310-musllinux_1_1_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

lightweaver-0.8.3rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_universal2.whl (4.2 MB view details)

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

lightweaver-0.8.3rc1-cp39-cp39-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.8.3rc1-cp39-cp39-musllinux_1_1_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

lightweaver-0.8.3rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_universal2.whl (4.2 MB view details)

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

lightweaver-0.8.3rc1-cp38-cp38-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.8.3rc1-cp38-cp38-musllinux_1_1_x86_64.whl (20.2 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

lightweaver-0.8.3rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_universal2.whl (4.2 MB view details)

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

File details

Details for the file lightweaver-0.8.3rc1.tar.gz.

File metadata

  • Download URL: lightweaver-0.8.3rc1.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.15

File hashes

Hashes for lightweaver-0.8.3rc1.tar.gz
Algorithm Hash digest
SHA256 24169bb2337e17fb55aa9e70260524127ee3da28c722f82b2f285f4a952ab417
MD5 5c83cc56660b78756e2292dce7901ca7
BLAKE2b-256 56a81ebe2bee535e13833565a647c5a056199cd03034ab35ef834cc098427f3e

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3ddb918ae8d83bf6b002ae742f190419c0ac892609c56710b2e5be6527df1933
MD5 3d41d490ee136a5c28dca9fffe3acc73
BLAKE2b-256 f0323d5255be64f88a3bed1bba8f32f88002c897e25106360e9ab976b36f52e0

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2d3c18b832abecc21ae3f1bd62f40d2491383fd3429adcae3e1bd68bf8dbbbd7
MD5 8502f18caa4a18cd016e35ce976513db
BLAKE2b-256 e6222296a0641caec72ce1eeeb2034e4c2765e0e24401f5bdae8ada329878dd5

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80c5d08f9d18550e2ead8e01b464902bb01c2108663c4490f45e4417389d8798
MD5 be23234dbbba9845fa930db0d21c9fcc
BLAKE2b-256 0a606418eafabd6f5ce4a4ff8f9f13f6c7c48d2278cea902f374609f6e24f569

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7ad5492f474e59d1cc4a248f7be1861f061c6a8d4847776bd2d0bd7216abefac
MD5 ad00cbcf216f1c887110e13b48e2c4b7
BLAKE2b-256 c76992b6b608084c7e9c5d94c56f9c5db86244f74bf647e16251098b6bd2368b

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5ca10597f0c4f9e714740897e1b92c2ac1198caaab965148a422759e78a9ce49
MD5 c89d660c1277da19fcd9ed58124e6123
BLAKE2b-256 a05997f073e6069a313b87ce3b155f4aa0fee736a966596daa2d7225ceb40562

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 53d251dbb0bf5f0073b3c9e0f99e2c94c6629f02575163f7a53007f0d7b7926d
MD5 ae2ab91a778a197ca7355ee61191d4eb
BLAKE2b-256 d0fadd46d41497aa1d62e1d848a9b66944dae3e4410ef8091450eb925db49c6f

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3487678206986bc8f30a26b7a5686bfd8fcb355cab48310a6d22038da5ff3dc8
MD5 1ec60f6251ee455a0502b523d2eacd28
BLAKE2b-256 810653d1d511f83f62ebb930bdc09564d4f8be530a19a2cd00a13c6752c47b4a

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a41d90425ebf745dbbc922548ccf303231c3ebced2bbc8d0223bc79f24f3d12
MD5 73e9024327f69ddbe1f754a6cefd3395
BLAKE2b-256 cbe7f3be2af4615ae9ab72b7d497bb111ef4909c1af0400ac1a9b54533fb7126

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bd5c589eb37a6a567ea48096034c3e0e166d58f8ddbae4c72b060cc9d20056d1
MD5 f0f0fd649b2d2b86de0ec75d90ac7487
BLAKE2b-256 4f173cc8cc936bb2e58051d0a239ad1722a74529ff1a1a2b5076f811e87cebb5

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 74a84daf2c44b387eed48ef0a3177c5089d2511b8f85c29e74baf7846bf0b367
MD5 f3d199c4ffb6eac7c98e39ae94194ae5
BLAKE2b-256 be9f29fe0bc4b8ba519d1d68604e28b2dd8f08595316e16cfe0e63d1041f199d

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 331a3414880a08a60d894a23d18ee3d8a6a1a7694872c5f1a9f850122f4a2340
MD5 e85e323466c46a5a489601ce20564289
BLAKE2b-256 f06e7ca25be1118b371f0eb68fd054b459c6632f91effdb730908829e7f84e5b

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c92dd024f56f4e3e00f2b7ab5e276fb61adf1e40d7a71a6c552d78053d5cdd25
MD5 6324c6aea189a89a7b409419d3dc7350
BLAKE2b-256 9764db707522f8d8a4aa254f88904ea353cc4fc7d08fb9b6a00e1edf70f4820d

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f42f3f74e471b7d94cdb446512652d7155736ad0bfa7d26afb48251191fdd34
MD5 3e86815acb7ce23cce7f0c6dbdab4c38
BLAKE2b-256 baffa1fdcd0bffff9b31a68c691a9c38ffd2fcd6dfb4e903891c9f6b3a135faa

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9c934c59a5754fef5f14c74e8ff7159b89c8060c0a65669cdbbba9bde579677a
MD5 bf812dfb71bf31cf16c714e688855257
BLAKE2b-256 9b316ea73061d9c798212f920971fe3e6b3806f8e060d55b9cc93c6edae818a6

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.3rc1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 125507bb21ce964a3b163b3e0ed5a6e01b596515b914dc40477559965e914885
MD5 a202ef41054a1ef885e5b1dc786babb4
BLAKE2b-256 fa69c8c0e2ce2b2398dc5ef6dab067b822e7f9d1e9b44bc74929a328c7ec9102

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