VBMicrolensing 5.1.1__cp313-cp313-musllinux_1_2_i686.whl → 5.3__cp313-cp313-musllinux_1_2_i686.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of VBMicrolensing might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- // VBMicrolensing v5.0 (2025)
1
+ // VBMicrolensing v5.3 (2025)
2
2
  //
3
3
  // This code has been developed by Valerio Bozza (University of Salerno) and collaborators.
4
4
  // Check the repository at https://github.com/valboz/VBMicrolensing
@@ -74,7 +74,9 @@ class VBMicrolensing
74
74
  0.3 };
75
75
 
76
76
  int* ndatasat;
77
- double** tsat, *** possat;
77
+ double *** possat, * startsat, * stepsat;
78
+ double** posEar, startEar, stepEar;
79
+ int ndataEar;
78
80
  double Mag0;
79
81
  double* dist_mp, * q;
80
82
  int nim0, n, n2, nnm1, nroots, nrootsmp, * nrootsmp_mp;
@@ -95,9 +97,10 @@ class VBMicrolensing
95
97
  int iastro;
96
98
  double Obj[3], rad[3], tang[3], t0old;
97
99
  double Eq2000[3], Quad2000[3], North2000[3];
98
- double Et0[2], vt0[2], Et[2], Ehel[2];
100
+ double Et0[2], vt0[2], Et[2], Ehel[2], lighttravel, lighttravel0;
99
101
  double ESPLout[__rsize_ESPL][__zsize_ESPL], ESPLin[__rsize_ESPL][__zsize_ESPL], ESPLoutastro[__rsize_ESPL][__zsize_ESPL], ESPLinastro[__rsize_ESPL][__zsize_ESPL];
100
- bool ESPLoff, multidark;
102
+ bool coordinates_set;
103
+ bool multidark;
101
104
  double* LDtab, * rCLDtab, * CLDtab;
102
105
  double scr2, sscr2;
103
106
  int npLD;
@@ -146,12 +149,17 @@ public:
146
149
  bool astrometry;
147
150
  bool turn_off_secondary_source;
148
151
  bool turn_off_secondary_lens;
152
+ bool ESPLoff;
153
+ bool t_in_HJD;
149
154
 
150
155
  static char ESPLtablefile[1024];
151
156
  static void SetESPLtablefile(char* instring) { strcpy(ESPLtablefile, instring); }
152
- double Tol, RelTol, a1, a2, t0_par,corrquad, corrquad2, safedist;
157
+ static char Suntablefile[1024];
158
+ static void SetSuntablefile(char* instring) { strcpy(Suntablefile, instring); }
159
+ double Tol, RelTol, a1, a2,corrquad, corrquad2, safedist;
153
160
  double mass_radius_exponent, mass_luminosity_exponent, lens_mass_luminosity_exponent;
154
- int satellite, parallaxsystem, t0_par_fixed, nsat;
161
+ int satellite, parallaxsystem, t0_par, t0_par_fixed, nsat;
162
+ bool suntable, parallaxephemeris;
155
163
  int minannuli, maxannuli, nannuli, NPS, NPcrit;
156
164
  int newtonstep;
157
165
  double y_1, y_2, av, therr, astrox1, astrox2;
@@ -163,6 +171,7 @@ public:
163
171
  // Initialization for parallax calculation
164
172
  void SetObjectCoordinates(char* Coordinates_file, char* Directory_for_satellite_tables);
165
173
  void SetObjectCoordinates(char* CoordinateString);
174
+ bool AreCoordinatesSet();
166
175
  // Skowron & Gould root calculation
167
176
  void cmplx_roots_gen(complex*, complex*, int, bool, bool);
168
177
  void cmplx_roots_multigen(complex*, complex**, int, bool, bool);
@@ -202,7 +211,7 @@ public:
202
211
  void SetMethod(Method);
203
212
 
204
213
  //ESPL functions
205
- void LoadESPLTable(char* tablefilename);
214
+ void LoadESPLTable(const char* tablefilename);
206
215
  double ESPLMag(double u, double rho);
207
216
  double ESPLMag2(double u, double rho);
208
217
  double ESPLMagDark(double u, double rho);
@@ -211,6 +220,7 @@ public:
211
220
 
212
221
  // New (v2) light curve functions, operating on arrays
213
222
 
