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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8 Windows x86-64

lightweaver-0.7.0-cp38-cp38-win32.whl (3.1 MB view details)

Uploaded CPython 3.8 Windows x86

lightweaver-0.7.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: lightweaver-0.7.0.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.0.tar.gz
Algorithm Hash digest
SHA256 80a2c032e87a6e69cbd5f43b900dbcd831639a65ffc95cb552fd920635b32cf0
MD5 84592dd247a7b6b80678a6e6719d0760
BLAKE2b-256 36511ec9252b2fced8e5567afb0675879def1f5caf4b198d25b9264d0b2f9c02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.0-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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 cfba52eee50c5d7622edf76cd8bfe587f77e35018d745b29275de4b95e8f3ca9
MD5 74fba21eb226022fda3095bb4492ed2a
BLAKE2b-256 9fdc0f3e1c3e076244ef3ea49270a58a25f7c2ecea1a1be28d8cefa57a642acd

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: lightweaver-0.7.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.8, Windows x86
  • 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.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 c9990bf30ef038b0b49abeb22b2cf5d10fcc765718bb7cba7f9fe6b985281189
MD5 590324c04691de664fcbc827f0b0a9d8
BLAKE2b-256 23b610ca1416b01bed5c384667efff391c9d8ff257bfb34c7f8c17defb457cb6

See more details on using hashes here.

File details

Details for the file lightweaver-0.7.0-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.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 79aa2c4b01592647c09019bc5d7a0ac7c06c50aab05960fde42c3e5d11357071
MD5 632bb8830178dcf909ed9d7b207bb0b7
BLAKE2b-256 33d2d1f6cbeb9dc65912144dcc965b39097b3beb9fdf02d8fb97897afb3ebad9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.7.0-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.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7df624378dd49dcc6e7093ba2708b2e89a6ec2f0b7d1f3ce5be01bba04f74d5f
MD5 e8e215e22973a632949747b57382b135
BLAKE2b-256 97b1b9fea1a54cbf40fcab60885f6f57fabdce0b2825e78f71fc39d11cd84d65

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