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

Uploaded CPython 3.12Windows x86-64

lightweaver-0.12.1-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.12.1-cp312-cp312-macosx_10_13_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

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

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

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

Uploaded CPython 3.11Windows x86-64

lightweaver-0.12.1-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.12.1-cp311-cp311-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

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

lightweaver-0.12.1-cp310-cp310-win_amd64.whl (12.2 MB view details)

Uploaded CPython 3.10Windows x86-64

lightweaver-0.12.1-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.12.1-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

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

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

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

Uploaded CPython 3.9Windows x86-64

lightweaver-0.12.1-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.12.1-cp39-cp39-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

lightweaver-0.12.1-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.12.1.tar.gz.

File metadata

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

File hashes

Hashes for lightweaver-0.12.1.tar.gz
Algorithm Hash digest
SHA256 c5746bb965b20f15f0c889430312060f5449477036b1bccdcce591c771d85a3d
MD5 ccb30af4f8a6ad6d14fa717def0fcdac
BLAKE2b-256 debffcc438ff854e7b347b66e386a669d1fa0a0b7dec1a4d0d7fb0d9f09979f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 323537444b746b29c20b197ce5e82a3858930d214c0e3de1660c5e14405a52db
MD5 dc219010cbd424d349690f230d02c8e2
BLAKE2b-256 f050d4214092ad0475b62784c0894fb5bb546b8b93d4af92d08743f21c696777

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c312850fc5462a9d4fe372f91c3642bd75f2eccdb1e09186602188bdf9fc1378
MD5 236af67ad54056ca6e7f86454e09b3df
BLAKE2b-256 9819c310ceb2da73b43c6e96e64a35acfef78feedd1f31f7f3ab43d58c5830c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 1c7ace95f75fa3cea80bc3a08050fbffb15271f02b15976578951ef8143f3384
MD5 385647cc15cd02283fcf78cb1fd5aa19
BLAKE2b-256 883adf6095239bae75e87af88e997552235162d78e3cf430764485f0d37ce194

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 74bee046ddfdc021eee0e1fa6cc96f7fbd052434f00e1f44a7d887201d616685
MD5 163487eefdd93c19bf89ea4f7d9d7841
BLAKE2b-256 06afd99f2b57048a99e3a15018dca4514a5ff204c8bd42857645ffc4f42825bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 32fcd2446296ae24ddf996f5a9b0abd2b66ccb1bdbb0dda03195227d8af6f9b3
MD5 05f781415febd5a8ae437995ed8c0268
BLAKE2b-256 05a862b517675331b4e8cfd83cb6a7dd98fcfa1ce383000eccb8668fec83a5b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff8102d2aef7240dcc8c6c91256b572f17ef3a3aa837c15bba5e6f4c61c8d983
MD5 28aee33d94cd71e12ec2ed1f68b02dd2
BLAKE2b-256 9d2432d98ffe00ad36cd30f88dd5aa32dc9f1c83e350e9c5a7d1d87f1f0bdd48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d0fcac15670a5207a448a1e7056e8bee9be9649eb1ccb1df6d0043a5fa169bfb
MD5 a8ea64ab4101ac124ab3b600f304480f
BLAKE2b-256 e9f90656837b40cb1f6ced598a4ad5b6bf8de45d2f1cfc8c9fbd54922f217b64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b3bd0f16d4aa87f3c579ef758af7822ad6847425572d58a66cfd0dc800ca1917
MD5 359861a61fb4aadfbc6d23a096ed4fa2
BLAKE2b-256 dd92f6372dfe09f0bdb99264049aa86769a33913fa830ae664cc79788aafa152

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bdbcac52d1a6bc328c5815adeeda2cfb806a5b8bf1747ea3bb4af4fbc3cdbb1a
MD5 a5a833e5419db8f9b2e8a40e890d5c79
BLAKE2b-256 8e783b5cc84695546d9a09b05687430a0e17bff31c70b74856213a173087acbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c7100ace86c2b0d1fec4a5c5f6becfc52f0f09b547ec1e451736c16f64f5881
MD5 148477de30b1559be90eae9014df2950
BLAKE2b-256 6edefed344d80667edb4551b868301194582ae36bce7dfcc93bb5c29284d05de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 01d0f0b69df5fd88cdd18a1e6656506b91c8b74de3cefb2a984a30499467726b
MD5 7a5675409b4f68559613c956caadf2da
BLAKE2b-256 8bee1df1fcd92e2b1865508a57ea48cffec4dddea197af0bfcd84cfcef82b98e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 72cb013c6b101bd3d225dbe5cf1b59fbac31a1cde7958825d99c93fedc6437a6
MD5 7d821c848247c8ef5c311db929329f7e
BLAKE2b-256 056df5d3a32f64a70cc317d9b0363c687e33ef1a2654200828ff060f8b6bcbe5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.12.1-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/5.1.1 CPython/3.12.7

File hashes

Hashes for lightweaver-0.12.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e3d821f3089683545a9d3046db935774ccbbd21cc295e822d8e0777b3bcb7426
MD5 30e57ff45949f69f95b6709a1fa1aded
BLAKE2b-256 84bff0fde2ccdb3a7a2df3f229a30b148a4be0dc32380b890968b029d2ea37ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fbfde0838ac4d54fcc17e7c61b2852295c099d5610dba74429fb4d321b43ce88
MD5 1a7c174d54765ddd4dccbd692aefcb90
BLAKE2b-256 dd4a278beea6983b15eadcffbd16a00afae088145f211e99f36d09e5ce3131e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 927e925cbb9b37f6f50a537787c6a794e63edf5c3228b954a4d74e0d54e55e2e
MD5 f95867021403b7f462a0cd8e446045ec
BLAKE2b-256 8a4a745256a97448fa2296b497083e316f71f458e6f3aa33c3c8686b286b2286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightweaver-0.12.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9cc39bd1552289e8bd03f46613f10b263ca26d49b7fe46ab4f55be72a86c5e82
MD5 158f6a44a1ce56703e1a077470ca875c
BLAKE2b-256 7fd4230d5edbe199839556ced8ee75cc2544f682edf5e8642749ec11b5b381d5

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