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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.7.6-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.6-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.6-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.6-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.6-cp38-cp38-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.6-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.6-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.6-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.6-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.6.tar.gz.

File metadata

  • Download URL: lightweaver-0.7.6.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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6.tar.gz
Algorithm Hash digest
SHA256 b77cf97f68856dc2f6e2a17d89771f152b1729100755ee2a104ac5676102ad26
MD5 a9d0693088a9bdf7ebd9b324e2cb560e
BLAKE2b-256 7c00dacbf2f6a226d94adfbd3070ae26b4f36e8de1560f61ccea38c3c570b0ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a4d3bddcc0d42e1b13295ea4e5d8b3a7a4a6e26a4cf4375b622eb26410455a00
MD5 2893c2ef7a9ec109a433b8f66e70dd07
BLAKE2b-256 a4b9454b3ea345460714071880b16bb8b29f04da7f716d526b6a7da93648378b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 06b1a46415d2c0f07f610bcaa4601ba33689a58f00058d9e75edb88a69343700
MD5 4414dbb97d6dab232e06d46bdb030e62
BLAKE2b-256 84db1aee029a6e43808105c3111f1507b26f16eda9069d8b42b48cf349abee06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.7.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d06e4709474c529ab58f51431a0e8612d476c537cb18a3fca052e408b1e52b0
MD5 da89144b382c847c978aca1dc69a1615
BLAKE2b-256 686638b66c7c2a1f0d0dea6ae3df45a7df37d80881c4a65695867479d92c8abf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4098b1eb1295978e4ca2eca2715ee3770dc5dfe47b1d84017e74df6d2371b0d2
MD5 e475ed462c76c2652408e898c1c7a042
BLAKE2b-256 77affb5b0abe1372d01decec85c2b7554806f1564bd961ee6084f293731dadea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1a3bda7a6ac84a40edbb088aa77900a2261cfff7008d13f1705b03d3f764ac0a
MD5 9f7379568ac26eb0fc86a4bd50445c41
BLAKE2b-256 fd28bc77c4d18a1156a2750db0f4dcf92b7cfe080eb468c21e27ee718bbbfdbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 da6487cf382e926a5718d70861c0accd74cbb09e1376585e1fc180fddb7d588f
MD5 efb24d664f33eaaa67665d83edd93ad0
BLAKE2b-256 b4c70eaa84fc96efef8169f478db6e000853f3d77f70dbfee263dcb81f9dbcb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f26c4d010e1fe61f0cfdfe6ccf85b925a7664938d8cdc486b6d4fe25c7b4bb25
MD5 7e6b80fa11d2a02d2a44df06a69ecd11
BLAKE2b-256 95fdd050a89bbecdeb380a8f4c788cfb54d2ba9fe1a0252942ce1ca02ecd3079

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.7.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b08646a8e46733f497bb383de49cb3dcecefd2571ee29f848adf7dd96c2802c
MD5 33e010dfda29e980d60b6d03267ae537
BLAKE2b-256 f0e902a9146f210b7b43554e7ea732fff7c087894709bc5684135ad7ce39fca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fe511bbbbe4f4d150753f6917586e330ff9e87b1e72b7e88e88081e234106a67
MD5 253e319a58b469d5bda26b5b50ee222e
BLAKE2b-256 760486aee13a197cf68ff813937bd61e6e0129ded804df99eed6c6e0a01a1ba6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.6-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.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for lightweaver-0.7.6-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 abef05d3956fa7503e77875861e4a953bfce10ae00b31446b9e22461b264d9a9
MD5 17dcc735a99f19930de1782c1206fbd2
BLAKE2b-256 12059017a797505aed048b11ace6e80d352688cc18c9b8841198f87adecfacd8

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