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.1.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.1-cp312-cp312-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.12Windows x86-64

lightweaver-0.14.1-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.1-cp312-cp312-macosx_10_13_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lightweaver-0.14.1-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.1-cp311-cp311-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.11Windows x86-64

lightweaver-0.14.1-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.1-cp311-cp311-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lightweaver-0.14.1-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.1-cp310-cp310-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.14.1-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.1-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

lightweaver-0.14.1-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.1.tar.gz.

File metadata

  • Download URL: lightweaver-0.14.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2310add672829916effda578d4fe0eca6111e9825536fe3aaca90e8e32174279
MD5 f3361ecdb3234836fd80413c40f1b806
BLAKE2b-256 631faee3245d929eabb599e8752ac2cecb480ce2e0a0ab2a43621232145be9cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 454b1c833c534a5dc8c8fa4b9f1ac4a1823bc435b39756d04733730828bb49f9
MD5 7499cc2854ab2275a7660ea863822114
BLAKE2b-256 d764ad5c0ac6a75a57f5181c176d788eef75b5bca2edf2618bf8ac97c1110c35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc5225ef618212b341467b91ff3743c76eb40a1685ae03d02c69f3387353675c
MD5 25cbe2955ed7b66441c817f69e8c8388
BLAKE2b-256 a66f77eb8eac2228153462ec115900b8c3bac8f0c03a7f1abfc6ec7d81eb570d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0093a125d6049e0bc28951f0ab45af6e3481e004a03469772cb0d3c7994e8198
MD5 c2b0d9277eb11b6358a1bdace9e9f1ff
BLAKE2b-256 39a0753048edae4ddde617eb290b57aaef5b1e00fcc4420a59c0c7e4dd8669ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 be242caf6b5710902b1f969ecda9cd4588daf711858bf238f13dff54288adb0a
MD5 d1401526246e6ec326604d6158ea6fd9
BLAKE2b-256 3a505b7e22eab45e7c507f101e76cc3802814d6fa57ffbb045eb0aa13de1c97f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a8747d9bf07f149c791ec36e8e39bc10bbec350a275cdbfc3220088098c21cb0
MD5 7996d57ff2a9449a4d2866f8d3502403
BLAKE2b-256 d2df47a1b9c35aac606466570b5b93820889f75b4593fb1958e2faf109f68a36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97aa87b107114bc4412286317f685a21aeb6e020002f8bae20eabfb6adce732e
MD5 9befb5890f65693577002d8c8d220707
BLAKE2b-256 0539d37a96cee5c941341e9e7d783a99ecc0b137028cda1fed5e0134ccdaf69a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3e64010d178f61b39e0436c99a6865c11f97b043e5f6b1a4f184f1cf64e06c5a
MD5 24188817739f3d790c85f809b103294a
BLAKE2b-256 ea1abc789a0ae7e9ab1b2d005c92967bc2744eafd432af8044682925ba40d84e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6d25c8c22db89bd755e572aaffca289b7fd7105ad38c5a7aa0ca9dd2d88dd541
MD5 dd35f881c569fcef7bc122682a8e1291
BLAKE2b-256 9e76d1ea7cf41915d557f8e27d6101d1f54e0c9db0ec3c65e8367eb88809602f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 01a159a7ba7ebe58588ed652f5a54903a53334b724f0624cf93237ac608c946e
MD5 15213512bfc7c17dbaa547adaff4a6e3
BLAKE2b-256 9b054da27f6009e2c4fa260ac562a70c086d3e9b3e838296f4328593e58727d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 348a55c5899310c63c0241286e3836ecc59ca673bafb7272f1801581cb618023
MD5 280e0d057aa8ca9c08cfed57d94cee17
BLAKE2b-256 6dc2fdde16bea0fc76ca5248ea3ad1e725aeb324f0fbf28b3ce41749440ebb7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9a023b53f16e1db66fcf8e2b29b3ea9588bfc544e60321bb8ba05116e84fb902
MD5 ec0ca299970d8d7a7340c9cd5256e915
BLAKE2b-256 8f440b4eea2a16e7938df1026bac84c915d9c86c48b272b839b88dace0498216

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.14.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f23d736fd23dbe3a37f73e921f87e2592c6aa7060e454b793a7e781f022e5330
MD5 e7060180b7bdf34ed657932b51b63246
BLAKE2b-256 9a11d4b6363a467f2b4a04a7b58e3a87c012fe25cb9354382118a3cc2ac40eea

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