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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

lightweaver-0.8.0rc7-cp310-cp310-musllinux_1_1_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc7-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.0rc7-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.0rc7-cp39-cp39-win_amd64.whl (11.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.8.0rc7-cp39-cp39-musllinux_1_1_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc7-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.0rc7-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.0rc7-cp38-cp38-win_amd64.whl (11.5 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.8.0rc7-cp38-cp38-musllinux_1_1_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

lightweaver-0.8.0rc7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

lightweaver-0.8.0rc7-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.0rc7-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.0rc7.tar.gz.

File metadata

  • Download URL: lightweaver-0.8.0rc7.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.0rc7.tar.gz
Algorithm Hash digest
SHA256 3d89a230579fc585935d1b295c39334e74f031d1e2736f7c248e3ad2f034bb4d
MD5 f07fae0795c72da109967ccd7fea48c4
BLAKE2b-256 373d63373e28e0d76f223fc75832a57dbe4a54bb8699021256681f33b40f942f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e933174ba36a6cedfd814243a3252673bf88990fef6fe5e980df21cfc14463c2
MD5 838b05b67a17ec517d7c0ac75386cfb7
BLAKE2b-256 5d35f902e9012e599b89f631c0f66123c5c4c48303fa4131d2bdc4659c22968e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1112a0ec14e77c8c4be8258cd08b5d4511b3e502055b3e6a8395c352b38ce5d1
MD5 e98c78ca1efcf654ec5d6d6a38ec4d08
BLAKE2b-256 154568c5a4eb0a2204e1653b1181195c516873b207115bc25f917e1bf87599bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4636f2def8dd3d997f1f98a9624ada4208ddf7caa901521094e94a8ee0bfaca3
MD5 ffb5197b7bf3b20a5e7da4ef5cc6f0a0
BLAKE2b-256 ecfb8977c9226ecf90c730cd26c2209d21a752bf0a4e4a684b49ec40b186dde3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dd88a3043b47496a0609ede14fc971e6dd163d2a96826df2ca6ff0cfd96cb768
MD5 cb0b1c1e8a65bd63329aa62d90e08553
BLAKE2b-256 08b9683aa79e935cb09b2a3f3a8e29a4c86abda4a87aad7794bec5afbc2ebe2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 91001efcae088c72e6e08877eb02e6c7f9192fe64f7d2f5a85bea321f20732b3
MD5 30b738b815282e92a07fd957f61b0be2
BLAKE2b-256 07871b5a07521042a17acde1e34109d6db5a41676984dc3007471c0e399f9c95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4c579801ca2f96dffe04f7431835309484a781e7c9cf49556ff872f0efbd7c2b
MD5 6a7a8b55b6d51b97435f9df2a5db3844
BLAKE2b-256 ba34cf6eb763f12c0e467b05c302146ba73625d51a68d43ac7d0e019b8a40940

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ef7d1ecd41822400f2beb1e5dbcb54970187d3f2de7bcc34353eda04e1384989
MD5 4d9391506f041a4e3cf23d50ba02e7f9
BLAKE2b-256 36f2787867b17c9daf12d105bb8f93a630c64da1c24ffb04d90b08710cbde746

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 565b0ebf5b205b968a92fe7d3224a8c383dba60cf578de9ad356bb53123e84da
MD5 a750bf6c2e38606caf7851c6bc7fd1f8
BLAKE2b-256 b55f9589b19906f292954efd570812e52fe4d33e3c984133cb4fc823302d7b2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1c3edfc907b5c46c1d965f748019ab3f90dfd6b1af9f25283e00d21664f5b45d
MD5 82af0178730cafaf9c9147db98aaebd2
BLAKE2b-256 0a77aa90f378ba76a65cd2dbae9e05b968b3cf07e88f6f48a3d52ea0c12f12bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3e4e2c830bcef08adadb1ae42a3af9bad05c3533d7d48dfa8b2383f8ddefd7f4
MD5 55bde23cc20e7b33f1279c42e9e88471
BLAKE2b-256 02110415672da39ea22274b8d95001adbf69fb66fc4d2e4ef70c6e4f8aeab314

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 edfdc837dfbf5a8170d45154d449a002d4f47491ba28ada60cb07bf6d9de32b4
MD5 a3874a417a22903f3739df91be572b3f
BLAKE2b-256 84ea90b713e49d0d9c3fa8fe2b27607c0066e1f56514935feb1d74f303a4fae2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 67a2958d9bae7cc4eaeae7d2d895e3a20312a11a2d308bdb981fb23ecd275992
MD5 23741eaae50939e7b62c07e29eb4b2ef
BLAKE2b-256 c0cd7d8b5f2cccea105a6abcde93ad23b6b6ab999f72bdc818abafe74e6a1959

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce2f8e47e9e8d9d4a510aae7fbc4123302882d40c8a5cfca5fbbd6f6d64f3ccc
MD5 0cdd5087fe4814f401d01ae57b3bb2d6
BLAKE2b-256 dcee689b32ac47c25268054398193980a894921f31b158bc7f6342d97251f649

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3740729071fef9bb4f6837b915313aed76f3192553573bd2c149b3e5891fb029
MD5 b2a13718ab8959dcfdaf4b6e2c62057a
BLAKE2b-256 c1a5e02b5122c967c923ce5f6fda1a3fa83ec24f1a17267346ad088873d31dae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0rc7-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2831977e275583f25bc290a1d35dc0825610c01ba2487df21c3ed9d11814e56d
MD5 2d431f6d0f283bcb33ab10e9a2632331
BLAKE2b-256 8dea55b1e43414ab14516fd179e22ef9c67aafc702e35868a44819eeee287e66

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