VBBinaryLensing


NameVBBinaryLensing JSON
Version 3.7.0 PyPI version JSON
download
home_pagehttp://astropy.org
SummaryVBBinaryLensing is a tool for efficient computation in gravitational microlensing events using the advanced contour integration method, supporting single and binary lenses.
upload_time2024-02-12 18:15:05
maintainer
docs_urlNone
authorfran
requires_python<4,>=3.6
licenseGPL-3.0
keywords microlsening magnification and astrometry
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            [![Join the chat at https://gitter.im/VBBinaryLensing/Lobby](https://badges.gitter.im/VBBinaryLensing/Lobby.svg)](https://gitter.im/VBBinaryLensing/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# VBBinaryLensing
`VBBinaryLensing` is a tool for efficient computation in gravitational 
microlensing events using the advanced contour integration method, supporting single and binary lenses. 

In particular, VBBinaryLensing is designed for the following calculations:
- **Magnification** by single and binary lenses
- **Centroid** of the images generated by single and binary lenses
- **Critical curves and caustics** of binary lenses
- Complete **light curves** including several higher order effects: limb darkening of the source, binary source, parallax, xallarap, circular and elliptic orbital motion.

The code has been developed by Valerio Bozza, University of Salerno.
It is written as a C++ library and wrapped as a Python package, the user
can call the code from either C++ or Python.

The root finding algorithm has been adopted from Jan Skowron & Andy Gould
(http://www.astrouw.edu.pl/~jskowron/cmplx_roots_sg/)
and translated to C++ by Tyler M. Heintz and Ava R. Hoag.
The new Python wrapper has been created by Fran Bartolić in collaboration with Etienne Bachelet and Markus Hundertmark.

VBBinaryLensing is also adopted by several user-friendly modeling platforms for microlensing:
- [pyLIMA](https://github.com/ebachelet/pyLIMA)
- [MulensModel](https://github.com/rpoleski/MulensModel)
- [muLAn](https://github.com/muLAn-project/muLAn)

These platforms offer high-level frameworks for easy modeling of microlensing events. Consider using those codes if you do not want to develop your own modeling or simulation code. On the other hand, if you need direct access to basic functions to include in your own project, this is the right place for you.

A selection of recent reviews about microlensing and its applications can be found [here](/docs/reviews.md).

## Attribution
Any use of this code for scientific publications should be acknowledged by citations to the works relevant to your study:
- [V. Bozza, MNRAS 408 (2010) 2188](https://ui.adsabs.harvard.edu/abs/2010MNRAS.408.2188B/abstract): general algorithm for binary lensing;
- [V. Bozza et al., MNRAS 479 (2018) 5157](https://ui.adsabs.harvard.edu/abs/2018MNRAS.479.5157B/abstract): BinaryMag2 function, Extended-Source-Point-Lens methods; 
- [V. Bozza, E. Khalouei and E. Bachelet, MNRAS 505 (2021) 126](https://ui.adsabs.harvard.edu/abs/2021MNRAS.505..126B/abstract): astrometry, generalized limb darkening, Keplerian orbital motion. 

If specifically relevant to your work, please also cite
[J. Skowron and A. Gould, arXiv:1203.1034](https://arxiv.org/abs/1203.1034).
 

## Installation

### Python

The easiest way to install VBBinaryLensing is through `pip`
```
pip install VBBinaryLensing
```
If you want the latest development version from Github, clone this 
repository and run
```
python setup.py install
```

Currently, `VBBinaryLensing` works on Linux, Windows, MacOS and python >= 2.7. 
The python package requires `pybind11` which can be installed with
```
pip install pybind11
```
The package requires a C++ compiler supporting C++.

### C++

If you just want to use the C++ library, clone this repository, the 
library files `VBBinaryLensingLibrary.cpp` and
`VBBinaryLensing.h` are located in in `VBBinaryLensing/lib`. 
An example usage
of the C++ code is provided in `examples/cpp_examples` together with
a sample `Makefile` for compiling the library.

The package also contains the following files:
- `examples/cpp_examples/instructions.cpp` - Contains working examples and specific instructions for all functions.
- `VBBinaryLensing/data/ESPL.tbl`  - Pre-calculated table for Extended-source-point-lens
- `VBBinaryLensing/data/OB151212coords.txt` - Sample file with event coordinates
- `VBBinaryLensing/data/satellite1.txt` - Sample table for satellite position (Spitzer)
- `VBBinaryLensing/data/satellite2.txt` - Sample table for satellite position (Kepler)

## Example usage
To check the installation, try:
```python
>>>import VBBinaryLensing

# Initialize the VBBinaryLensing object which contains all functions 
>>>VBBL = VBBinaryLensing.VBBinaryLensing()

>>>s = 1.
>>>q = 0.02
>>>y1 = 0.5 
>>>y2 = 0.5 
>>>rho = 0.0033

# Calculate magnification for a single point in the source plane
>>>magnification = VBBL.BinaryMag2(s, q, y1, y2, rho)
>>>print(magnification)
>>>1.6310924403681109
```

Example Jupyter notebooks are included in `examples/python_examples`.

## Documentation
Full [documentation for the use of VBBinaryLensing in C++](/docs/readme.md) is available. This can be a good reference also for Python users. 

Furthermore, the vast majority of functions are documented with Python docstrings which can be accessed as, for example, `?VBBL.BinaryMag2()` in
a Jupyter notebook.

Note that the python wrapper does not support the user-defined limb-darkening law.

## License
VBBinaryLensing is freely available to the community under the 
GNU Lesser General Public License Version 3 included in this repository.

            

Raw data

            {
    "_id": null,
    "home_page": "http://astropy.org",
    "name": "VBBinaryLensing",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.6",
    "maintainer_email": "",
    "keywords": "Microlsening magnification and astrometry",
    "author": "fran",
    "author_email": "Valerio Bozza <valboz@sa.infn.it>, Fran Bartoli\u0107 <fb90@st-andrews.ac.uk>, Etienne Bachelet <etibachelet@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0e/18/7fde5067b7a127e039befb2364f29a221eedc3aeed485929679182114d07/VBBinaryLensing-3.7.0.tar.gz",
    "platform": null,
    "description": "[![Join the chat at https://gitter.im/VBBinaryLensing/Lobby](https://badges.gitter.im/VBBinaryLensing/Lobby.svg)](https://gitter.im/VBBinaryLensing/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n\r\n# VBBinaryLensing\r\n`VBBinaryLensing` is a tool for efficient computation in gravitational \r\nmicrolensing events using the advanced contour integration method, supporting single and binary lenses. \r\n\r\nIn particular, VBBinaryLensing is designed for the following calculations:\r\n- **Magnification** by single and binary lenses\r\n- **Centroid** of the images generated by single and binary lenses\r\n- **Critical curves and caustics** of binary lenses\r\n- Complete **light curves** including several higher order effects: limb darkening of the source, binary source, parallax, xallarap, circular and elliptic orbital motion.\r\n\r\nThe code has been developed by Valerio Bozza, University of Salerno.\r\nIt is written as a C++ library and wrapped as a Python package, the user\r\ncan call the code from either C++ or Python.\r\n\r\nThe root finding algorithm has been adopted from Jan Skowron & Andy Gould\r\n(http://www.astrouw.edu.pl/~jskowron/cmplx_roots_sg/)\r\nand translated to C++ by Tyler M. Heintz and Ava R. Hoag.\r\nThe new Python wrapper has been created by Fran Bartoli\u0107 in collaboration with Etienne Bachelet and Markus Hundertmark.\r\n\r\nVBBinaryLensing is also adopted by several user-friendly modeling platforms for microlensing:\r\n- [pyLIMA](https://github.com/ebachelet/pyLIMA)\r\n- [MulensModel](https://github.com/rpoleski/MulensModel)\r\n- [muLAn](https://github.com/muLAn-project/muLAn)\r\n\r\nThese platforms offer high-level frameworks for easy modeling of microlensing events. Consider using those codes if you do not want to develop your own modeling or simulation code. On the other hand, if you need direct access to basic functions to include in your own project, this is the right place for you.\r\n\r\nA selection of recent reviews about microlensing and its applications can be found [here](/docs/reviews.md).\r\n\r\n## Attribution\r\nAny use of this code for scientific publications should be acknowledged by citations to the works relevant to your study:\r\n- [V. Bozza, MNRAS 408 (2010) 2188](https://ui.adsabs.harvard.edu/abs/2010MNRAS.408.2188B/abstract): general algorithm for binary lensing;\r\n- [V. Bozza et al., MNRAS 479 (2018) 5157](https://ui.adsabs.harvard.edu/abs/2018MNRAS.479.5157B/abstract): BinaryMag2 function, Extended-Source-Point-Lens methods; \r\n- [V. Bozza, E. Khalouei and E. Bachelet, MNRAS 505 (2021) 126](https://ui.adsabs.harvard.edu/abs/2021MNRAS.505..126B/abstract): astrometry, generalized limb darkening, Keplerian orbital motion. \r\n\r\nIf specifically relevant to your work, please also cite\r\n[J. Skowron and A. Gould, arXiv:1203.1034](https://arxiv.org/abs/1203.1034).\r\n \r\n\r\n## Installation\r\n\r\n### Python\r\n\r\nThe easiest way to install VBBinaryLensing is through `pip`\r\n```\r\npip install VBBinaryLensing\r\n```\r\nIf you want the latest development version from Github, clone this \r\nrepository and run\r\n```\r\npython setup.py install\r\n```\r\n\r\nCurrently, `VBBinaryLensing` works on Linux, Windows, MacOS and python >= 2.7. \r\nThe python package requires `pybind11` which can be installed with\r\n```\r\npip install pybind11\r\n```\r\nThe package requires a C++ compiler supporting C++.\r\n\r\n### C++\r\n\r\nIf you just want to use the C++ library, clone this repository, the \r\nlibrary files `VBBinaryLensingLibrary.cpp` and\r\n`VBBinaryLensing.h` are located in in `VBBinaryLensing/lib`. \r\nAn example usage\r\nof the C++ code is provided in `examples/cpp_examples` together with\r\na sample `Makefile` for compiling the library.\r\n\r\nThe package also contains the following files:\r\n- `examples/cpp_examples/instructions.cpp` - Contains working examples and specific instructions for all functions.\r\n- `VBBinaryLensing/data/ESPL.tbl`  - Pre-calculated table for Extended-source-point-lens\r\n- `VBBinaryLensing/data/OB151212coords.txt` - Sample file with event coordinates\r\n- `VBBinaryLensing/data/satellite1.txt` - Sample table for satellite position (Spitzer)\r\n- `VBBinaryLensing/data/satellite2.txt` - Sample table for satellite position (Kepler)\r\n\r\n## Example usage\r\nTo check the installation, try:\r\n```python\r\n>>>import VBBinaryLensing\r\n\r\n# Initialize the VBBinaryLensing object which contains all functions \r\n>>>VBBL = VBBinaryLensing.VBBinaryLensing()\r\n\r\n>>>s = 1.\r\n>>>q = 0.02\r\n>>>y1 = 0.5 \r\n>>>y2 = 0.5 \r\n>>>rho = 0.0033\r\n\r\n# Calculate magnification for a single point in the source plane\r\n>>>magnification = VBBL.BinaryMag2(s, q, y1, y2, rho)\r\n>>>print(magnification)\r\n>>>1.6310924403681109\r\n```\r\n\r\nExample Jupyter notebooks are included in `examples/python_examples`.\r\n\r\n## Documentation\r\nFull [documentation for the use of VBBinaryLensing in C++](/docs/readme.md) is available. This can be a good reference also for Python users. \r\n\r\nFurthermore, the vast majority of functions are documented with Python docstrings which can be accessed as, for example, `?VBBL.BinaryMag2()` in\r\na Jupyter notebook.\r\n\r\nNote that the python wrapper does not support the user-defined limb-darkening law.\r\n\r\n## License\r\nVBBinaryLensing is freely available to the community under the \r\nGNU Lesser General Public License Version 3 included in this repository.\r\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "VBBinaryLensing is a tool for efficient computation in gravitational microlensing events using the advanced contour integration method, supporting single and binary lenses.",
    "version": "3.7.0",
    "project_urls": {
        "Documentation": "https://www.fisica.unisa.it/gravitationastrophysics/VBBinaryLensing.htm",
        "Homepage": "https://github.com/valboz/VBBinaryLensing"
    },
    "split_keywords": [
        "microlsening",
        "magnification",
        "and",
        "astrometry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "239643cc2a8c88d50e3c702342d63a08a5ba244d38703f79e4e9005ebe821343",
                "md5": "122130daa9a58355a4e23fc6830bee84",
                "sha256": "8afee24997d8613032e0acf6cab66e4bfe9f171a2095f010a3e204fdd8bf3470"
            },
            "downloads": -1,
            "filename": "VBBinaryLensing-3.7.0-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "122130daa9a58355a4e23fc6830bee84",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<4,>=3.6",
            "size": 655251,
            "upload_time": "2024-02-12T18:15:03",
            "upload_time_iso_8601": "2024-02-12T18:15:03.074117Z",
            "url": "https://files.pythonhosted.org/packages/23/96/43cc2a8c88d50e3c702342d63a08a5ba244d38703f79e4e9005ebe821343/VBBinaryLensing-3.7.0-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e187fde5067b7a127e039befb2364f29a221eedc3aeed485929679182114d07",
                "md5": "4ba0a8a5a03901b7a9ca6a5ed9d9d541",
                "sha256": "a23536248d6df0eaa7b871ae153e3942b6ff83829be43ee84485636a7b6689cb"
            },
            "downloads": -1,
            "filename": "VBBinaryLensing-3.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4ba0a8a5a03901b7a9ca6a5ed9d9d541",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 508212,
            "upload_time": "2024-02-12T18:15:05",
            "upload_time_iso_8601": "2024-02-12T18:15:05.645320Z",
            "url": "https://files.pythonhosted.org/packages/0e/18/7fde5067b7a127e039befb2364f29a221eedc3aeed485929679182114d07/VBBinaryLensing-3.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-12 18:15:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "valboz",
    "github_project": "VBBinaryLensing",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "vbbinarylensing"
}
        
Elapsed time: 0.17791s