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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

lightweaver-0.7.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

lightweaver-0.7.3-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

lightweaver-0.7.3-cp38-cp38-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: lightweaver-0.7.3.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3.tar.gz
Algorithm Hash digest
SHA256 08e3ece33a7cd260749a945ae829987de77245fb6fb5c13a9112d56ea5d58eae
MD5 ab1a2433120acba17c1db3079f242e6e
BLAKE2b-256 aee246fab1b95b785a18fb290a4977306b3f76cb2d0a156b9d555f290b4ba5a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.3-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.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 631128b3447e9e883cbb89b9b1cee49f5f16e00f7f83cfae0b4a4228cdc8186b
MD5 28e3fcc3f0e3768841457dbd5e3de4fd
BLAKE2b-256 ab404efe8b1c1ac18e891446ba480947d0147c2e68d9d7f86c0c2eaa7a6fb3cc

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.7.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2b80fbd368dc53069b87bb518daf5bcffa03cd06000e72ee4cfc1b896e1379d9
MD5 2abd5d497ab2a74f274341d27d1330cb
BLAKE2b-256 ca3e5d99ddca292d13e669f991555497561a0fd7fd1319661129395adbb2782d

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: lightweaver-0.7.3-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3434d05d5a08bfead4f9e9261d38d38717db047a576e4832df73966f6f5574e8
MD5 905081bc7c806f1d5a5d0a39fcc008ff
BLAKE2b-256 08a4d509e3603420f8178e3dd83d0aa4d06633624cb1436c6030267d33ae5d99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.3-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.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c066766431b2724bfa058cd51808b31da865f7d96b5940d7300b9c12a4cf1aba
MD5 d8ab4a29c33d55250383e5df911de311
BLAKE2b-256 79917c56bdd8c8abd2744e19cc06ddc31621d76d32c24d72fdddf4be1509d345

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.3-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.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 569de5272d3eab1040d2eae57eb4de0fdb62c2de069581aa74499d91e21ad536
MD5 1c644579ceb6e7f03ce592b93a2a719b
BLAKE2b-256 5479ab7b820300ce6c0fe32587d508ebaced44da77147eaeb4a0e2796a778c3d

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.7.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b2dc0a8d8489f9e4c4a750e5d29a612b724209c271885ec0104fd2663ab79ffa
MD5 da69077cb19a7c8c3ebaf051c4c15292
BLAKE2b-256 3357867e9201a5dedecd11c93b976af17cb06ba82baf26bd6d1936edf07c2a2e

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.3-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

  • Download URL: lightweaver-0.7.3-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.8, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b8017bb77e37f360097836b245b16b0ca902165b44ee353228bd4c40f9d5e03
MD5 c8599335b8468f7527ebbbccdfb465ef
BLAKE2b-256 6b3ab77089c9bfa02bb18de2cb5546ddc59289985d9b49f9457e985736b3ff4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.3-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.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for lightweaver-0.7.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6b9c4de4b3167fa4e6d26405314f41f50a8c449391e339557441a8843d9f11e6
MD5 df9b73b928ffab92df2a0f041ff6bc84
BLAKE2b-256 27b3b1b0eead246305d30ed859a4111e049ab030a96195207707000eb168fc26

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