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.14.2rc1.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.14.2rc1-cp312-cp312-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.12Windows x86-64

lightweaver-0.14.2rc1-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.14.2rc1-cp312-cp312-macosx_10_13_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

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

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

lightweaver-0.14.2rc1-cp311-cp311-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.11Windows x86-64

lightweaver-0.14.2rc1-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.14.2rc1-cp311-cp311-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

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

lightweaver-0.14.2rc1-cp310-cp310-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.14.2rc1-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.14.2rc1-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

lightweaver-0.14.2rc1-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.14.2rc1.tar.gz.

File metadata

  • Download URL: lightweaver-0.14.2rc1.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.14.2rc1.tar.gz
Algorithm Hash digest
SHA256 0af46fa2d988cf103be165e1be128001faed231e0fbde01e212dde734ebeaa6a
MD5 e0d45900371c5cf11f1a70ca05da27b8
BLAKE2b-256 92f89eba31967c628e6b0c60979f1c2f9eed97c09617ad2671460ed465f04551

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a96f76936e1ee2830d37821cfe71b0c517506957461d6e95e6c76937d08d6ff5
MD5 133023037b437512c172372d2f934f51
BLAKE2b-256 51fd41a7eaeee1663eb8657a840618e001fbda59adbe82f06dc481b97a3a8914

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f373bdfcfae67872fa6e197465b8c8d5d20cf9a71e32b379d6d9e655640a1880
MD5 d6ccec4d93212187ffb51b366c515c9e
BLAKE2b-256 3cf9c930da08e181e57c87d47d05fc03a9c675c77b09518df4a3d6af1b9d8168

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5b583e64c62c1b352ff3602757c9653cba732e1adbeca9692f6ae534e8599226
MD5 2e742aba1c51aa669759f07058f9fec6
BLAKE2b-256 b4ff3658dcb249a2ecb61a1212a3f7bfd60f3849ce62fb5cc6ba77133c40a7a1

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 06afcdc231be977215eee7b105e913a1956ad4e09b73cdeb90317cb7ac682b9a
MD5 350a221ceb07bbae7678eb364843c4dc
BLAKE2b-256 65fa461764a164e6f7bd52f24893051451036890ef659151a5d43a64af458b3e

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e317fec561e992799ff44e72ec7b77790f4532d6fda68c0c4143bc7f94ab2d45
MD5 ba1774cbee158604e4bb48934243e4c7
BLAKE2b-256 f816759fd09512c58949ee947718c18541f8f17b030e9b9b260002460bc79700

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86d9db2e45540b02c8a8542d493b51b1c031ae2beed018d3f71a001cb594203f
MD5 95ae95debdaac5abc83099792a92257f
BLAKE2b-256 3e85daace44c855160ab508064e073274e41f45caa3a2427a502da8b96d2aa42

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 da976c10008622d6493304cd8270e675186cf9e262b94ad8d6f993224cc09375
MD5 e92aa996559152f0d50eb2f020070dd2
BLAKE2b-256 5811a219cabce6ba0ffda8ad06401cc372a02a37e7dbca3e4ebe27e5d8d1d0c8

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b211945c52f757a4ed829d1190e14789d344bb50b4a8214df661507e8b8f0440
MD5 68653d0f4b2bcf70030cc1d7985ce456
BLAKE2b-256 ecdf5f0e772a38ae5377f451f9a8d00e41ffefda023ce74fabae51fa14f2d6dc

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4aa38be93276c89596c82a8c8627e8b7a36fd746531d04a70ddc4d2bfc07c5b9
MD5 dc5f16f66f907df9bb05e9625c5468fb
BLAKE2b-256 8acf02eb15240b558b196eb093c198eeac24d4325b103769bcf77b5b093cd927

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27296f96cdc87569cd1997521d0cc0fd9a55be8735cf6a8fe0e7f0607a674cb5
MD5 0a74080a82e1d9af53a38f585c8763db
BLAKE2b-256 97e3f6b9d9010a747fc1a4506320de1a008eed302d47389523e2a7817f30f2c5

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7a18c66eb098af24e183d9310ca50fa16c1a1331706ed204fe2207c0f2d98fb5
MD5 b2377b2552d289dd84b5f34fb63f9eef
BLAKE2b-256 74f0e9130cffdc585068726b389fffb548b8826fc314af009cb73cd007b54c2d

See more details on using hashes here.

File details

Details for the file lightweaver-0.14.2rc1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for lightweaver-0.14.2rc1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 eefc4a80b5292e54712aec0df9e187a652cf9e2c8ed1e25eff8c6402779112a6
MD5 9396ccff08cb3ebec2983a491eef1495
BLAKE2b-256 4171483e3ff3d4138c53bd675af15016a67dc96a7c2a11e110b27a5dbc1c0b4e

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