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

Uploaded Source

Built Distributions

lightweaver-0.8.0rc6-cp310-cp310-win_amd64.whl (11.5 MB view details)

Uploaded CPython 3.10 Windows x86-64

lightweaver-0.8.0rc6-cp310-cp310-musllinux_1_1_x86_64.whl (17.6 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_universal2.whl (4.1 MB view details)

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

lightweaver-0.8.0rc6-cp39-cp39-win_amd64.whl (11.5 MB view details)

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.8.0rc6-cp39-cp39-musllinux_1_1_x86_64.whl (17.6 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_universal2.whl (4.1 MB view details)

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

lightweaver-0.8.0rc6-cp38-cp38-win_amd64.whl (11.5 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.8.0rc6-cp38-cp38-musllinux_1_1_x86_64.whl (17.8 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_universal2.whl (4.1 MB view details)

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

File details

Details for the file lightweaver-0.8.0rc6.tar.gz.

File metadata

  • Download URL: lightweaver-0.8.0rc6.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for lightweaver-0.8.0rc6.tar.gz
Algorithm Hash digest
SHA256 f7a8e69f3a95cfa9a3a6116d0d6daa83f2d7c50b66b9f30e6afb4d317f1e156b
MD5 b7d9371be270ab1df5817e976a5ba392
BLAKE2b-256 106e200c0710e76ea1fc8aff2bf06e4641fc6d45dfd649e591bf16cad7a20a94

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 730d1b4db1b95216a87da647570618bedd24e398792f2eb6de272b9c3e376704
MD5 eddf370bebdede759e6df06a6c2cb2ee
BLAKE2b-256 b0070401f38254944092cb6eb955768ff995b74e494a02b661e60dbf8263c365

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e3a4b5513b19a276528b4247fad6103966ee8f63944c79e97814ea90ca733202
MD5 92318c3ce690dbf46b52721093961603
BLAKE2b-256 8065b9cdd6ac6a9fa5412ee5673fa7009cafa897d3f1cbff49cabe0b5ba5bd43

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3c583fe10c608c2d2246e27e79dc90994e64f7bab18049220ee47a08c91c9fc
MD5 57aafa545ac0fa8de0488734e06be6a2
BLAKE2b-256 f400ff37a1e9ec967222d5a3de1b6e62c36c7db3f10ac88c8f5d9f420dd8c18a

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 af2ed96493d87bbeac5828964298825a1bd287d1d856921ca8020f07eead9500
MD5 fb536d51d7f9a99192772153d32e5d49
BLAKE2b-256 a292a5eb47a7503c815b7b96bdbe917cae9f1deaa48ac650eed83a45705b1932

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cff05f0a52e71a3ad21583d4e8b60fb64d58eace897285508c0908bf39ce3915
MD5 064146d4c285bcf231e412acab8a7208
BLAKE2b-256 eb9698e334839608b51b50f73059cfc393b785067ec2e08cdb1b1f78bab48a41

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e0bdf69cdb5017d6d08cb19b1a47500d8f749b82916369bd3fb30e569b5cd938
MD5 9ee44324e58aed36808e87eaa232ebcd
BLAKE2b-256 8f51831ac27c5c1078a78bfdcc54fa88716d08b1b7bde8f9e1f32a9acc5b2311

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d06829c0be11786265a3338a2fa812499d84a57cb8c73fc80da90314a633d2d4
MD5 979c5884f4d1e2942d1cb023e0cd3e73
BLAKE2b-256 fcab2e8a1e61f0930abca77619fd9429567392c7478997c26783ff31a5630958

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba34d34b8125583aceb0f9718be2a35f7b7229b5ba341ecf200c7eacce3422fb
MD5 73cc063aa4391276f24e4cf938c53ab3
BLAKE2b-256 906aac3f1cc10a8363ec999aa980063b09b870c5e3ddc75d2818a62eb71d923b

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 331df891f41f5cb49cea6d524559c7bc2fb5045beff05a93e7b881d81e31cbe8
MD5 808f713e0408e0f41456a6ab97a07391
BLAKE2b-256 3600171bd70d19299dab57bbb66482fd6af2a87e2041b5b32203e3d83d453e3a

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a39999a040f1787cb77113eedfbbb423eebab66e37e14bbc8625655403a0eefa
MD5 98f66b5957dd454ae6ab60fe93c34fc2
BLAKE2b-256 96a60085cb0b668454f60a84b4617c2dc78bb0c667c0d1926fc7dd653641f67c

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 db4e4597eedb344455e36e7c4d64df7bc2aeb1c19cc68cd7cdbc0a827baca4de
MD5 18549135a120e33183a01759ab287069
BLAKE2b-256 168bba253e5abb7091237a4067a19277128c8ce1f1aa2237dab52fcd10aea171

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 24a180db8c133e693f13b8fc06853bdcc56cc23f62270e8a03f03e130537b48f
MD5 9612a8ca38896794b1201d302467fe6c
BLAKE2b-256 c5b09196f8b2b7f916bc528eb939b8c62d089ad7d410ba70766de29a6c18f34b

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 152f2be405eca04ecede07fb3dc274be92ad8aa773af8e17fe0f98d25de4da87
MD5 cc8bb81ac2b15401951cc59ff2034490
BLAKE2b-256 52bfd24a1564cb9b2ca92b629b25b75418700eafc7e7175c192dcd29081a8a36

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ab0760bc5aa063eafbcafb5c7512e5db6baa1001a61535abc35343433ef3b5cb
MD5 a8a592bcf707c5028813d2367bdf19e7
BLAKE2b-256 c3653a7f7fc3bf2aa568f31e2a8b0f4d52934dd90552fb537a48aa6c2a352529

See more details on using hashes here.

File details

Details for the file lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.8.0rc6-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8ec77d772a6409abfd9de8f8c9596873d9ab9ebba3e00ac7626ee686c027a180
MD5 b8bb26cc67fed92d1918559fd938b822
BLAKE2b-256 566551311b3f402402c2a20760bcddc212a5b90d5d107f57d9066bc45aea9afc

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