223
+ void LoadSunTable(char* tablefilename);
214
224
  void PSPLLightCurve(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
215
225
  void PSPLLightCurveParallax(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
216
226
  void ESPLLightCurve(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
@@ -229,6 +239,7 @@ public:
229
239
  void BinSourceExtLightCurveXallarap(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, double* y1_array2, double* y2_array2, int np);
230
240
  void BinSourceSingleLensXallarap(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, double* y1_array2, double* y2_array2, int np);
231
241
  void BinSourceBinLensXallarap(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
242
+ void BinSourceBinLensLightCurve(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, double* y1_array2, double* y2_array2, double* seps_array, int np);
232
243
 
233
244
  void TripleLightCurve(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
234
245
  void TripleLightCurveParallax(double* parameters, double* t_array, double* mag_array, double* y1_array, double* y2_array, int np);
@@ -253,7 +264,8 @@ public:
253
264
  double BinSourceExtLightCurveXallarap(double* parameters, double t);
254
265
  double BinSourceBinLensXallarap(double* parameters, double t);
255
266
  double BinSourceSingleLensXallarap(double* parameters, double t);
256
- double BinSourceBinLensPOX(double* parameters, double t);
267
+ double BinSourceBinLensLightCurve(double* parameters, double t);
268
+
257
269
 
258
270
  double TripleLightCurve(double* parameters, double t);
259
271
  double TripleLightCurveParallax(double* parameters, double t);
@@ -266,6 +278,7 @@ public:
266
278
  void BinaryAstroLightCurveOrbital(double* parameters, double* t_array, double* mag_array, double* centroid_s1_array, double* centroid_s2_array, double* centroid_l1_array, double* centroid_l2_array, double* y1_array, double* y2_array, double* seps_array, int np);
267
279
  void BinaryAstroLightCurveKepler(double* parameters, double* t_array, double* mag_array, double* centroid_s1_array, double* centroid_s2_array, double* centroid_l1_array, double* centroid_l2_array, double* y1_array, double* y2_array, double* seps_array, int np);
268
280
  void BinSourceAstroLightCurveXallarap(double* parameters, double* t_array, double* mag_array, double* centroid_s1_array, double* centroid_s2_array, double* centroid_l1_array, double* centroid_l2_array, double* y1_array, double* y2_array, double* y1_array2, double* y2_array2, int np);
281
+ void BinSourceBinLensAstroLightCurve(double* parameters, double* t_array, double* mag_array, double* centroid_s1_array, double* centroid_s2_array, double* centroid_l1_array, double* centroid_l2_array, double* y1_array, double* y2_array, double* y1_array2, double* y2_array2, double* seps_array, int np);
269
282
  void TripleAstroLightCurve(double* parameters, double* t_array, double* mag_array, double* centroid_s1_array, double* centroid_s2_array, double* centroid_l1_array, double* centroid_l2_array, double* y1_array, double* y2_array, int np);
270
283
 
271
284
  // Constructor and destructor
@@ -2,6 +2,7 @@
2
2
  #include <pybind11/stl.h>
3
3
  #include "VBMicrolensingLibrary.h"
4
4
  #include <string>
5
+ #include <filesystem>
5
6
  #include <pybind11/functional.h>
6
7
 
7
8
 
@@ -32,6 +33,8 @@ PYBIND11_MODULE(VBMicrolensing, m) {
32
33
  "Minimum number of annuli to calculate for limb darkening.");
33
34
  vbm.def_readwrite("NPcrit", &VBMicrolensing::NPcrit,
34
35
  "Number of points in critical curves.");
36
+ vbm.def_readwrite("parallaxephemeris", &VBMicrolensing::parallaxephemeris,
37
+ "True for parallax calculation with ephemeris, False for parallax calculation with Kepler equation");
35
38
  vbm.def_readwrite("parallaxsystem", &VBMicrolensing::parallaxsystem,
36
39
  "0 for parallel-perpendicular, 1 for North-Eeast.");
37
40
  vbm.def_readwrite("t0_par_fixed", &VBMicrolensing::t0_par_fixed,
@@ -41,6 +44,8 @@ PYBIND11_MODULE(VBMicrolensing, m) {
41
44
  vbm.def_readwrite("satellite", &VBMicrolensing::satellite,
42
45
  "Specifies the satellite number for the next calculation \
43
46
  (0 for observations from the ground);.");
47
+ vbm.def_readwrite("nsat", &VBMicrolensing::nsat,
48
+ "Number of satellite tables found in satellite table directory.");
44
49
  vbm.def_readwrite("astrometry", &VBMicrolensing::astrometry,
45
50
  "Unlock astrometry centroid calculation.");
46
51
  vbm.def_readwrite("astrox1", &VBMicrolensing::astrox1,
@@ -57,6 +62,8 @@ PYBIND11_MODULE(VBMicrolensing, m) {
57
62
  "Flux of secondary source is set to zero.");
58
63
  vbm.def_readwrite("turn_off_secondary_lens", &VBMicrolensing::turn_off_secondary_lens,
59
64
  "Flux of secondary lens is set to zero.");
65
+ vbm.def_readwrite("t_in_HJD", &VBMicrolensing::t_in_HJD,
66
+ "Set if t is given in HJD");
60
67
  vbm.def_readwrite("corrquad", &VBMicrolensing::corrquad,
61
68
  "Quadrupole test.");
62
69
  vbm.def_readwrite("corrquad2", &VBMicrolensing::corrquad2,
@@ -67,10 +74,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
67
74
 
68
75
  vbm.def("LoadESPLTable", &VBMicrolensing::LoadESPLTable,
69
76
  """Loads a pre calculated binary table for extended source calculation.""");
77
+ vbm.def("LoadSunTable", &VBMicrolensing::LoadSunTable,
78
+ """Loads a Sun ephemeris table for parallax calculation.""");
70
79
  vbm.def("SetESPLtablefile", [](char* s) {
71
80
  VBMicrolensing::SetESPLtablefile(s);
72
81
  },
73
82
  """Sets the path to a pre calculated binary table for extended source calculation.""");
83
+ vbm.def("SetSuntablefile", [](char* s) {
84
+ VBMicrolensing::SetSuntablefile(s);
85
+ },
86
+ """Sets the path to a pre calculated Sun ephemeris table to be used in parallax calculations.""");
74
87
  // Maginfication calculations
75
88
  vbm.def("PSPLMag", &VBMicrolensing::PSPLMag,
76
89
  py::return_value_policy::reference,
@@ -385,7 +398,24 @@ PYBIND11_MODULE(VBMicrolensing, m) {
385
398
  .
386
399
  )mydelimiter");
387
400
 
388
- vbm.def("SetObjectCoordinates", (void (VBMicrolensing::*)(char*)) & VBMicrolensing::SetObjectCoordinates,
401
+ //vbm.def("SetObjectCoordinates", (void (VBMicrolensing::*)(char*)) & VBMicrolensing::SetObjectCoordinates,
402
+ // R"mydelimiter(
403
+ // Sets the astronomical coordinates of the microlensing target.
404
+ //
405
+ // Parameters
406
+ // ----------
407
+ // CoordinateString : string
408
+ // Format \"hr:mn:sc +deg:pr:sc\".
409
+ // )mydelimiter");
410
+
411
+ vbm.def("SetObjectCoordinates",
412
+ [](VBMicrolensing& self, char* coordinatestring)
413
+ {
414
+ self.SetObjectCoordinates(coordinatestring);
415
+ if (!self.AreCoordinatesSet()) {
416
+ py::print("! Invalid coordinates format !");
417
+ }
418
+ },
389
419
  R"mydelimiter(
390
420
  Sets the astronomical coordinates of the microlensing target.
391
421
 
@@ -395,7 +425,19 @@ PYBIND11_MODULE(VBMicrolensing, m) {
395
425
  Format \"hr:mn:sc +deg:pr:sc\".
396
426
  )mydelimiter");
397
427
 
398
- vbm.def("SetObjectCoordinates", (void (VBMicrolensing::*)(char*, char*)) & VBMicrolensing::SetObjectCoordinates,
428
+ vbm.def("SetObjectCoordinates",
429
+ [](VBMicrolensing& self, char* coordinatefile, char* sattabledir)
430
+ {
431
+ if (std::filesystem::exists(sattabledir)) {
432
+ self.SetObjectCoordinates(coordinatefile, sattabledir);
433
+ if (!self.AreCoordinatesSet()) {
434
+ py::print("! Invalid coordinates format !");
435
+ }
436
+ }
437
+ else {
438
+ py::print("! Invalid satellite table directory !");
439
+ }
440
+ },
399
441
  R"mydelimiter(
400
442
  Sets the astronomical coordinates of the microlensing target and
401
443
  specifies the path where to look for the position tables
@@ -440,6 +482,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
440
482
  vbm.def("PSPLLightCurveParallax",
441
483
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
442
484
  {
485
+ if (!self.AreCoordinatesSet()) {
486
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
487
+ std::vector< std::vector<double> > results{ };
488
+ return results;
489
+ }
490
+ if (self.satellite > self.nsat) {
491
+ py::print("! Ephemerides table not available for this satellite!");
492
+ std::vector< std::vector<double> > results{ };
493
+ return results;
494
+ }
443
495
  std::vector<double> mags(times.size());
444
496
  std::vector<double> y1s(times.size());
445
497
  std::vector<double> y2s(times.size());
@@ -495,6 +547,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
495
547
  vbm.def("ESPLLightCurveParallax",
496
548
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
497
549
  {
550
+ if (!self.AreCoordinatesSet()) {
551
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
552
+ std::vector< std::vector<double> > results{ };
553
+ return results;
554
+ }
555
+ if (self.satellite > self.nsat) {
556
+ py::print("! Ephemerides table not available for this satellite!");
557
+ std::vector< std::vector<double> > results{ };
558
+ return results;
559
+ }
498
560
  std::vector<double> mags(times.size());
499
561
  std::vector<double> y1s(times.size());
500
562
  std::vector<double> y2s(times.size());
@@ -579,6 +641,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
579
641
  vbm.def("BinaryLightCurveParallax",
580
642
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
581
643
  {
644
+ if (!self.AreCoordinatesSet()) {
645
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
646
+ std::vector< std::vector<double> > results{ };
647
+ return results;
648
+ }
649
+ if (self.satellite > self.nsat) {
650
+ py::print("! Ephemerides table not available for this satellite!");
651
+ std::vector< std::vector<double> > results{ };
652
+ return results;
653
+ }
582
654
  std::vector<double> mags(times.size());
583
655
  std::vector<double> y1s(times.size());
584
656
  std::vector<double> y2s(times.size());
@@ -586,6 +658,7 @@ PYBIND11_MODULE(VBMicrolensing, m) {
586
658
  y1s.data(), y2s.data(), times.size());
587
659
  std::vector< std::vector<double> > results{ mags,y1s,y2s };
588
660
  return results;
661
+
589
662
  },
590
663
  R"mydelimiter(
591
664
  Static binary lens light curve for a given set of parameters including parallax.
@@ -609,6 +682,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
609
682
  vbm.def("BinaryLightCurveOrbital",
610
683
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
611
684
  {
685
+ if (!self.AreCoordinatesSet()) {
686
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
687
+ std::vector< std::vector<double> > results{ };
688
+ return results;
689
+ }
690
+ if (self.satellite > self.nsat) {
691
+ py::print("! Ephemerides table not available for this satellite!");
692
+ std::vector< std::vector<double> > results{ };
693
+ return results;
694
+ }
612
695
  std::vector<double> mags(times.size());
613
696
  std::vector<double> y1s(times.size());
614
697
  std::vector<double> y2s(times.size());
@@ -642,6 +725,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
642
725
  vbm.def("BinaryLightCurveKepler",
643
726
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
644
727
  {
728
+ if (!self.AreCoordinatesSet()) {
729
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
730
+ std::vector< std::vector<double> > results{ };
731
+ return results;
732
+ }
733
+ if (self.satellite > self.nsat) {
734
+ py::print("! Ephemerides table not available for this satellite!");
735
+ std::vector< std::vector<double> > results{ };
736
+ return results;
737
+ }
645
738
  std::vector<double> mags(times.size());
646
739
  std::vector<double> y1s(times.size());
647
740
  std::vector<double> y2s(times.size());
@@ -703,6 +796,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
703
796
  vbm.def("BinSourceLightCurveParallax",
704
797
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
705
798
  {
799
+ if (!self.AreCoordinatesSet()) {
800
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
801
+ std::vector< std::vector<double> > results{ };
802
+ return results;
803
+ }
804
+ if (self.satellite > self.nsat) {
805
+ py::print("! Ephemerides table not available for this satellite!");
806
+ std::vector< std::vector<double> > results{ };
807
+ return results;
808
+ }
706
809
  std::vector<double> mags(times.size());
707
810
  std::vector<double> y1s(times.size());
708
811
  std::vector<double> y2s(times.size());
@@ -792,6 +895,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
792
895
  vbm.def("BinSourceExtLightCurveXallarap",
793
896
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
794
897
  {
898
+ if (!self.AreCoordinatesSet()) {
899
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
900
+ std::vector< std::vector<double> > results{ };
901
+ return results;
902
+ }
903
+ if (self.satellite > self.nsat) {
904
+ py::print("! Ephemerides table not available for this satellite!");
905
+ std::vector< std::vector<double> > results{ };
906
+ return results;
907
+ }
795
908
  std::vector<double> mags(times.size());
796
909
  std::vector<double> y1s1(times.size());
797
910
  std::vector<double> y2s1(times.size());
@@ -823,6 +936,58 @@ PYBIND11_MODULE(VBMicrolensing, m) {
823
936
  source2 position y1 array, source2 position y2 array]
824
937
  )mydelimiter");
825
938
 
939
+
940
+ vbm.def("BinSourceBinLensLightCurve",
941
+ [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
942
+ {
943
+ if (!self.AreCoordinatesSet()) {
944
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
945
+ std::vector< std::vector<double> > results{ };
946
+ return results;
947
+ }
948
+ if (self.satellite > self.nsat) {
949
+ py::print("! Ephemerides table not available for this satellite!");
950
+ std::vector< std::vector<double> > results{ };
951
+ return results;
952
+ }
953
+ std::vector<double> mags(times.size());
954
+ std::vector<double> y1s1(times.size());
955
+ std::vector<double> y2s1(times.size());
956
+ std::vector<double> y1s2(times.size());
957
+ std::vector<double> y2s2(times.size());
958
+ std::vector<double> seps(times.size());
959
+ self.astrometry = true;
960
+ self.parallaxsystem = 1;
961
+ self.BinSourceBinLensLightCurve(params.data(), times.data(), mags.data(),
962
+ y1s1.data(), y2s1.data(), y1s2.data(), y2s2.data(), seps.data(), times.size());
963
+ std::vector< std::vector<double> > results{ mags, y1s1,y2s1,y1s2,y2s2,seps };
964
+ return results;
965
+ },
966
+ R"mydelimiter(
967
+ Binary source - Binary lens light curve including xallarap and orbital motion for a full array of observations.
968
+
969
+ Parameters
970
+ ----------
971
+ params : list[float]
972
+ List of parameters [log_s, log_q, u0, alpha, log_rho, log_tE, t0,
973
+ paiN, paiE, # components of the parallax vector
974
+ w1, w2, w3, # relative angular orbital velocity components (Einstein angle/day)
975
+ u02, t02, # impact parameter, time of closest approach of the seconf source
976
+ log_FR, # log of flux ratio of the two sources
977
+ ws1, ws2, ws3, # relative angular orbital velocity components of the sources (Einstein angle/day)
978
+ ]
979
+ times : list[float]
980
+ Array of times at which the magnification is calculated.
981
+
982
+ Returns
983
+ -------
984
+ results: list[list[float],list[float],list[float],list[float],list[float],list[float]]
985
+ [Magnification array,
986
+ source1 position y1 array, source1 position y2 array,
987
+ source2 position y1 array, source2 position y2 array,
988
+ projected separations of the two lenses]
989
+ )mydelimiter");
990
+
826
991
  vbm.def("BinSourceBinLensXallarap",
827
992
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
828
993
  {
@@ -857,6 +1022,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
857
1022
  vbm.def("BinSourceLightCurveXallarap",
858
1023
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
859
1024
  {
1025
+ if (!self.AreCoordinatesSet()) {
1026
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1027
+ std::vector< std::vector<double> > results{ };
1028
+ return results;
1029
+ }
1030
+ if (self.satellite > self.nsat) {
1031
+ py::print("! Ephemerides table not available for this satellite!");
1032
+ std::vector< std::vector<double> > results{ };
1033
+ return results;
1034
+ }
860
1035
  std::vector<double> mags(times.size());
861
1036
  std::vector<double> y1s(times.size());
862
1037
  std::vector<double> y2s(times.size());
@@ -923,6 +1098,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
923
1098
  vbm.def("TripleLightCurveParallax",
924
1099
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
925
1100
  {
1101
+ if (!self.AreCoordinatesSet()) {
1102
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1103
+ std::vector< std::vector<double> > results{ };
1104
+ return results;
1105
+ }
1106
+ if (self.satellite > self.nsat) {
1107
+ py::print("! Ephemerides table not available for this satellite!");
1108
+ std::vector< std::vector<double> > results{ };
1109
+ return results;
1110
+ }
926
1111
  std::vector<double> mags(times.size());
927
1112
  std::vector<double> y1s(times.size());
928
1113
  std::vector<double> y2s(times.size());
@@ -1006,6 +1191,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1006
1191
  vbm.def("PSPLAstroLightCurve",
1007
1192
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1008
1193
  {
1194
+ if (!self.AreCoordinatesSet()) {
1195
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1196
+ std::vector< std::vector<double> > results{ };
1197
+ return results;
1198
+ }
1199
+ if (self.satellite > self.nsat) {
1200
+ py::print("! Ephemerides table not available for this satellite!");
1201
+ std::vector< std::vector<double> > results{ };
1202
+ return results;
1203
+ }
1009
1204
  std::vector<double> mags(times.size());
1010
1205
  std::vector<double> c1s(times.size());
1011
1206
  std::vector<double> c2s(times.size());
@@ -1045,6 +1240,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1045
1240
  vbm.def("ESPLAstroLightCurve",
1046
1241
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1047
1242
  {
1243
+ if (!self.AreCoordinatesSet()) {
1244
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1245
+ std::vector< std::vector<double> > results{ };
1246
+ return results;
1247
+ }
1248
+ if (self.satellite > self.nsat) {
1249
+ py::print("! Ephemerides table not available for this satellite!");
1250
+ std::vector< std::vector<double> > results{ };
1251
+ return results;
1252
+ }
1048
1253
  std::vector<double> mags(times.size());
1049
1254
  std::vector<double> c1s(times.size());
1050
1255
  std::vector<double> c2s(times.size());
@@ -1087,6 +1292,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1087
1292
  vbm.def("BinaryAstroLightCurve",
1088
1293
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1089
1294
  {
1295
+ if (!self.AreCoordinatesSet()) {
1296
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1297
+ std::vector< std::vector<double> > results{ };
1298
+ return results;
1299
+ }
1300
+ if (self.satellite > self.nsat) {
1301
+ py::print("! Ephemerides table not available for this satellite!");
1302
+ std::vector< std::vector<double> > results{ };
1303
+ return results;
1304
+ }
1090
1305
  std::vector<double> mags(times.size());
1091
1306
  std::vector<double> c1s(times.size());
1092
1307
  std::vector<double> c2s(times.size());
@@ -1128,6 +1343,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1128
1343
  vbm.def("BinaryAstroLightCurveOrbital",
1129
1344
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1130
1345
  {
1346
+ if (!self.AreCoordinatesSet()) {
1347
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1348
+ std::vector< std::vector<double> > results{ };
1349
+ return results;
1350
+ }
1351
+ if (self.satellite > self.nsat) {
1352
+ py::print("! Ephemerides table not available for this satellite!");
1353
+ std::vector< std::vector<double> > results{ };
1354
+ return results;
1355
+ }
1131
1356
  std::vector<double> mags(times.size());
1132
1357
  std::vector<double> c1s(times.size());
1133
1358
  std::vector<double> c2s(times.size());
@@ -1171,6 +1396,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1171
1396
  vbm.def("BinaryAstroLightCurveKepler",
1172
1397
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1173
1398
  {
1399
+ if (!self.AreCoordinatesSet()) {
1400
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1401
+ std::vector< std::vector<double> > results{ };
1402
+ return results;
1403
+ }
1404
+ if (self.satellite > self.nsat) {
1405
+ py::print("! Ephemerides table not available for this satellite!");
1406
+ std::vector< std::vector<double> > results{ };
1407
+ return results;
1408
+ }
1174
1409
  std::vector<double> mags(times.size());
1175
1410
  std::vector<double> c1s(times.size());
1176
1411
  std::vector<double> c2s(times.size());
@@ -1216,6 +1451,16 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1216
1451
  vbm.def("BinSourceAstroLightCurveXallarap",
1217
1452
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1218
1453
  {
1454
+ if (!self.AreCoordinatesSet()) {
1455
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1456
+ std::vector< std::vector<double> > results{ };
1457
+ return results;
1458
+ }
1459
+ if (self.satellite > self.nsat) {
1460
+ py::print("! Ephemerides table not available for this satellite!");
1461
+ std::vector< std::vector<double> > results{ };
1462
+ return results;
1463
+ }
1219
1464
  std::vector<double> mags(times.size());
1220
1465
  std::vector<double> c1s(times.size());
1221
1466
  std::vector<double> c2s(times.size());
@@ -1259,9 +1504,80 @@ PYBIND11_MODULE(VBMicrolensing, m) {
1259
1504
  )mydelimiter");
1260
1505
 
1261
1506
 
1507
+ vbm.def("BinSourceBinLensAstroLightCurve",
1508
+ [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1509
+ {
1510
+ if (!self.AreCoordinatesSet()) {
1511
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1512
+ std::vector< std::vector<double> > results{ };
1513
+ return results;
1514
+ }
1515
+ if (self.satellite > self.nsat) {
1516
+ py::print("! Ephemerides table not available for this satellite!");
1517
+ std::vector< std::vector<double> > results{ };
1518
+ return results;
1519
+ }
1520
+ std::vector<double> mags(times.size());
1521
+ std::vector<double> c1s(times.size());
1522
+ std::vector<double> c2s(times.size());
1523
+ std::vector<double> c1l(times.size());
1524
+ std::vector<double> c2l(times.size());
1525
+ std::vector<double> y1s1(times.size());
1526
+ std::vector<double> y2s1(times.size());
1527
+ std::vector<double> y1s2(times.size());
1528
+ std::vector<double> y2s2(times.size());
1529
+ std::vector<double> seps(times.size());
1530
+ self.astrometry = true;
1531
+ self.parallaxsystem = 1;
1532
+ self.BinSourceBinLensAstroLightCurve(params.data(), times.data(), mags.data(), c1s.data(), c2s.data(), c1l.data(), c2l.data(),
1533
+ y1s1.data(), y2s1.data(), y1s2.data(), y2s2.data(), seps.data(), times.size());
1534
+ std::vector< std::vector<double> > results{ mags, c1s, c2s, c1l, c2l,y1s1,y2s1,y1s2,y2s2,seps };
1535
+ return results;
1536
+ },
1537
+ R"mydelimiter(
1538
+ Binary source - Binary lens light curve and astrometry including xallarap and orbital motion for a full array of observations.
1539
+
1540
+ Parameters
1541
+ ----------
1542
+ params : list[float]
1543
+ List of parameters [log_s, log_q, u0, alpha, log_rho, log_tE, t0,
1544
+ paiN, paiE, # components of the parallax vector
1545
+ w1, w2, w3, # relative angular orbital velocity components (Einstein angle/day)
1546
+ u02, t02, # impact parameter, time of closest approach of the seconf source
1547
+ log_FR, # log of flux ratio of the two sources
1548
+ ws1, ws2, ws3, # relative angular orbital velocity components of the sources (Einstein angle/day)
1549
+ muS_N, muS_E, # proper motion components of the source (mas/yr)
1550
+ pai_S, # parallax of the source (mas)
1551
+ thetaE # Einstein angle (mas)
1552
+ ]
1553
+ times : list[float]
1554
+ Array of times at which the magnification is calculated.
1555
+
1556
+ Returns
1557
+ -------
1558
+ results: list[list[float],list[float],list[float],list[float],list[float],list[float],list[float],list[float],list[float],list[float]]
1559
+ [Magnification array,
1560
+ centroid of images N array, centroid of images E array,
1561
+ centroid of lens N array, centroid of lens E array,
1562
+ source1 position y1 array, source1 position y2 array,
1563
+ source2 position y1 array, source2 position y2 array,
1564
+ projected separations of the two lenses]
1565
+ )mydelimiter");
1566
+
1567
+
1262
1568
  vbm.def("TripleAstroLightCurve",
1263
1569
  [](VBMicrolensing& self, std::vector<double> params, std::vector<double> times)
1264
1570
  {
1571
+ if (!self.AreCoordinatesSet()) {
1572
+ py::print("Use SetObjectCoordinates before any parallax calculation!");
1573
+ std::vector< std::vector<double> > results{ };
1574
+ return results;
1575
+ }
1576
+ if (self.satellite > self.nsat) {
1577
+ py::print("! Ephemerides table not available for this satellite!");
1578
+ std::vector< std::vector<double> > results{ };
1579
+ return results;
1580
+ }
1265
1581
  std::vector<double> mags(times.size());
1266
1582
  std::vector<double> c1s(times.size());
1267
1583
  std::vector<double> c2s(times.size());
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: VBMicrolensing
3
- Version: 5.1.1
3
+ Version: 5.3
4
4
  Summary: VBMicrolensing is a tool for efficient computation in gravitational microlensing events using the advanced contour integration method, supporting single, binary and multiple lenses.
5
5
  Keywords: Microlensing magnification and astrometry
6
6
  Author-Email: Valerio Bozza <valboz@sa.infn.it>, Vito Saggese <vitosaggese.vs@gmail.com>
@@ -27,12 +27,12 @@ In particular, VBMicrolensing is designed for the following calculations:
27
27
 
28
28
  `VBMicrolensing` is written as a C++ library and wrapped as a Python package, the user can call the code from either C++ or Python. This new code encompasses the well-known [VBBinaryLensing](https://github.com/valboz/VBBinaryLensing) code, which is at the basis of several platforms for microlensing modeling. `VBBinaryLensing` will still be available as a legacy software, but will no longer be maintained.
29
29
 
30
- `VBMicrolensing` has been developed by **Valerio Bozza**, University of Salerno, with a substantial contribution by **Vito Saggese**, University of Naples and **Jiyuan Zhang**, Tisnghua University. We also acknowledge a long list of collaborators who contributed to testing and development of particular aspects over the years: Etienne Bachelet, Fran Bartolic, Sebastiano Calchi Novati, Giovanni Covone, Giuseppe D'Ago, Tyler Heintz, Ava Hoag, Markus Hundertmark, Elahe Khalouei, Radek Poleski, Haibin Ren, Paolo Rota, Sedighe Sajadian, Rachel Street, Keto Zhang, Weicheng Zhang, Wei Zhu.
30
+ `VBMicrolensing` has been developed by **Valerio Bozza**, University of Salerno, with a substantial contribution by **Vito Saggese**, University of Naples and **Jiyuan Zhang**, Tisnghua University. We also acknowledge a long list of collaborators who contributed to testing and development of particular aspects over the years: Natasha Abrams, Etienne Bachelet, Fran Bartolic, Dex Bhadra, Sebastiano Calchi Novati, Giovanni Covone, Giuseppe D'Ago, Tyler Heintz, Ava Hoag, Markus Hundertmark, Elahe Khalouei, Jessica Lu, Matthew Penny, Radek Poleski, Haibin Ren, Paolo Rota, Sedighe Sajadian, Rachel Street, Keto Zhang, Weicheng Zhang, Wei Zhu.
31
31
 
32
32
  ## Attribution
33
33
  Any use of this code for scientific publications should be acknowledged by a citation to the works relevant to your study:
34
34
  - [V. Bozza, MNRAS 408 (2010) 2188](https://ui.adsabs.harvard.edu/abs/2010MNRAS.408.2188B/abstract): general algorithm for binary lensing;
35
- - [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;
35
+ - [V. Bozza, E. Bachelet, F. Bartolic, T. Heintz, A. Hoag, M. Hundertmark, MNRAS 479 (2018) 5157](https://ui.adsabs.harvard.edu/abs/2018MNRAS.479.5157B/abstract): BinaryMag2 function, Extended-Source-Point-Lens methods;
36
36
  - [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;
37
37
  - [V. Bozza, v. Saggese, G. Covone, P. Rota & J. Zhang, A&A 694 (2025) 219](https://ui.adsabs.harvard.edu/abs/2025A%26A...694A.219B/abstract): multiple lenses.
38
38
 
@@ -59,6 +59,7 @@ If you just want to use the C++ library, clone this repository, all cpp files an
59
59
 
60
60
  The package also contains the following files:
61
61
  - `VBMicrolensing/data/ESPL.tbl` - Pre-calculated table for Extended-source-point-lens
62
+ - `VBMicrolensing/data/SunEphemeris.txt` - Sun ephemeris for parallax calculation
62
63
  - `VBMicrolensing/data/OB151212coords.txt` - Sample file with event coordinates
63
64
  - `VBMicrolensing/data/satellite1.txt` - Sample table for satellite position (Spitzer)
64
65
  - `VBMicrolensing/data/satellite2.txt` - Sample table for satellite position (Kepler)
@@ -0,0 +1,16 @@
1
+ vbmicrolensing.libs/libgcc_s-1257a076.so.1,sha256=wbXWo2Qh33OuE7spB8-mVbZoEiUkvZu6ZH78pUNr9X8,168321
2
+ vbmicrolensing.libs/libstdc++-0530927c.so.6.0.32,sha256=h2p2et0WB0CYcMcUEViWjYXOe8uir-_tHJJZui-6GRc,3537509
3
+ vbmicrolensing-5.3.dist-info/METADATA,sha256=HzYzW5BnoiFafPOeleHg4fPbbRFJv77W2eUO194B0EY,5252
4
+ vbmicrolensing-5.3.dist-info/RECORD,,
5
+ vbmicrolensing-5.3.dist-info/WHEEL,sha256=Gn71w5XGPEA6oH49qoed5OcYzpzuctX6-QkJzqvkUKs,115
6
+ vbmicrolensing-5.3.dist-info/licenses/LICENSE,sha256=9Mshi9y3rHWswcmBvMd7l39rm2wqMn1ySJ_J_MvpDbo,7651
7
+ VBMicrolensing/__init__.py,sha256=4Vvgfp21A_YOYqJUvBxXgWLOGannprtI4bZG31ELQgY,339
8
+ VBMicrolensing/VBMicrolensing.so,sha256=40y_VXtYIWDpVggsJn8-Zb90FUTMHzIB-4Z_BGjzqRs,951497
9
+ VBMicrolensing/lib/VBMicrolensingLibrary.cpp,sha256=DdN0jqrT4YTH9B2jUpgsO6utA7Yv9iRRZxr-0h4qgxI,281308
10
+ VBMicrolensing/lib/python_bindings.cpp,sha256=ZeD0kqafLExPqgvsITdlFJ4moBoahhgukIGTcqClTlU,86363
11
+ VBMicrolensing/lib/VBMicrolensingLibrary.h,sha256=pW9MKGPGSh2N4nJLI5u-3cz1sfGowbL4jEBWdZCWrKE,23085
12
+ VBMicrolensing/data/SunEphemeris.txt,sha256=6PIPZoa6L38ITLUFDWFcmbREWgQkrGZePtDmgjaa-F8,1591038
13
+ VBMicrolensing/data/satellite2.txt,sha256=wEySAu6SiUc7y5Vmx_B5jUnStpEtUyYp4u-HKlvb4Wk,112560
14
+ VBMicrolensing/data/satellite1.txt,sha256=JzmXrT2aUJxoArVcXyZyGfscwSFIow_0fRh_ZMcxNS0,110290
15
+ VBMicrolensing/data/OB151212coords.txt,sha256=j8i1PA8r1atAO22li0KxM2cVWUDGF9tMaNurX-6Vx0o,18
16
+ VBMicrolensing/data/ESPL.tbl,sha256=Pv6QdMo1hJAlDdh2Znci9YHRej9gyrrASuLaegKiMsQ,488032
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.4
2
+ Generator: scikit-build-core 0.11.5
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-musllinux_1_2_i686
5
5