- MulensModel is package for modeling microlensing (or μ-lensing)
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:
- Basic usage tutorial,
- Fitting tutorial,
- Microlensing parallax fitting tutorial,
- Examples on how to use the code:
- Example 01 -- plot simple point-source/point-lens (PSPL) model and model with planetary lens,
- Example 02 -- fit PSPL model to the data using scipy.optimize.minimize(),
- Example 03 -- define PSPL model using physical properties and plot the resulting magnification curve,
- Example 04 -- calculate the Einstein ring size for a grid of lens masses and distances,
- Example 05 -- plot multiple datasets for a single model, plot the residuals, and do this both in magnitude and magnification spaces,
- Example 06 -- fit parallax model using EMCEE,
- Example 07 -- fit parallax model using MultiNest.
- Instructions on getting satellite positions
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)
- Effects: finite source (2-parameter), parallax (satellite, annual)
- Source Stars: Binary source, xallarap
- Effects: parallax (topographic)
How to install?
- Make sure you have python with astropy package installed.
- Download source code - either recent release or current repository using green button above.
- Unpack the archive.
- 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 order to have this command invoked every time you open a terminal, please add this command to your startup file (
~/.profile or similar). If you didn't have
PYTHONPATH defined before, then skip the last part of the above commands.
- Go to subdirectory
makecommand. 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
- Repeat above in
source/MulensModelto check that all unit tests pass.
- Congratulations! You have MulensModel installed fully.
file revised Mar 2018
Help us keep the lights on
v1.0.0 - Mar 1, 2018
First official release - Mar 1st 2018.
0.4.0 - Feb 22, 2018
0.3.1 - Dec 22, 2017
version 0.3.1 - includes Adaptive Contouring and VBBL packages