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

Uploaded CPython 3.12Windows x86-64

lightweaver-0.15.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (20.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

lightweaver-0.15.0-cp312-cp312-macosx_10_13_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lightweaver-0.15.0-cp312-cp312-macosx_10_13_universal2.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

lightweaver-0.15.0-cp311-cp311-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.11Windows x86-64

lightweaver-0.15.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (20.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

lightweaver-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lightweaver-0.15.0-cp311-cp311-macosx_10_9_universal2.whl (4.2 MB view details)

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

lightweaver-0.15.0-cp310-cp310-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.15.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (20.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

lightweaver-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

lightweaver-0.15.0-cp310-cp310-macosx_10_9_universal2.whl (4.1 MB view details)

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

File details

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

File metadata

  • Download URL: lightweaver-0.15.0.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.15.0.tar.gz
Algorithm Hash digest
SHA256 8d73cf01f82cccc160066033c703cc72e167d310eadeb310423325e29e09c978
MD5 d704fecb28be3daf71056d6a5eb6b607
BLAKE2b-256 168f78bc18eab697964984df9468da2dfe5733f6df97f60c6f946e24eb9647a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e17cc4e41d587fb23568982e4587f7f8290321b3b97eeeb497da72802743fc58
MD5 6e834d8da8f2eb495d26bb2ed6d2d030
BLAKE2b-256 d4d7aef15bef66eac203d457974346746b038e9d0f93de89fea40169e57e806f

See more details on using hashes here.

File details

Details for the file lightweaver-0.15.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38cc30a09c31568c2abb25d88396955c325f3f1ae5093a69e5dc0b43f56f99d6
MD5 8f923f7407371f51fef11ac194152f0f
BLAKE2b-256 b8f08f4ebd748e59e9fdba190df40c93880c28aa55eadda75c440ef73cc3b2fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0c465bcdcadf1208f817569338af3c6347723d5333bf655b3598c942173f84e9
MD5 c738f5f82848c8a8cdde19fe24822186
BLAKE2b-256 807242e455f6c028c2ae6d88178b355059e0b7a94fabce4bcdbc4f6b2279ca73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1b5cf70149508725e1b862a18344653fd5c3a3735a9c52f42f0d68e9be6cc9ae
MD5 b8cbcbd478e4a0a53b1dd67f4f9dea11
BLAKE2b-256 239cf89f5e582c62c3e958d5f66baa517159fcf7f3e74fee338d588e623a9595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aa058cd3a345d43e2dcd287b5abccf794a395436016a5b92ec2892cf21405b05
MD5 379733f1a15a01b33d78d9f071e4bf7b
BLAKE2b-256 23ce16e57da1b640adb27b6b4319e7e9aad2060dbd5787279189d870cd281da8

See more details on using hashes here.

File details

Details for the file lightweaver-0.15.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 131e7934351460e658dd74f48fd07710f4fe08aa33e38fab9e2e0f72cc6f6de2
MD5 809488fedde30b4eafb74c31298aeec8
BLAKE2b-256 275323bc37177c7843df73db718499a569ff449812d6a6719b45cd54143bb8ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 348d95204b9fa184fcd87b2de11eb26b7735bb8ebe791a282db840392ac37c4b
MD5 60405d30f14a87f18021321ec74ef928
BLAKE2b-256 1864754311532b2972f4b273203de762e93e1b2921514e0a70c8832fc40ebac5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 252696388607e34f7748d57c3c2fe17a0bb4e1cc5cfb2eea60ef5b10acc34f77
MD5 5238798b3b5190ca03c08a5392ba0b29
BLAKE2b-256 0fc3679326a7ef808aef02a871c83f2402aa86afff6584f0d6d386cc628c6de5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 564f0f9b028571583f85aefe341a16cfcdff5e4e845d82092e1cc309c60fbedc
MD5 9c120c0b30a0c36373116907ae8d9b12
BLAKE2b-256 da7c8dfd1a3d85ce6029bb0943de09e23d0ebd33bc4380504191a8faaa881ca4

See more details on using hashes here.

File details

Details for the file lightweaver-0.15.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1d63c76db68af20de32965024bff76ab13699df1fcd155a8b3f13529989465f8
MD5 4b99ab2bf864a206a4c0765a5bde0e68
BLAKE2b-256 99d90b971a31c3a37605222f2402d53d4d033486211828da0b7678e6e5575ed2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 db60d89c7901d41e7cbcd7b5d135fade955fcf3578169f3b7b7682980d27d75f
MD5 2cf7cc36fac716b818c88655900a382e
BLAKE2b-256 733ab578ea089398cb558c80ac5711425d7d89c57e43cd550dcdadaefc3a140a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.15.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2f65a32868d86f702a41b8b3e6c8d42f6ce0f84983dbeff506963cb1c3493c67
MD5 f2c17ea6eddf3ea522228e55451b5716
BLAKE2b-256 190394f8f9ce4ce9c598a2500080195a4044cae30666eed6e92642c307dd204e

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