Giter VIP home page Giter VIP logo

lightspinner's Introduction

Lightspinner

Learn radiative transfer like it's 1992!

C. Osborne (University of Glasgow), 2020, MIT License

Lightspinner is a relatively simple, but complete pure python optically thick radiative transfer (RT) code using the Rybicki-Hummer Multi-level Accelerated Lambda Iteration (MALI) formalism. It is, in essence, a stripped down version of Lightweaver with the aim of teaching the methods used in optically thick RT and making them more accessible. That is, if you learn methods by reading code, like I do. It uses the full preconditioning method of Rybicki & Hummer (1992) with the ability to handle overlapping transitions, but under the assumption of complete redistribution. The formal solver is currently using simple piecewise linear short characteristics due to its simplicity and the pedagogic benefits thereof.

The slides for the associated talk are in the Slides directory.

In the file response_fn.py there is a simple example of computing the NLTE response function for CaII 8542, admittedly in a very crude and slow way (it will take multiple minutes to run). I recommend just running the synthesis in example.py first for familiarity with the code.

DIY

If you want to have a go at implementing the MALI method, then the formal_sol_gamma_matrices and uv functions in rh_method.py have been left documented but not complete on the DIY branch. It would also be an interesting exercise to extend the formal solver to use the monotonic piecewise parabolic method of Auer & Paletou (1994).

Setup

Requires python 3.7+. For those that use conda the environment.yml can be used to create a Lightspinner environment complete with all necessary packages with conda env create -f environment.yml. This can then be activated with conda activate Lightspinner. This environment should then be ready for action and you should be able to easily produce the spectrum of Ca II in a FALC atmosphere with ipython -i test.py. It should look like this:

Spectrum of CaII

References

Everything
  • [HM] Hubeny, Ivan & Mihalas, Dimitri (2015). Theory of Stellar Atmospheres: An Introduction to Astrophysical Non-equilibrium Quantitive Spectroscopic Analysis. Princeton University Press. ISBN: 9780691163291.
MALI Methods
Short Characteristic Formal Solvers

Acknowledgements

  • The python implementation of the Wittmann equation of state kindly provided J. de la Cruz Rodriguez.
  • Many methods are inspired by approaches taken in the RH code by H. Uitenbroek [U01] (linked version is the 1.5D version described in Pereira & Uitenbroek (2015))
  • Many thanks to Ivan Milić for all his help getting this stuff into my head!

lightspinner's People

Contributors

goobley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.