diff --git a/source/MulensModel/binarylensimports.py b/source/MulensModel/binarylensimports.py index 21736d8c..585c9d58 100644 --- a/source/MulensModel/binarylensimports.py +++ b/source/MulensModel/binarylensimports.py @@ -94,7 +94,9 @@ def _import_compiled_AdaptiveContouring(): # Check import and try manually compiled versions. if _vbbl_wrapped: _vbbl_binary_mag_dark = mm_vbbl.VBBinaryLensing_BinaryMagDark - _vbbl_binary_mag_0 = mm_vbbl.VBBinaryLensing_BinaryMag0 + _vbbl_binary_mag_finite = mm_vbbl.VBBinaryLensing_BinaryMagFinite + _vbbl_binary_mag_point = mm_vbbl.VBBinaryLensing_BinaryMagPoint + _vbbl_binary_mag_point_shear = mm_vbbl.VBBinaryLensing_BinaryMagPointShear _vbbl_SG12_5 = mm_vbbl.VBBL_SG12_5 _vbbl_SG12_9 = mm_vbbl.VBBL_SG12_9 else: diff --git a/source/VBBL/vbbl_wrapper.cpp b/source/VBBL/vbbl_wrapper.cpp index 8e3d97bf..84e53283 100644 --- a/source/VBBL/vbbl_wrapper.cpp +++ b/source/VBBL/vbbl_wrapper.cpp @@ -9,27 +9,53 @@ Based on code written by Przemek Mroz static PyObject * VBBinaryLensing_BinaryMagDark_wrapper(PyObject *self, PyObject *args) { - double a, q, y1, y2, RSv, a1, Tol, mag; + double a, q, y1, y2, RSv, a1, tolerance, mag; static VBBinaryLensing VBBL; - if (!PyArg_ParseTuple(args, "ddddddd", &a, &q, &y1, &y2, &RSv, &a1, &Tol)) return NULL; + if (!PyArg_ParseTuple(args, "ddddddd", &a, &q, &y1, &y2, &RSv, &tolerance, &a1)) return NULL; - mag = VBBL.BinaryMagDark(a, q, y1, y2, RSv, a1, Tol); + mag = VBBL.BinaryMagDark(a, q, y1, y2, RSv, a1, tolerance); return Py_BuildValue("d", mag); } -/*static PyObject * -VBBinaryLensing_BinaryMag0_wrapper(PyObject *self, PyObject *args) { +static PyObject * +VBBinaryLensing_BinaryMagFinite_wrapper(PyObject *self, PyObject *args) { + double a, q, y1, y2, RSv, tolerance, mag; + static VBBinaryLensing VBBL; + + if (!PyArg_ParseTuple(args, "dddddd", &a, &q, &y1, &y2, &RSv, &tolerance)) return NULL; + + VBBL.Tol = tolerance; + + mag = VBBL.BinaryMag2(a, q, y1, y2, RSv); + + return Py_BuildValue("d", mag); +} + +static PyObject * +VBBinaryLensing_BinaryMagPoint_wrapper(PyObject *self, PyObject *args) { + double a, q, y1, y2, mag; + static VBBinaryLensing VBBL; + + if (!PyArg_ParseTuple(args, "dddd", &a, &q, &y1, &y2)) return NULL; + + mag = VBBL.BinaryMag0(a, q, y1, y2); + + return Py_BuildValue("d", mag); +} + +static PyObject * +VBBinaryLensing_BinaryMagPointShear_wrapper(PyObject *self, PyObject *args) { double a, q, y1, y2, K, G, Gi, mag; - static VBBinaryLensing_shear VBBL; + static VBBinaryLensing VBBL; if (!PyArg_ParseTuple(args, "ddddddd", &a, &q, &y1, &y2, &K, &G, &Gi)) return NULL; - mag = VBBL.BinaryMag0_shear(a, q, y1, y2, K, G, Gi); + mag = VBBL.BinaryMag return Py_BuildValue("d", mag); -}*/ +} PyObject * makelist(double *array, size_t size) { PyObject *l = PyList_New(size); @@ -111,6 +137,9 @@ VBBL_SG12_9_wrapper(PyObject *self, PyObject *args) { static PyMethodDef VBBLMethods[] = { {"VBBinaryLensing_BinaryMagDark", VBBinaryLensing_BinaryMagDark_wrapper, METH_VARARGS, "some notes here"}, + {"VBBinaryLensing_BinaryMagFinite", VBBinaryLensing_BinaryMagFinite_wrapper, METH_VARARGS, "some notes here"}, + {"VBBinaryLensing_BinaryMagPoint", VBBinaryLensing_BinaryMagPoint_wrapper, METH_VARARGS, "some notes here"}, + {"VBBinaryLensing_BinaryMagPointShear", VBBinaryLensing_BinaryMagPointShear_wrapper, METH_VARARGS, "some notes here"}, //{"VBBinaryLensing_BinaryMag0", VBBinaryLensing_BinaryMag0_wrapper, METH_VARARGS, "some notes here"}, {"VBBL_SG12_5", VBBL_SG12_5_wrapper, METH_VARARGS, "some notes here"}, {"VBBL_BinaryMag", VBBinaryLensing_BinaryMag_wrapper, METH_VARARGS, "some notes here"},