ebachelet / pyLIMA

GNU General Public License v3.0
31 stars 8 forks source link

'VBBinaryLensing.VBBinaryLensing.VBBinaryLensing' object has no attribute 'SetLDprofile' #74

Closed anibal-art closed 1 year ago

anibal-art commented 1 year ago

Hello I encontered this error when I simulate an event using FSPLarge model. I'm attaching the code used to

Parallax(Full) estimated for the telescope W149: SUCCESS Parallax(Full) estimated for the telescope LSSTr: SUCCESS

ESPL table not found !

AttributeError Traceback (most recent call last) Cell In[35], line 54 52 my_own_parameters += my_own_flux_parameters 53 pyLIMA_parameters = my_own_model.compute_pyLIMA_parameters(my_own_parameters) ---> 54 simulator.simulate_lightcurve_flux(my_own_model, pyLIMA_parameters) 56 for k in range(0,len(new_creation.telescopes)): 57 model_flux = my_own_model.compute_the_microlensing_model(new_creation.telescopes[k], 58 pyLIMA_parameters)['photometry']

File ~/anaconda3/lib/python3.11/site-packages/pyLIMA/simulations/simulator.py:335, in simulate_lightcurve_flux(model, pyLIMA_parameters, add_noise) 330 for ind, telescope in enumerate(model.event.telescopes): 332 if telescope.lightcurve_flux is not None: 334 theoritical_flux = \ --> 335 model.compute_the_microlensing_model(telescope, pyLIMA_parameters)[ 336 'photometry'] 338 if add_noise: 339 340 # if exposure_times is not None: 341 # exp_time = exposure_times[ind] 343 observed_flux, err_observed_flux = \ 344 brightness_transformation.noisy_observations( 345 theoritical_flux)

File ~/anaconda3/lib/python3.11/site-packages/pyLIMA/models/ML_model.py:479, in MLmodel.compute_the_microlensing_model(self, telescope, pyLIMA_parameters) 476 astrometric_model = None 478 if telescope.lightcurve_flux is not None: --> 479 magnification = self.model_magnification(telescope, pyLIMA_parameters) 481 # f_source, f_blend = self.derive_telescope_flux(telescope, 482 # pyLIMA_parameters, magnification) 483 self.derive_telescope_flux(telescope, pyLIMA_parameters, magnification)

File ~/anaconda3/lib/python3.11/site-packages/pyLIMA/models/FSPLarge_model.py:27, in FSPLargemodel.model_magnification(self, telescope, pyLIMA_parameters, return_impact_parameter) 23 try: 25 sqrt_limb_darkening = telescope.ld_a2 ---> 27 return magnification_VBB.magnification_FSPL(source_trajectory_x, 28 source_trajectory_y, 29 rho, linear_limb_darkening, 30 sqrt_limb_darkening) 31 except ValueError: 33 return magnification_VBB.magnification_FSPL(source_trajectory_x, 34 source_trajectory_y, 35 rho, linear_limb_darkening)

File ~/anaconda3/lib/python3.11/site-packages/pyLIMA/magnification/magnification_VBB.py:37, in magnification_FSPL(tau, beta, rho, limb_darkening_coefficient, sqrt_limb_darkening_coefficient) 34 VBB.a1 = limb_darkening_coefficient 36 if sqrt_limb_darkening_coefficient is not None: ---> 37 VBB.SetLDprofile(VBB.LDsquareroot) 38 VBB.a2 = sqrt_limb_darkening_coefficient 40 magnification_fspl = []

AttributeError: 'VBBinaryLensing.VBBinaryLensing.VBBinaryLensing' object has no attribute 'SetLDprofile'

Thanks in advance!

ebachelet commented 1 year ago

This is an issue due to the recent update of VBB. The python wrapping is not working properly and we are working on a fix. Meanwhile, I updated pyLIMA to support this issue and it should work now.