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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lightweaver-0.14.0-cp312-cp312-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.12Windows x86-64

lightweaver-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lightweaver-0.14.0-cp312-cp312-macosx_10_13_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lightweaver-0.14.0-cp312-cp312-macosx_10_13_universal2.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

lightweaver-0.14.0-cp311-cp311-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.11Windows x86-64

lightweaver-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lightweaver-0.14.0-cp311-cp311-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lightweaver-0.14.0-cp311-cp311-macosx_10_9_universal2.whl (4.2 MB view details)

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

lightweaver-0.14.0-cp310-cp310-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lightweaver-0.14.0-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

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

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

File details

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

File metadata

  • Download URL: lightweaver-0.14.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lightweaver-0.14.0.tar.gz
Algorithm Hash digest
SHA256 1d0df2b9434ce20175e3ddd54c99548310c251c8f132061e1d35fda497f8a66c
MD5 782a0991308f4d5ee79cfb11ffe95887
BLAKE2b-256 8ecb72f68b4c9b56aece1644de1772c8dc7a582ed095dc025d5dda7d01be5470

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 413472d1fc3ad24b53621129c085e1a291e507fab756ab74d939e8b527d3aa7d
MD5 f13cbc5e6f09c32ba9427d7d927e7e6e
BLAKE2b-256 ef768faa6657dc949b7eadedc1ca1fdb3dcf51d6e10245d9ca1ae8475e92385e

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f330c018694064780946078ddbe1818b1372d7eb1f0173bd94e715fac25b960
MD5 15107465cfb25d3ef2022c8df00597f2
BLAKE2b-256 e55eb9b08b9134d2ac052e8e92027421fa66e02a8674f37ffd107ce3acf3347e

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 aa7d8ba7f502958254948095420f40db96ab441fafe1285216287952601d7e98
MD5 645625f6b8a301c5c7bc1c6bb7d04703
BLAKE2b-256 eb07091e79729cddfd68bb3e785111e6b3061af4c6fcc6f82a0cdc4e54575ba9

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 bf1c6fa48a7ac5e08ed59d3d1f85f61a89e0eee2e59c7413aba8a518661ec6f4
MD5 66acaab6f8ecab8de31fe64cd7fc1f7d
BLAKE2b-256 a81d9b816601ab273f51f7c611f1ba10f727b9efdf12a579189d14c097509d8a

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5433abcce9ff9893bca13fa12db5ea0e79b11bb1fbbaa78f2843b06d6ad34341
MD5 6f9b72e0125bd73daa275cb0f2ce47a0
BLAKE2b-256 0503c55a600226fb468bcdc4f7f8498cc866fa09591b9204cdf38cb6bda4daa5

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b8272d03faa882c7484a491e53073ea6441732e0d2347f433f60414f0de3456
MD5 fb084c935464095af90341ccb9c90955
BLAKE2b-256 e3cf2d4e19c35a1ec9ef06ddb560980b6f26530b98761429e4b17097eb9ccc2c

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 46688bf7fea720cdbd0d846c9708813d581914fdaae82cdd29e380276b00b89c
MD5 fa2b57932d251066d908d92056fffe3b
BLAKE2b-256 777c8271df17ee6ac5dadd09d5b12bd602c6962faa80d8785656bfd8c31ce234

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de2a670c8e7bdf503aaadb859cc4f0c1e46cca279b9494542d0d75df916bccc1
MD5 6f742453f459ea346a15480126a2eaf2
BLAKE2b-256 91c9cb1f4b9b686a31e21fbe4321ebabea9fdfb2c8a2a5e7b68f0ba1b6569622

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 05855abbe3023fe8fcb3d8e53b69160b6df31861a66d36db2dcd9079016be740
MD5 91bf6ef8dced8b571a353c97672b1bfb
BLAKE2b-256 34611718d59696bd4fe47840d2f4ed2df7f89088ad24a2eae447ccb77935e80d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2494e9696ee192859315dcb7dc88d70ba08a1f1dbc46e11c7f129d6debdf7b52
MD5 4b1dda4b6db616a5100122bed748ffc4
BLAKE2b-256 1d1d82c38091ee4927e19af8abca5078095cf1c47ecd0b6b5e69a1eedb161f90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d9aa383fbd42e033fb351d17e89cee4f994d37c79f1a1e6c796375c687a4e63e
MD5 70b3088e88665dbd55919b413776961f
BLAKE2b-256 07e38fb1c9ee7f0fd1b37604aad404e3ce256accce9b22f55fb35d45d045cfc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2b3391e700373492dd4d43e4e885ea6d8e0b3e421ceea5eea9d7e524c49db99b
MD5 ed3da7c36a196431ada98e64a65850c7
BLAKE2b-256 9a39f33f54c45f766bcbc194f6c0c1dcb388f9b9ac77675152d0f8c0daaef895

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page