- MulensModel is package for modeling microlensing (or μ-lensing)
It is still under development. Latest release: 0.3.1
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,
- 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,
- 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-0.3.1/source\:$PYTHONPATH
In order to have this command invoked every time you open the terminal, please add this command to
- Go to subdirecotry
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
- Congratulations! You have MulensModel installed fully.
file revised Jan 2018