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.13.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.13.0-cp312-cp312-win_amd64.whl (12.2 MB view details)

Uploaded CPython 3.12Windows x86-64

lightweaver-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lightweaver-0.13.0-cp312-cp312-macosx_10_13_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

lightweaver-0.13.0-cp312-cp312-macosx_10_13_universal2.whl (4.2 MB view details)

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

lightweaver-0.13.0-cp311-cp311-win_amd64.whl (12.2 MB view details)

Uploaded CPython 3.11Windows x86-64

lightweaver-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

lightweaver-0.13.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.13.0-cp310-cp310-win_amd64.whl (12.2 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

lightweaver-0.13.0-cp310-cp310-macosx_10_9_universal2.whl (4.2 MB view details)

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

lightweaver-0.13.0-cp39-cp39-win_amd64.whl (12.2 MB view details)

Uploaded CPython 3.9Windows x86-64

lightweaver-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

lightweaver-0.13.0-cp39-cp39-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

lightweaver-0.13.0-cp39-cp39-macosx_10_9_universal2.whl (4.2 MB view details)

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

File details

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

File metadata

  • Download URL: lightweaver-0.13.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lightweaver-0.13.0.tar.gz
Algorithm Hash digest
SHA256 ff8c0dbdf8dac5666f8341378f4066759554ece95051ccdd507426ef3198b4bc
MD5 0ea829bf56cdcc0733fcf9fb5da10b00
BLAKE2b-256 900c516e82852865aa929246ad7e11246a3ff90aac1626b4a7dfac2af776700e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 680b54d7bed88b024ca86b9afd600986cd78436cdc72081b683ada68d33ba809
MD5 b35ab5645cb712006d2f99312ddb4403
BLAKE2b-256 3dd178313234e76f20626713ceb7c8f752891994699d3320bbd32340eaad9f82

See more details on using hashes here.

File details

Details for the file lightweaver-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2356d939663eb72b9578c795b2b3bba98d70f54e93ac3e3329a32d58bc1a5b35
MD5 e65af15ca4a10447c6ae0c624cbc3f18
BLAKE2b-256 aa8ccf466b7f0e2f4d8d3dfa4af98648f179cf69e922528a4367367562492494

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 14ad30f525c1ac45d1f4077e8ff559f6f6e30fad4f0d5cb31e4ff1f87af3dded
MD5 a93006ea5aee1f9c0ea61db69be67574
BLAKE2b-256 fb64d2b50b45faf3d3c8955cc17d05571e83f8e1b218c0d0ad6d3728114a2b1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 fd4d429f462ed088701a07939a445a0a4d6749d90b994b3ca7bb7e65c0d88d4f
MD5 c7366d8e32e9d7200747535473199247
BLAKE2b-256 a2f8988a7ca93040f9c95aab9523f08476cefe2e6754d678ee58dc1fb7deaf63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2378172b5ededffc1fe0d913a0a13826d761d188fdc60942712b1880052ec8d3
MD5 01020122f6d2b98e99c4545485b3f912
BLAKE2b-256 569719fc79d1b91719be7c7fd92727a7ae9aa2d21cc512b5eaf66ef6f232a223

See more details on using hashes here.

File details

Details for the file lightweaver-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ad0c380a19f6db90d137348042684097d649e4fa29b09572e1898378dada9e0
MD5 2bbcfc6a43266f8148704cdb06faccd1
BLAKE2b-256 63819d0f90d0eed6b4e4e7355e48c545cfd5078f01345d13c4a870bd2eb14bc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 af6a174577cd4355a9381ef4e48056f69e388fecbb87b1827ed0f039956f46ba
MD5 5dd97b5a6b4ce4b41d922bb5ff1fe539
BLAKE2b-256 9cbf7275f5396cfc03d8d0daf189a0b1ae934944ae1e86981e2476053010ac28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1545034b515eeaedffb67025e2cf5d68949a6ee8a1f834c831d3051f111b8a79
MD5 c782ecfbcba32a6ed7a97c25573345a2
BLAKE2b-256 eaa26c3c025f9c71a83bf41ae8c3e1a636a3c0e08bd21c0054b7b45253b151b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b8f4df00b675b8758b36acd47b23a783a5becaa4f96aa405d9c91b96dc6b7ca8
MD5 8fb831ae66aea39cbed3bbcd11dadd4c
BLAKE2b-256 e5d97c2b52624dc100c8e19ba772f3257c3223c7dd017febfab28f28ee84ccb4

See more details on using hashes here.

File details

Details for the file lightweaver-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 34e1ab5aba61090efee5ce0fc741fc53655a7bfb415c3eb9a26329f6179a421e
MD5 81bc0c5e972bb084c67c6c7b91b72b06
BLAKE2b-256 79183519dac243a5d6c73ff4408c810211fd66ce716426dfea7d8198b921f3e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0beb316d8e0fc7d2a566d4ea5323cc06cd634dc99872f34300c8889e95d80824
MD5 6edc2a028ddbfc560eab2900f3164430
BLAKE2b-256 ecc469012ad07c54c39f16309e684d0c1f74366d022e3ad34e4b9501b8d0ad3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b54320c7ff36a73b3d302e3ce471ac864c8757929ed3296d125089e56e56f82d
MD5 e15df36c18d391acaf3f0008cdc2b2b1
BLAKE2b-256 082937ff6b4a65432b5f45b556457fcc2d2c42978dfbc02ebf041f45920b661a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.13.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 12.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lightweaver-0.13.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 42f220ec8b9fb8f8ef631767974ec99db2e31b3590a750a240c025e57c80c97f
MD5 9e7661c65373b09ce6bd0f3bdd06cac8
BLAKE2b-256 800c44ed6dcabfdad20ba9533da408749ba957135021fe6306500f747d3b3e7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 779141f846c9ff263fd3aa613dbd9a24bf556ea0c42a679b16cb680c03bb3973
MD5 9680c4640f977904484ea0c80a6ee595
BLAKE2b-256 346b2a06d57f3344d580e93e67cdc237fd0cb1cdced4f51465dd95a4aab36ed1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca80fc98d1e792fe8d4ad6537423db351a5fda7fc09b093836b17fadd5e08925
MD5 842c705c327a2b3c016215dc2defe49e
BLAKE2b-256 82fa63d3cd059583cd95ba140255509e820ab46fa2f97857a09745d1a890e496

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.13.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d70d543c4114623bfaf1131a9bc5f1d67ae20f7355738171370b93ed783f0708
MD5 99802fdaa36e468c73f355532b7b5c2e
BLAKE2b-256 e0d9abf196cdbf4e279d39e1c5a05715a4333f5474e7351a1d931a5b40d2c5f1

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