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

Uploaded Source

Built Distributions

lightweaver-0.7.7-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.7.7-cp39-cp39-musllinux_1_1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

lightweaver-0.7.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lightweaver-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

lightweaver-0.7.7-cp39-cp39-macosx_10_9_universal2.whl (3.9 MB view details)

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

lightweaver-0.7.7-cp38-cp38-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.7-cp38-cp38-musllinux_1_1_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

lightweaver-0.7.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

lightweaver-0.7.7-cp38-cp38-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

lightweaver-0.7.7-cp38-cp38-macosx_10_9_universal2.whl (3.9 MB view details)

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

File details

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

File metadata

  • Download URL: lightweaver-0.7.7.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7.tar.gz
Algorithm Hash digest
SHA256 5502287ae066d657dbb017c27b93d6dd5af76318588ac87b0503d8339be67672
MD5 4b480379946727b9149fb1cbfda60f72
BLAKE2b-256 022126f587b31cfb9fd0834faccc4c86fb7b3d1078f1f1302fd644181849a6eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 94006307a5b4e824d0fd0511fb130b113230bd08bd692f2c5ec961ef84620bfe
MD5 6153a030bbd9cfa9eed11a490f6ab04c
BLAKE2b-256 c67d6cada1197881968ca6f402cca7721bfb39e06855229a24ad36275cc914f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp39-cp39-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e148d197a178100aaf8ad5e176b0d186b215eb701ea5b689d8017d42901fc5ee
MD5 248b6b3cd58ba91cf132aa7d297823ed
BLAKE2b-256 8c6dd949e57dff1ce70b95e0b8301a860e315bf7c4b9f64ca3a4677a2ef7a64a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.7.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44665cbfe7be89c0ca0c612d57c5360148166a4f03dc8877a8a2538f0e734e3c
MD5 b9be62c9fd2dc37e91ce285c8a0c7beb
BLAKE2b-256 6dfba2987e42e452bb9634055bbcef8918db9dd8979550106b3e8a3f97e95411

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 131c0a8e03541f1092314d22bb3e8c6c6d6ad94253776df27ad9be5e95167b48
MD5 28c1341dcba49de45802bf5faf157132
BLAKE2b-256 f5faefc78ab3b40beb90a69fc60c437249cd1f0bd5b043601881b2fcca9e7c61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1fe0bf117497de26441b1d56051693681d12076089a7057e371b072ed7009e18
MD5 c06753732d7b0b89040138847f09d09c
BLAKE2b-256 258c8b6771f4f5d08f98f60e8faac985f0d9e359d1f793a13cf57aa2107e3f01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8a62a555c1312d585fd6ac8243b751556d4bcf2d6f3540e0ee5c1292c05406b0
MD5 c0e7e83db6d666a9444e50102afc70ee
BLAKE2b-256 99cc307d9661827e73b3043d5a303240930d489df2af179c799daff2958e5f85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp38-cp38-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: CPython 3.8, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ebc028198e9d3ec17f0cf87b7f595c766d444ab2a4d2c94dd78341a4206ca8f5
MD5 fd625aedf7353bb01aa719ca4b072d05
BLAKE2b-256 98e953480fca454656970589819deec7f87041d664fb42dfa896ed561ec07bb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.7.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4abbfc1e038eb5827e25507db9eabbf656dd067ee68d0a51e4a15fcc2f506ebc
MD5 80f5844f4e8df4e96b593b27a7ec28a4
BLAKE2b-256 beebcf6407383201e956f6e4bcc9d8f16e5a18557c3319f9896e1e393d0f8079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5eec99af2fe06ad78894919e905883ad2312e5ac7277464dea8a7678266245a6
MD5 1467657f2431a6c7f6063ce8806059ea
BLAKE2b-256 474102f12d786a45661b9fb604769ee123090973cf0594af8e28233fef7fa548

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.7-cp38-cp38-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.7-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1c1a74edc6c4e2b13288021a73fed17947fbb693d25bbe48d579b6162e0d12a2
MD5 63b04369bf5b377d28458ebd54089770
BLAKE2b-256 ae732f659f5b8841749b141bc5ab039fa49342ab9731ce865eb5d487144bb2ab

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