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-2020

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 (wavelength parallelisation in progress) or 1.5D parallel columns with ProcessPool or MPI parallelisation. There is also preliminary support for 2D atmospheres.

Whilst the core numerics are implented 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). These bindings could be rewritten in another language, so long as the same information can be provided to the C++ core.

The aim of Lightweaver is to provide an NLTE Framework, rather than a "code". That is to say, it should be more maleable, 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 well-recieved 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

Documentation is currently lacking, although it is currently being produced. I suggest looking through the samples repository (in particular the Simple*.py) to gain an understanding of the basic functionality and interfaces. These samples are kept as up to date as possible.

Feel free to 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.4.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

lightweaver-0.4.0-cp38-cp38-manylinux2010_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

lightweaver-0.4.0-cp38-cp38-manylinux1_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.8

lightweaver-0.4.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.4.0.tar.gz.

File metadata

  • Download URL: lightweaver-0.4.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9a6005384de86be61304b233a1363ae75da7c45743d9b14b98f3d139df87cbb2
MD5 78cff2b674b2aac46c3159fbbeee25b6
BLAKE2b-256 2e78fba3f2c5225e311ca1ab8bc34633046a623de9ea04baa32c58d4f25aa76b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.4.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.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 67a13742df6757aa1292c4f9c274540ac2f6245cefa09e322ec8623457b16529
MD5 9daa7acc18729f5c78cd5565c96bd582
BLAKE2b-256 f4be126d7cc81f7ad12f29555e450471424d7a4a99b17d406d48b28ece72ffa0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.4.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.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 92b0d6d628707c576425063fed4c42d54efbd1a3f38fa93f13cfe403fa3d90fa
MD5 5ffeef8248a5b504e770492cb924a28f
BLAKE2b-256 6aa98f71363e4daefe35c7a84995f4b4396471f482588c8950921d6c855ecdfa

See more details on using hashes here.

File details

Details for the file lightweaver-0.4.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: lightweaver-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 093d171ab4a77d73510be0da9cdac1074d7a7b0f17243b6cf965707d9ea8e8b0
MD5 2fba5eb16d27558a33143db450c1d485
BLAKE2b-256 0ad5899782693f6833e82a069d5f14021853a0a8d752ceb5b376df7c1c790cae

See more details on using hashes here.

File details

Details for the file lightweaver-0.4.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: lightweaver-0.4.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c2f2e2063ea05597e9b17992855619289f1e9855177196e67d5e3d67297c693d
MD5 43818b35b775a607fb8d01d72c59210a
BLAKE2b-256 94544f2effaf0873b749fb3a4293c5c8511419c4470a9f914207862d72998dd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightweaver-0.4.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.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for lightweaver-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6463e26a7f1f063b5212cd19abb930c3e8961b8d24bf3dcfefc327f0ce367b5e
MD5 06973b566e29424425138d2e5fbebc9b
BLAKE2b-256 86b4223a2874f43c161ea05d9fd304b4c91aa6c3135de3c4c6e852decf12b1f9

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