Swiftpack.co - Package - rpoleski/MulensModel


MulensModel is package for modeling microlensing (or μ-lensing) events.

It is still under development. Latest release: 1.0.0

MulensModel can generate a microlensing light curve for a given set of microlensing parameters, fit that light curve to some data, and return a chi2 value. That chi2 can then be input into an arbitrary likelihood function to find the best fit parameters.

A few useful resources:

More will be added soon.


If you want to learn more about microlensing, please visit Microlensing Source website.

Currently, MulensModel supports:

  • Lens Systems: Point Lens, Binary Lens
  • Source Stars: Single source
  • Effects: finite source (1-parameter)

Under Development:

  • Effects: finite source (2-parameter), parallax (satellite, annual)

Future Development:

  • Source Stars: Binary source, xallarap
  • Effects: parallax (topographic)

How to install?

  1. Make sure you have python with astropy package installed.
  2. Download source code - either recent release or current repository using green button above.
  3. Unpack the archive.
  4. Add the path to the unpack directory to the PYTHONPATH, e.g., if you've extracted the archive in your home directory (/home/USER_NAME/) in tcsh:
setenv PYTHONPATH /home/USER_NAME/MulensModel-1.0.0/source\:$PYTHONPATH

in bash:

export PYTHONPATH=/home/USER_NAME/MulensModel-1.0.0/source:$PYTHONPATH

In order to have this command invoked every time you open a terminal, please add this command to your startup file (~/.cshrc, ~/.bashrc, ~/.profile or similar). If you didn't have PYTHONPATH defined before, then skip the last part of the above commands.

  1. Go to subdirectory source/VBBL/ and run make command. If it's not working and you're using Windows, then please run:
gcc -lm -lstdc++ -fPIC -c VBBinaryLensingLibrary.cpp
gcc -Wl,-soname,rapper -shared -o VBBinaryLensingLibrary_wrapper.so VBBinaryLensingLibrary_wrapper.cpp -lm -lstdc++ -fPIC VBBinaryLensingLibrary.o
  1. Repeat above in source/AdaptiveContouring/
  2. Run py.test in source/MulensModel to check that all unit tests pass.
  3. Congratulations! You have MulensModel installed fully.


file revised Mar 2018


Stars: 3
Help us keep the lights on


Used By

Total: 0


v1.0.0 - Mar 1, 2018

First official release - Mar 1st 2018.

0.4.0 - Feb 22, 2018

version 0.4.0

0.3.1 - Dec 22, 2017

version 0.3.1 - includes Adaptive Contouring and VBBL packages

0.2.1 - Sep 19, 2017

0.2.0 - Sep 16, 2017