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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

File metadata

  • Download URL: lightweaver-0.8.0.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.0.tar.gz
Algorithm Hash digest
SHA256 83900fdcc1c0d6d274b685636cff288ee0748415bb65b86808e3a1eed56719c5
MD5 5e57fd5c6b66277eee46e670b1cf3fae
BLAKE2b-256 247bc1c6c79d540cb63ad1ee717e71eb059be9976c4b68f34e8239f1d36be6f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dd47483990018e99301d22b4ba8cbf893a7adfb4a28a9f3beb1e8fe739465516
MD5 01aa6f6417926d87788aa7e610fefae3
BLAKE2b-256 6477dc261ff52ed0568a83cafb04c65e8daf8a45d6bfd299f9b4ff063631fe00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 28a8e45ed7e7bad6c0da2bc2f5c897bd1c33f814e0f9e9fa144313f67243453a
MD5 f88ef494f49bfde49b10aa7a5287c795
BLAKE2b-256 047f86ef2c5c7b365599be1125d9ff1b93b4ea8513ed04be1d98ef78d3288bfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee7469b42ed52e528a55c3e14298eecd87b6da2973d162f785233f9c4751d0c7
MD5 067fa0c18fd89a9bb27704ea5cdced26
BLAKE2b-256 b5284796304c81ef195efcce9dab0a2659462c5428331dad1b3c54d8ee5f7b65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 79dd2d573fec871425771463fe0164965d673c8cf68a761c32b37da0736d5e23
MD5 ff90e96748b3a08bfcd579318eb0b1f8
BLAKE2b-256 89ac881664feeaf6adf022430dc2553e2d71f8eb36acc5ec28482d8bf79cd7e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 942cf85cc719d6bb2937513c0270b73c2b90a5ed4e5dc7f014243bb51d350458
MD5 a908cd8c9d57ef17718ede1c7fb56eb6
BLAKE2b-256 79eea753fad3cabfcb34f67728434a311e0bea1f18dccf22ff143492ec65f16f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b31264a81b7cdbbf2971c658c88c9d7fe738aff5a6fb83916d5b094522482c07
MD5 d080f54cbdfdc5f1b4cda114079c4999
BLAKE2b-256 e5022dc2d444d51aaacd102abfe5823e4cf558631c876dc27879099a3a19c479

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 abe2e22ab226388b4e684aab609b18674cfdef7717a1edb500c1c09d24a7f4ab
MD5 8f6f8eb5704dbbdd52da645d67a0ca0e
BLAKE2b-256 af24b14d93de4b62881a78358448c042562268ff712b8917c2787d6807f1d457

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28c501a62e8d372f06c34607e2b16b168d0da34bfb2d43d99041c5af51529924
MD5 f168e4d68b68fdc5ba2163ba1ed764ec
BLAKE2b-256 159e5a703d553aa255bb1ffafbd2844e05c16638562c19cf7fd5031b86a0398e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0f057f109ae2c5f98d3693587f9e49ed80b97e783a72e7561e3acb252aca61b9
MD5 483514f3511636be01a36aade3dc43ef
BLAKE2b-256 1ada5b561601430ca098c6e5fc11be3bf4afd845299f99d236977d1506488f65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0fa4fa77e46dce03e48a26ad3f884d08199370296f618a5793601c5098dac7ba
MD5 bb905cf655126eca906017c8bcb05d3a
BLAKE2b-256 b59c80ac8496bf2b513c848b1e959287a469171a1b81d64cf306b09df980c05a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 75297f0fe7877073a4631483046095e3c75bbcd960277ea38e4ae04b8da5e340
MD5 3672f1f7b1cbfed2beca2ccbd8c1056f
BLAKE2b-256 9228421a20071b7b19c2f6975e933170c98857a9df13021a6b94813c1fa2ea76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c7da0ec3fa6991960846a1053fba425ecbdb97853050a81bc5e8d3aec4c941fe
MD5 549a726565a064a4c0bb4119a387adf5
BLAKE2b-256 687e36cc9a3ef63cce26ef4369cc881397cb17200012a3ea9ea5351064f9a53b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6abb9c2fe0c92dc4b4920f4fc6eee5469f79941ef96207834cf6ec8002ed84df
MD5 00702b064436bec28f6f80f469bd74d4
BLAKE2b-256 5892806300d69b1422c2adaabfabfe160964e90c50b97dd1b85eaae6b6d4f238

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b7f44ab6f7002474c1f98fe8cda1e38ef3501579446c322375197b1375bf3698
MD5 88e0c2b23f92a10e187b75754682f6d9
BLAKE2b-256 33fbf7bf8006832968812bb45ddd63d8acb57760dd2e942cfc430c0516b54073

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.8.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 725678e0c280459cc82a6430e4498d044957d079f559ebf8f5f939fd2d1ab802
MD5 6856e5ef7071c5692a7f2b1e4a6b4364
BLAKE2b-256 4116f8feb0f86cbc9f93b2f37b5c90b00934cf76eeee851a33e54ecf5c8de3c7

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